James Reads


Week of Apr 14th, 2019

  • Is Pete Buttigieg Literally Parks and Rec’s Ben Wyatt?

    It’s a question worthy of FBI agent Burt Macklin himself: Why does Democratic presidential candidate Pete Buttigieg seem so familiar? America, after all, has never seen a 37-year-old, multilingual, Harvard- and Oxford-educated, married, gay veteran and small-city mayor run for president before.

    Read at 05:44 pm, Apr 19th

  • Mozilla details Pyodide, which brings Python to browsers

    In a step toward its goal of building out a data science development stack for web browsers, Mozilla today detailed Pyodide, an experimental Python project that’s designed to perform computation without the need for a remote kernel (i.e., a program that runs and inspects code).

    Read at 05:40 pm, Apr 19th

  • Mark Zuckerberg leveraged Facebook user data to fight rivals and help friends, leaked documents show

    Facebook’s leaders seriously discussed selling access to user data — and privacy was an afterthought.

    Read at 05:38 pm, Apr 19th

  • Fatal Error Recovery Mode in 5.2

    WordPress 5.2 will allow administrators to fix or mitigate fatal errors on their site that would previously have been impossible to address without developer interference and modifying the codebase.

    Read at 02:41 pm, Apr 19th

  • Foxconn is confusing the hell out of Wisconsin

    It was summer in Wisconsin, and Foxconn seemed to be everywhere. But also: nowhere at all. Starting last June, officials with the Taiwanese tech manufacturing giant began popping up in all corners of the state and announcing new projects. It had been almost a year since then-Gov.

    Read at 02:38 pm, Apr 19th

  • Suspect in 3 Black Church Fires in Louisiana Is Charged With Hate Crimes

    The man, Holden Matthews, the 21-year-old son of a deputy sheriff, was arrested last week, accused of setting fire to the churches in St. Landry Parish, north of Lafayette. He pleaded not guilty on Monday and was not granted bond.

    Read at 11:22 am, Apr 18th

  • Standing with Ilhan Omar against the Christian Right, Spineless Democrats, and Donald Trump

    Representative Ilhan Omar (D – MN) has faced intense scrutiny and now death threats for questioning our nation’s foreign policy as it relates to the state of Israel.

    Read at 09:35 am, Apr 18th

  • Stop Mentoring First-Time Contributors

    If you’re an open source maintainer lucky enough to have a significant number of contributors you need to learn to mentor efficiently. First timer issues are not the right good way to get people involved in your project nor mentoring individual first-time contributors.

    Read at 09:32 am, Apr 18th

  • Only rebellion will prevent an ecological apocalypse

    Had we put as much effort into preventing environmental catastrophe as we’ve spent on making excuses for inaction, we would have solved it by now. Everywhere I look, I see people engaged in furious attempts to fend off the moral challenge it presents.

    Read at 09:31 am, Apr 18th

  • Hackers Could Read Your Hotmail, MSN, and Outlook Emails by Abusing Microsoft Support

    On Saturday, Microsoft confirmed to TechCrunch that some users of the company’s email service had been targeted by hackers.

    Read at 09:28 am, Apr 18th

  • Bernie Sanders Accuses Liberal Think Tank of Smearing Progressive Candidates

    WASHINGTON — Senator Bernie Sanders, in a rare and forceful rebuke by a presidential candidate of an influential party ally, has accused a liberal think tank of undermining Democrats’ chances of taking back the White House in 2020 by “using its resources to smear” him and other contenders pu

    Read at 09:25 am, Apr 18th

  • In Attacking Ilhan Omar, Trump Revives His Familiar Refrain Against Muslims

    WASHINGTON — President Trump has often seen the political benefits of stigmatizing Muslims. During the 2016 campaign, he would not rule out creating a registry of Muslims in the United States. He claimed to have seen “thousands” of Muslims cheering on rooftops in New Jersey after Sept.

    Read at 08:28 am, Apr 18th

  • Sometimes it’s better for tests to hit the real API

    The other day I ran my test suite and discovered that nine of my tests were suddenly and mysteriously broken. These tests were all related to the same feature: a physician search field that hits something called the NPPES NPI Registry, a public API.

    Read at 08:24 am, Apr 18th

  • Why Action is a bad name for a Redux Action

    A brief reflection on how the name Action affects our cognitive understanding of the concept in the Redux Architecture, and how this harms our lives.

    Read at 08:21 am, Apr 18th

  • How do you compose JavaScript functions with multiple parameters?

    As functional programmers, we like to piece our programs together out of small pieces. Our main tool for this is composition. We take an input, process it through a function, then pass it on to another function. And this all works great so long as all our functions take exactly one argument.

    Read at 10:25 pm, Apr 17th

  • Citi Bike Pulls New Electric Bikes Off Streets, Citing Safety Concerns

    The pedal-assist bikes operated by Lyft-owned companies in New York City, San Francisco and Washington were removed based on concerns over the brakes.

    Read at 10:23 pm, Apr 17th

  • How Alexandria Ocasio-Cortez Broke All the Rules of New York Politics

    She became a star without paying her dues to the city’s entrenched establishment. Now, longtime political insiders are starting to grumble.

    Read at 10:17 pm, Apr 17th

  • Ocasio-Cortez Viewed Favorably by Majority of Voters in Her District

    Press Release Crosstabs Loudonville, NY.

    Read at 06:42 pm, Apr 17th

  • Mutiny at HQ Trivia fails to oust CEO

    This week’s banishment of host Scott Rogowsky was merely a symptom of the ongoing struggle to decide who will lead HQ Trivia. According to multiple sources, more than half of the startup’s staff signed an internal petition to depose CEO Rus Yusupov, whom they saw as mismanaging the company.

    Read at 06:35 pm, Apr 17th

  • How to Escape the Dreaded ‘Tenant Blacklist’

    Once you’re on this publicly available list, it’s nearly impossible to get off. But that doesn’t mean you’ll never be able to rent again. Q: In 2015, I rented a room in a Washington Heights apartment, paying rent to my roommate, who was the tenant on the lease.

    Read at 09:39 am, Apr 17th

  • Meet the democratic socialist who sent Rahm’s floor leader packing

    There’s never been a Chicago politician who quite fits the profile of Andre Vasquez, the former battle rapper and current democratic socialist who just took down veteran 40th Ward Ald. Patrick O’Connor, Mayor Rahm Emanuel’s city council floor leader. That probably scares some people.

    Read at 09:38 am, Apr 17th

  • One of the most popular posts in the history of my blog was a list with the click-baity name Ten Things A Serious JavaScript Developer Should Learn. It explicitly focused on the set of technical skills that you need to become a “senior” JavaScript developer.

    Read at 09:36 am, Apr 17th

  • State legislators pass bill to increase tenant protections against unscrupulous landlords

    Landlords who harass tenants could face up to four years in prison under the new laws

    Read at 09:29 am, Apr 17th

  • Female Nobel prize winner deemed not important enough for Wikipedia entry

    When the Royal Swedish Academy of Sciences in Stockholm announced the Nobel prize for physics this week, anyone wanting to find out more about one of the three winners would have drawn a blank on Wikipedia.

    Read at 09:26 am, Apr 17th

  • Ilhan Omar Never Stood a Chance

    Ilhan Omar has courted controversy ever since she transformed, in the public’s conception, from a telegenic symbol of American pluralism to an actual person with actual opinions.

    Read at 09:22 am, Apr 17th

  • Silicon Valley, once a bastion of libertarianism, sees a budding socialist movement

    In mid-March the employees at Kickstarter, a crowdfunding platform, announced their plans to unionize. Those efforts are ongoing, but if successful this would be the first union of white-collar employees at a major tech company.

    Read at 09:15 am, Apr 17th

  • Inside Ivanka’s Dreamworld

    The “first daughter” spent years rigorously cultivating her image. But she wasn’t prepared for scrutiny. You could tell by his eyes, the way they popped and gleamed and fixed on someone behind me. Only one person gets that kind of look from Donald Trump. “Oh!” the president said.

    Read at 08:07 am, Apr 17th

  • 2020 candidate Pete Buttigieg on taxing the rich and the future of American capitalism

    In the sprawling 2020 Democratic field, Pete Buttigieg may be the unlikeliest serious contender of all. He's just 37 years old. He's the mayor of South Bend, Indiana, a city of barely more than 100,000 people.

    Read at 07:21 pm, Apr 16th

  • Elizabeth Warren is the intellectual powerhouse of the Democratic party

    There’s still nearly a year to go before the Iowa caucuses, the first contest of the Democratic presidential primary, but the media has already counted Senator Elizabeth Warren out.

    Read at 07:11 pm, Apr 16th

  • ‘Liz Was a Diehard Conservative’

    Elizabeth Warren doesn’t like to talk about it, but for years she was a registered Republican. Why she left the GOP—and what it means for her campaign.

    Read at 09:30 am, Apr 16th

  • Inside the Russian effort to target Sanders supporters — and help elect Trump

    After Bernie Sanders lost his presidential primary race against Hillary Clinton in 2016, a Twitter account called Red Louisiana News reached out to his supporters to help sway the general election.

    Read at 09:29 am, Apr 15th

  • DA knew Jeffrey Epstein was a dangerous pedophile when arguing for leniency

    The Manhattan DA’s office had graphic and detailed evidence of pedophile billionaire Jeffrey Epstein’s depravity when a prosecutor inexplicably argued for leniency during his 2011 sex offender registry hearing, The Post has learned.

    Read at 09:17 am, Apr 15th

  • Julian Assange Got What He Deserved

    Updated at 12:22 a.m. ET on April 15, 2019.

    Read at 09:16 am, Apr 15th

  • ep8 - Deploying Node.js app with shipit.js to ubuntu server

    In this episode, I present a different approach to deploying a node.js app. We don't use docker but shipit - an automation tool - to deploy express server to ubuntu instance.

    Read at 11:19 pm, Apr 14th

  • Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015

    "Speaker: Raymond HettingerDistillation of knowledge gained from a decade of Python consulting, Python training, code reviews, and serving as a core developer. Learn to avoid some of the hazards of the PEP 8 style guide and learn what really matters for creating beautiful intelligible code.Slides

    Read at 11:14 pm, Apr 14th

  • The Hidden Horror of Hudson Yards Is How It Was Financed

    Since its official unveiling last month, critics have been teeing off on Hudson Yards, the $25 billion office-and-apartment megaproject on Manhattan’s West Side.

    Read at 09:06 pm, Apr 14th

  • Trump Assails Ilhan Omar With Video of 9/11 Attacks

    President Trump on Friday targeted Representative Ilhan Omar for remarks she made during a speech on civil rights and Muslims in America with a graphic video featuring the burning World Trade Center towers and other images from Sept. 11, 2001, that he tweeted to millions of his followers.

    Read at 06:58 pm, Apr 14th

  • 'Fox News brain': meet the families torn apart by toxic cable news

    I love my mother. She is one of the kindest and sweetest people you will ever meet and I would be nothing without her. I’ve never heard her say a bad word about anyone, never mind anything overtly terrible, like the type of thing, for example, you might hear from Tucker Carlson or Sean Hannity.

    Read at 06:56 pm, Apr 14th

  • Democrats Are Falling Into the Ilhan Omar Trap

    Many of President Donald Trump’s tweets backfire, but not his tweet attack on U.S. Representative Ilhan Omar. That one tweet succeeded to perfection. Trump wishes to make Omar the face of the Democratic Party heading into the 2020 elections—and now he has provoked Democrats to comply.

    Read at 06:47 pm, Apr 14th

  • Pete Buttigieg is officially running for president

    Pete Buttigieg, the mayor of South Bend, Ind., officially launched his bid for the White House on Sunday – joining a crowded field of Democrat hopefuls.

    Read at 06:41 pm, Apr 14th

  • Can software engineering be meaningful work?

    The world is full of problems—from poverty to climate change—and it seems like software ought to be able to help. And yet your own programming job seems pointless, doing nothing to make things better. Far too many jobs are just about making some rich people just a little bit richer.

    Read at 05:40 pm, Apr 14th

  • Kyle Simpson: I’ve Forgotten More JavaScript Than Most People Ever Learn

    Kyle Simpson is, perhaps, the most highly-anticipated speaker of JSNation Conference 2019: he holds workshops on June 5 & 6 and gives a keynote address on June 7. Kyle is a living JavaScript classic, the truest embodiment of the spirit of open source.

    Read at 05:03 pm, Apr 14th

  • What I’ve Learned From Collecting Stories of People Whose Loved Ones Were Transformed by Fox News

    It was somewhere around the 100th response that my brain turned to mush.

    Read at 04:55 pm, Apr 14th

  • A Texas bill would allow the death penalty for patients who get abortions

    The bill would criminalize all abortions, with no exceptions for rape or incest, and would make it possible to charge a woman with homicide for having the procedure, according to the Washington Post. The state of Texas allows capital punishment for homicide. Rep.

    Read at 04:48 pm, Apr 14th

  • Cabán Will Appear on Democratic Primary Ballot for DA

    Public defender Tiffany Cabán will appear on the ballot in the Democratic primary for Queens District Attorney after no specific objections were filed against her ballot petition. The primary election is scheduled for June 25.

    Read at 04:45 pm, Apr 14th

  • Reports: Trump offered to pardon Homeland Security head if law broken while closing border

    President Donald Trump is showcasing a section of border wall that separates the United States and Mexico. (April 5) AP, AP

    Read at 04:44 pm, Apr 14th

  • Let Undocumented Immigrants Drive

    The editorial board represents the opinions of the board, its editor and the publisher. It is separate from the newsroom and the Op-Ed section.

    Read at 04:43 pm, Apr 14th

  • Here's What Happens at a Local DSA Chapter Meeting, or: Despite National Stereotypes, Cleveland's Democratic Socialists are Organized and Mobilized

    It’s 6:30 on a Thursday evening and I’m wandering through a library in Cleveland Heights, following the young man with the rose pin on his shirt. I know that if I follow him — follow the rose — I’ll likely end up in the right place.

    Read at 04:26 pm, Apr 14th

  • Trump threatens to send undocumented immigrants to sanctuary cities

    President Donald Trump on Friday said that his administration is "strongly looking at" releasing detained undocumented immigrants into so-called sanctuary cities — contradicting a previous statement from the White House that the policy was no longer being considered.

    Read at 04:10 pm, Apr 14th

  • How Katie Bouman Accidentally Became the Face of the Black Hole Project

    As the first-ever picture of a black hole was unveiled this week, another image began making its way around the internet: a photo of a young scientist, clasping her hands over her face and reacting with glee to an image of an orange ring of light, circling a deep, dark abyss.

    Read at 03:49 pm, Apr 14th

  • Freelance full-stack Javascript developer

    © Danny Moerkerke

    Read at 03:46 pm, Apr 14th

  • U.S. Withdrawal from Syria: A DSA Dialogue

    Donald Trump now claims he will withdraw U.S. military forces from Syria, including pulling out the roughly 2,000 U.S. troops stationed there and ending military support for the Kurdish-led Democratic Union Party (PYD), 20,000 members of which have been killed fighting Islamic State.

    Read at 03:15 pm, Apr 14th

  • "Are Traps Gay?" | ContraPoints

    A psychosexual journey to the heart of a bad meme.(This is an educational video I made for scientific and artistic purposes and is very advertiser friendly.)✿Patreon: https://www.patreon.com/contrapoints✿Donate: https://paypal.me/contrapoints✿Merch: https://www.teepublic.com/stores/cont...✿S

    Read at 11:32 am, Apr 14th

  • Refactoring Backend Engineering Hiring at Slack

    For anyone who’s ever been involved in the hiring process, it’s no easy feat — particularly in a growing company.

    Read at 11:27 am, Apr 14th

  • Losing My Perfect Job

    Just a few minutes ago it was an ordinary Wednesday lunchtime. Now everything has changed. I’m on a video call with the CTO — my boss’s boss. He is explaining that yes, sadly, unfortunately…

    Read at 07:40 am, Apr 14th

  • Katie Bouman: the 29-year-old whose work led to first black hole photo

    This week, the world laid eyes on an image that previously it was thought was unseeable. The first visualisation of a black hole looks set to revolutionise our understanding of one of the great mysteries of the universe.

    Read at 07:36 am, Apr 14th

  • Using “box shadows” and clip-path together

    Twitter Facebook .tag { background: #FB8C00; color: #222; font: bold 32px system-ui; padding: 2rem 3rem 2rem 4rem; } .tag { /* ... */ clip-path: polygon(30px 0%, 100% 0%, 100% 100%, 30px 100%, 0 50%) } .tag { /* ... */ box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.

    Read at 07:35 am, Apr 14th

  • A horrifying globalThis polyfill in universal JavaScript · Mathias Bynens

    The globalThis proposal introduces a unified mechanism to access the global this in any JavaScript environment. It sounds like a simple thing to polyfill, but it turns out it’s pretty hard to get right. I didn’t even think it was possible until Toon blew my mind with an unexpected, creative solution. This write-up describes the difficulties with writing a proper globalThis polyfill. Such a polyfill has the following requirements: It must work in any JavaScript environment, including web browsers, workers in web browsers, extensions in web browsers, Node.js, and standalone JavaScript engine binaries. It must support sloppy mode, strict mode, and JavaScript modules. It must work regardless of the context the code runs in. (That is, it must still produce the correct result even if the polyfill is wrapped in a strict mode function by a packer at build time.) Terminology But first, a note on terminology. globalThis provides the value of this in the global scope. This is different from the global object in web browsers, for complicated reasons. Note that in JavaScript modules, there is a module scope intervening between the global scope and your code. The module scope hides the global scope’s this value, so the this value you see at the top-level in modules is actually undefined. TL;DR globalThis is not “the global object”; it’s simply the this from the global scope. Thanks to Domenic for helping me understand this important nuance. globalThis alternatives In a browser, globalThis is equivalent to window: globalThis === window;// → true frames works too: globalThis === frames;// → true However, window and frames are undefined within worker contexts (such as web workers and service workers). Luckily, self works in all browser contexts and is thus a more robust alternative: globalThis === self;// → true Neither window, frames, nor self are available within Node.js, though. Instead, global can be used: globalThis === global;// → true None of the above (window, frames, self, global) are available in stand-alone JavaScript engine shells, such as the ones installed by jsvu. There, you can access the global this: globalThis === this;// → true Furthermore, sloppy mode functions always have their this set to the global this, so even if you cannot run your code in the global scope, you could still get access to the global this as follows in sloppy mode: globalThis === (function() {return this;})();// → true However, the top-level this value is undefined in JavaScript modules, and this is undefined within strict mode functions, so this approach doesn’t work there. Once you’re in a strict mode context, there’s only one way to temporarily break out of it: the Function constructor, which generates sloppy functions! globalThis === Function('return this')();// → true Well, there’s two ways, since indirect eval has the same effect: globalThis === (0, eval)('this');// → true In web browsers, use of the Function constructor and eval is often disallowed using Content Security Policy (CSP). Websites often opt-in so such a policy, but it’s also enforced within Chrome extensions, for example. Unfortunately, this means that a proper polyfill cannot rely on the Function constructor or eval. Note: setTimeout('globalThis = this', 0) is ruled out for the same reason. In addition to commonly being blocked by CSP, there are two other reasons against using setTimeout for a polyfill. First, it’s not part of ECMAScript, and not available in all JavaScript environments. Second, it’s asynchronous, so even if setTimeout would be supported everywhere, it’d be painful to use in a polyfill on which other code depends. A naive polyfill It seems like it should be possible to combine the above techniques into a single polyfill, like so: // A naive globalThis shim. Don’t use this!const getGlobal = () => {if (typeof globalThis !== 'undefined') return globalThis;if (typeof self !== 'undefined') return self;if (typeof window !== 'undefined') return window;if (typeof global !== 'undefined') return global;if (typeof this !== 'undefined') return this;throw new Error('Unable to locate global object');};// Note: `var` is used instead of `const` to ensure `globalThis`// becomes a global variable (as opposed to a variable in the// top-level lexical scope) when running in the global scope.var globalThis = getGlobal(); But alas, this doesn’t work in strict mode functions or within JavaScript modules in non-browser environments (except those with globalThis support). In addition, getGlobal could return an incorrect result, since it relies on this which is context-dependent and could be altered by a bundler/packer. A robust polyfill Is it even possible to write a robust globalThis polyfill? Assume an environment where: you cannot rely on the value of globalThis, window, self, global, or this; you cannot use the Function constructor or eval; but you can rely on the integrity of all other JavaScript built-in functionality. It turns out there is a solution, but it’s not pretty. Let’s think about this for a minute. How do we get access to the global this without knowing how to access it directly? If we could somehow install a function property on the globalThis, and call it as a method on the globalThis, then we could access the this from that function: globalThis.foo = function() {return this;};var globalThisPolyfilled = globalThis.foo(); How can we do something like that without relying on globalThis or any host-specific binding that refers to it? We can’t just do the following: function foo() {return this;}var globalThisPolyfilled = foo(); foo() is now no longer called as a method, and so its this is undefined in strict mode or in JavaScript modules as discussed above. Strict mode functions have their this set to undefined. However, this is not the case for getters and setters! Object.defineProperty(globalThis, '__magic__', {get: function() {return this;},configurable: true // This makes it possible to `delete` the getter later.});// Note: `var` is used instead of `const` to ensure `globalThis`// becomes a global variable (as opposed to a variable in the// top-level lexical scope) when run in the global scope.var globalThisPolyfilled = __magic__;delete globalThis.__magic__; The above program installs a getter on the globalThis, accesses the getter to get a reference to the globalThis, and then cleans up by deleting the getter. This technique gives us access to the globalThis in all the desired circumstances, but it still relies on a reference to the global this on the first line (where it says globalThis). Can we avoid this dependency? How can we install a globally accessible getter without accessing the globalThis directly? Instead of installing the getter on globalThis, we install it on something the global this object inherits from — Object.prototype: Object.defineProperty(Object.prototype, '__magic__', {get: function() {return this;},configurable: true // This makes it possible to `delete` the getter later.});// Note: `var` is used instead of `const` to ensure `globalThis`// becomes a global variable (as opposed to a variable in the// top-level lexical scope).var globalThis = __magic__;delete Object.prototype.__magic__; Note: The ECMAScript spec doesn’t actually mandate that the global this inherit from Object.prototype, only that it must be an object. Object.create(null) creates an object that doesn’t inherit from Object.prototype. A JavaScript engine could use such an object as the global this without violating the spec, in which case the above code snippet still wouldn’t work (and indeed, Internet Explorer 7 did something like that!). Luckily, more modern JavaScript engines all seem to agree that the global this must have Object.prototype in its prototype chain. To avoid mutating Object.prototype in modern environments where globalThis is already available, we can change the polyfill as follows: (function() {if (typeof globalThis === 'object') return;Object.defineProperty(Object.prototype, '__magic__', {get: function() {return this;},configurable: true // This makes it possible to `delete` the getter later.});__magic__.globalThis = __magic__; // lolwatdelete Object.prototype.__magic__;}());// Your code can use `globalThis` now.console.log(globalThis); Alternatively, we could use __defineGetter__: (function() {if (typeof globalThis === 'object') return;Object.prototype.__defineGetter__('__magic__', function() {return this;});__magic__.globalThis = __magic__; // lolwatdelete Object.prototype.__magic__;}());// Your code can use `globalThis` now.console.log(globalThis); And there you have it: the most horrifying polyfill you’ve ever seen! It completely defies the prevalent best practice to not modify objects you don’t own. Mucking with built-in prototypes is generally a bad idea, as explained in JavaScript engine fundamentals: optimizing prototypes. On the other hand, the only way this polyfill can break is if someone manages to alter Object or Object.defineProperty (or Object.prototype.__defineGetter__) before the polyfill code runs. I can’t think of a more robust solution. Can you? Testing the polyfill The polyfill is a good an interesting example of universal JavaScript: it’s pure JavaScript code that does not rely on any host-specific built-ins, and therefore runs in any environment that implements ECMAScript. This was one of the goals of the polyfill in the first place! Let’s confirm that it actually works. Here’s an HTML demo page for the polyfill that logs globalThis using both a classic script globalthis.js and a module globalthis.mjs (with identical source code). This demo can be used to verify the polyfill works in browsers. globalThis is natively supported in V8 v7.1 / Chrome 71, Firefox 65, Safari 12.1, and iOS Safari 12.2. To test the interesting parts of the polyfill, open the demo page in an older browser. Note: The polyfill does not work in Internet Explorer 10 and older. In those browsers, the line __magic__.globalThis = __magic__ somehow doesn’t make globalThis globally available, despite __magic__ being a working reference to the global this. It turns out __magic__ !== window although both are [object Window], indicating that these browsers might be confused about the distinction between the global object and the global this. Amending the polyfill to fall back to one of the alternatives makes it work in IE 10 and IE 9. For IE 8 support, wrap the call to Object.defineProperty in a try-catch, similarly falling back in the catch block. (Doing so also avoids the IE 7 issue with the global this not inheriting from Object.prototype.) Try the demo with old IE support. To test in Node.js and standalone JavaScript engine binaries, download the very same JavaScript files: # Download the polyfill + demo code as a module.curl https://mathiasbynens.be/demo/globalthis.mjs > globalthis.mjs# Create a copy (well, symlink) of the file, to be used as a classic script.ln -s globalthis.mjs globalthis.js Now we can test in node: $ node --experimental-modules --no-warnings globalthis.mjsTesting the polyfill in a module[object global]$ node globalthis.jsTesting the polyfill in a classic script[object global] To test in a stand-alone JavaScript engine shell, use jsvu to install any desired engine, and then run the scripts directly. For example, to test in V8 v7.0 (without globalThis support) and v7.1 (with globalThis support): $ jsvu v8@7.0 # Install the `v8-7.0.276` binary.$ v8-7.0.276 globalthis.mjsTesting the polyfill in a module[object global]$ v8-7.0.276 globalthis.jsTesting the polyfill in a classic script[object global]$ jsvu v8@7.1 # Install the `v8-7.1.302` binary.$ v8-7.1.302 globalthis.jsTesting the polyfill in a classic script[object global]$ v8-7.1.302 globalthis.mjsTesting the polyfill in a module[object global] The same technique allows us to test in JavaScriptCore, SpiderMonkey, Chakra, and other JavaScript engines such as XS as well. Here’s an example using JavaScriptCore: $ jsvu # Install the `javascriptcore` binary.$ javascriptcore globalthis.mjsTesting the polyfill in a module[object global]$ javascriptcore globalthis.jsTesting the polyfill in a classic script[object global] Conclusion Writing universal JavaScript can be tricky, and often calls for creative solutions. The new globalThis feature makes it easier to write universal JavaScript that needs access to the global this value. Polyfilling globalThis correctly is more challenging than it seems, but there is a working solution. Only use this polyfill when you really need to. JavaScript modules make it easier than ever to import and export functionality without altering global state, and most modern JavaScript code doesn’t need access to the global this anyway. globalThis is only useful for libraries and polyfills that do. globalThis polyfills on npm Since publishing this article, the following npm packages started providing globalThis polyfills that make use of this technique: Disclaimer: I’m not the author, nor am I the maintainer, of any of these packages. Source: A horrifying globalThis polyfill in universal JavaScript · Mathias Bynens

    Read at 07:32 pm, Apr 19th

  • Facebook teams with rightwing Daily Caller in factchecking program | Technology | The Guardian

    Facebook’s controversial factchecking program is partnering with the Daily Caller, a rightwing website that has pushed misinformation and is known for pro-Trump content. The social network said Wednesday it had added CheckYourFact.com, which is part of the Daily Caller, as one of its US media partners in an initiative that has faced growing backlash from journalists and internal problems. The collaboration was first reported by Axios. Factcheckers in the program are tasked with debunking potential false stories on Facebook to help stop their spread, but some journalists have said the effort hasn’t been effective, and one of its major American partners, Snopes.com, cut ties earlier this year. The Daily Caller, co-founded by the far-right Fox News host Tucker Carlson, publishes conservative news stories and commentary and has faced repeated accusations of running false and offensive content. In January, the site was widely condemned for the way it reported on a fake nude photo of the congresswoman Alexandria Ocasio-Cortez, and its coverage of immigration and the White House has typically aligned with Trump’s agenda. Check Your Fact is billed as the “fact-check department” of the Daily Caller, and the site says it is “non-partisan” and “loyal to neither people nor parties”. It has dedicated reporters rating content as true and false and says it is a for-profit subsidiary of the Daily Caller Inc, of which Carlson is a majority owner. Facebook launched its factchecking program after the 2016 presidential election saw viral propaganda and false news on its platform and other social media sites. The company now partners with a wide range of media outlets around the globe, and its current US partners include the Associated Press, Factcheck.org and PolitiFact. Asked about its collaboration with the Daily Caller, a Facebook spokesperson noted that any news organization can apply to join the program after it gains certification from the non-partisan International Fact-Checking Network, run by the journalism institute Poynter. Poynter could not immediately be reached. 'They don't care': Facebook factchecking in disarray as journalists push to cut ties This week, a Wired investigation on Facebook reported that a vice-president at the company had once argued that the Facebook newsfeed should treat the content from Daily Caller and Breitbart, another rightwing outlet, in the same manner as stories from mainstream news outlets. On Wednesday, Facebook’s factchecking initiative also brought on Science Feedback, a not-for-profit organization that reviews news coverage on a range of subjects, including health and climate change. Facebook typically pays its media partners, which has led to criticisms from journalists who say this creates a conflict of interest, given that the news outlets taking Facebook funding are also tasked with scrutinizing the company’s impact on society. Major factchecking sites have repeatedly debunked Daily Caller content over the years. The Daily Caller previously published articles by the white supremacist behind a far-right rally in Charlottesville, falsely labeled a Trump critic as a “porn star” and published propaganda about George Soros. A Daily Caller editor was also caught writing for an “alt-right” website under a pseudonym last year. A Harvard report on partisan disinformation in 2016 said the Daily Caller played a “key role” in “creating and disseminating stories” that promoted deep “anti-Muslim sentiment” and “stoked the belief among core Trump followers” that Hillary Clinton was “criminal and treasonous”. Fox has also recently faced repeated boycott campaigns surrounding Carlson’s comments and news coverage. David Sivak, editor of Check Your Fact, declined to answer questions about the site’s arrangement with Facebook, but said in an email, “I’d be happy to put our track record up against anyone else’s. If you comb through the articles we’ve published on Check Your Fact over the last two years, you’ll quickly see that our fact checks are fair, in-depth and hold figures on both sides of the political aisle accountable, including Trump.” Source: Facebook teams with rightwing Daily Caller in factchecking program | Technology | The Guardian

    Read at 10:07 am, Apr 18th

  • David Brion Davis, 1927-2019: Countersubversive at Yale

    David Brion Davis, the pathbreaking Yale historian of slavery and emancipation, whose books revolutionized how we approach the American experience, has died. The obituaries have rightly discussed his many and manifold contributions, a legacy we will be parsing in the days and months ahead. Yet for those of us who were graduate students at Yale during the 1990s and who participated in the union drive there, the story of David Brion Davis is more complicated. Davis helped break the grade strike of 1995, in a manner so personal and peculiar, yet simultaneously emblematic, as not to be forgotten. Not long after the strike, I wrote at length about Davis’s actions in an essay called “Blacklisted and Blue: On Theory and Practice at Yale,” which later appeared in an anthology that was published in 2003. I’m excerpting the relevant part the essay below, but you can read it all of it here [pdf]. * * * As soon as the graduate students voted to strike, the administration leaped to action, threatening students with blacklisting, loss of employment, and worse. Almost as quickly, the national academic community rallied to the union’s cause. A group of influential law professors at Harvard and elsewhere issued a statement condemning the “Administration’s invitation to individual professors to terrorize their advisees.” They warned the faculty that their actions would “teach a lesson of subservience to illegitimate authority that is the antithesis of what institutions like Yale purport to stand for.” Eric Foner, a leading American historian at Columbia, spoke out against the administration’s measures in a personal letter to President Levin. “As a longtime friend of Yale,” Foner began, “I am extremely distressed by the impasse that seems to have developed between the administration and the graduate teaching assistants.” Of particular concern, he noted, was the “developing atmosphere of anger and fear” at Yale, “sparked by threats of reprisal directed against teaching assistants.” He then concluded: I wonder if you are fully aware of the damage this dispute is doing to Yale’s reputation as a citadel of academic freedom and educational leadership. Surely, a university is more than a business corporation and ought to adopt a more enlightened approach to dealing with its employees than is currently the norm in the business world. And in an era when Israelis and Palestinians, Bosnian Muslims and Bosnian Serbs, the British government and the IRA, have found it possible to engage in fruitful discussions after years of intransigent refusal to negotiate, it is difficult to understand why Yale’s administration cannot meet with representatives of the teaching assistants. Foner’s letter played a critical role during the grad strike. The faculty took him seriously; his books on the Civil War and Reconstruction are required reading at Yale. But more important, Foner is a historian, and at the time, a particularly tense confrontation in the Yale history department was spinning out of control. The incident involved teaching assistant Diana Paton, a British graduate student who was poised to write a dissertation on the transition in Jamaica from slavery to free labor, and historian David Brion Davis. A renowned scholar of slavery, Davis has written pathbreaking studies, earning him the Pulitzer Prize and a much-coveted slot as a frequent writer at the New York Review of Books. He represents the best traditions of humanistic learning, bringing to his work a moral sensitivity that few academics possess. Paton was his student and, that fall, his TA. When Paton informed Davis that she intended to strike, he accused her of betraying him. Convinced that Davis would not support her academic career in the future—he had told her in an unrelated discussion a few weeks prior that he would never give his professional backing to any student who he believed had betrayed him—Paton nevertheless stood her ground. Davis reported her to the graduate school dean for disciplinary action and had his secretary instruct Paton not to appear at the final exam. In his letter to the dean, Davis wrote that Paton’s actions were “outrageous, irresponsible to the students…and totally disloyal.” The day of the final, Paton showed up at the exam room. As she explains it, she wanted to demonstrate to Davis that she would not be intimidated by him, that she would not obey his orders. Davis, meanwhile, had learned of Paton’s plan to attend the exam and somehow concluded that she intended to steal the exams. So he had the door locked and two security guards stand beside it. Though assertive, Paton is soft-spoken and reserved. She is also small. The thought of her rushing into the exam room, scooping up her students’ papers, engaging perhaps in a physical tussle with the delicate Davis, and then racing out the door—the whole idea is absurd. Yet Davis clearly believed it wasn’t absurd. What’s more, he convinced the administration that it wasn’t absurd, for it was the administration that had dispatched the security detail. How this scenario could have been dreamed up by a historian with the nation’s most prestigious literary prizes under his belt—and with the full backing of one of the most renowned universities in the world—requires some explanation. Oddly enough, it is Davis himself who provides it. Like something out of Hansel and Gretel, Davis left a set of clues, going back some forty years, to his paranoid behavior during the grade strike. In a pioneering 1960 article in the Mississippi Valley Historical Review, “Some Themes of Counter-Subversion: An Analysis of Anti-Masonic, Anti-Catholic, and Anti-Mormon Literature,” Davis set out to understand how dominant groups in nineteenth-century America were gripped by fears of disloyalty, treachery, subversion, and betrayal. Many Americans feared Catholics, Freemasons, and Mormons because, it was believed, they belonged to “a machine-like organization” that sought “to abolish free society” and “to overthrow divine principles of law and justice.” Members of these groups were dangerous because they professed an “unconditional loyalty to an autonomous body” like the pope. They took their marching orders from afar, and so were untrustworthy, duplicitous, and dangerous. Davis was clearly disturbed by the authoritarian logic of the countersubversive, but that was in 1960 and he was writing about the nineteenth century. In 1995, confronting the rebellion of his own student, the logic made all the sense in the world. It didn’t matter that Paton was a longtime student of his, that she had many discussions with Davis about her academic work, and that he knew her well. As soon as she announced her commitment to the union’s course of action, she became a stranger, an alien marching on behalf of a foreign power. Davis was hardly alone in voicing these concerns. Other respected members of the Yale faculty dipped into the same well of historical imagery. In January 1996, at the annual meeting of the American Historical Association, several historians presented a motion to censure Yale for its retaliation against the striking TAs. During the debate on the motion, Nancy Cott—one of the foremost scholars of women’s history in the country who was on the Yale faculty at the time but has since gone on to Harvard—defended the administration, pointing out that the TA union was affiliated with the Hotel Employees and Restaurant Employees International Union. Historians at the meeting say that Cott placed a special emphasis on the word “international.” The TAs, in other words, were carrying out the orders of union bosses in Washington. The graduate students did not care about their own colleagues, they were not loyal to their own. Not unlike the Masons and Catholics of old. It did not seem to faze Cott that she was speaking to an audience filled with labor historians, all of whom would have recognized these charges as classic antiunion rhetoric. One of the reasons Cott embraced this vocabulary so unselfconsicously was that it was a virtual commonplace among the Yale faculty at the time. At a mid-December faculty meeting, which one professor compared to a Nuremberg rally, President Levin warned the faculty of the ties between the TAs and outside unions. The meeting was rife with lurid images of union heavies dictating how the faculty should run their classrooms. It never seemed to occur to these professors, who pride themselves on their independent judgment and intellectual perspicacity, that they were uncritically accepting some of the ugliest and most unfounded prejudices about unions, that they sounded more like the Jay Goulds and Andrew Carnegies of the late nineteenth century than the careful scholars and skeptical minds of the late twentieth. All they knew was their fear—that a conspiracy was afoot, that they were being forced to cede their authority to disagreeable powers outside of Yale. Cott, Levin, and the rest of the faculty were also in the grip of a raging class anxiety, which English professor Annabel Patterson spelled out in a letter to the Modern Language Association. The TA union, Patterson wrote, “has always been a wing of Locals 34 and 35 [two other campus unions]…who draw their membership from the dining workers in colleges and other support staff.” Why did Patterson single out cafeteria employees in her description of Locals 34 and 35? After all, these unions represent thousands of white- and blue-collar workers, everyone from skilled electricians and carpenters to research laboratory technicians, copy editors, and graphic designers. Perhaps it was that Patterson viewed dishwashers and plastic-gloved servers of institutional food as the most distasteful sector of the Yale workforce. Perhaps she thought that her audience would agree with her, and that a subtle appeal to their delicate, presumably shared, sensibilities would be enough to convince other professors that the TA union ought to be denied a role in the university. The professor-student relationship was the critical link in a chain designed to keep dirty people out. What if the TAs and their friends in the dining halls decided that professors should wash the dishes and plumbers should teach the classes? Hadn’t that happened during the Cultural Revolution? Hadn’t the faculty themselves imagined such delightful utopias as young student radicals during the 1960s? Recognizing the TA union would only open Yale to a rougher, less refined element, and every professor, even the most liberal, had something at stake in keeping that element out. In his article, Davis concluded with these sentences about the nineteenth-century countersubversive: By focusing his attention on the imaginary threat of a secret conspiracy, he found an outlet for many irrational impulses, yet professed his loyalty to the ideals of equal rights and government by law. He paid lip service to the doctrine of laissez-faire individualism, but preached selfless dedication to a transcendent cause. The imposing threat of subversion justified a group loyalty and subordination of the individual that would otherwise have been unacceptable. In a rootless environment shaken by bewildering social change the nativist found unity and meaning by conspiring against imaginary conspiracies. Though I don’t think Davis’s psychologizing holds much promise for understanding the Yale faculty’s response to the grade strike—the strike, after all, did pose a real threat to the faculty’s intuitions about both the place of graduate students in the university and the obligation of teachers; nor did the faculty seem, at least to me, to be on a desperate quest for meaning—he did manage to capture, long before the fact, the faculty’s fear that their tiered world of privileges and orders, so critical to the enterprise of civilization, was under assault. So did Davis envision the grotesque sense of fellowship that the faculty would derive from attacking their own students. The faculty’s outsized rhetoric of loyalty and disloyalty, of intimacy (Dean [Richard] Brodhead called the parties to the conflict a “dysfunctional family”) betrayed, may have fit uneasily with their avowed professions of individualism and intellectual independence. But it did give them the opportunity to enjoy, at least for a moment, that strange euphoria—the thrilling release from dull routine, the delightful, newfound solidarity with fellow elites—that every reactionary from Edmund Burke to Augusto Pinochet has experienced upon confronting an organized challenge from below. Paton’s relationship with Davis was ended. Luckily, she was able to find another advisor at Yale, Emilia Viotti da Costa, a Latin American historian who was also an expert on slavery. Da Costa, it turns out, had been a supporter of the student movement in Brazil some thirty years before and was persecuted by the military there. Forced to flee the country, she found in Yale a welcome refuge from repression. Source: David Brion Davis, 1927-2019: Countersubversive at Yale

    Read at 08:14 am, Apr 18th

  • Clever code | CSS-Tricks

    This week, Chris Ferdinandi examined a clever JavaScript snippet, one that's written creatively with new syntax features, but is perhaps less readable and performant. It's a quick read, but his callout of our industry's fixation on cleverness is worth... calling out: ...we’ve become obsessed as an industry with brevity and clever code, and it results in code that’s sometimes less performant, and typically harder to read and make sense of for most people. He made a similar argument late last month when he wrote about code readability, noting that brevity might look cool but ultimately leads to all sorts of issues in a codebase: Often, web developers are obsessed with brevity. There’s this thing were developers will try to write the same function in the fewest number of characters possible. Personally, I think brevity is pointless. Readability is a lot more important. I entirely agree with Chris on this point, however, I think there is one important distinction to make and that's the difference between code that's intended as a prototype and code that's intended for production. As Jeremy Keith argued a short while ago: What’s interesting is that—when it comes to prototyping—our usual front-end priorities can and should go out the window. The priority now is speed. If that means sacrificing semantics or performance, then so be it. If I’m building a prototype and I find myself thinking “now, what’s the right class name for this component?”, then I know I’m in the wrong mindset. That question might be valid for production code, but it’s a waste of time for prototypes. I agree with Chris that we should be writing code that is easy to read when we’re in production. I also think experimenting with code in this way is a good thing when it comes to prototypes. We shouldn’t ever shy away from playing with code and pushing things a little bit – so long as we’re not doing that in a giant web app with a a team of other developers working alongside us. I’ve noticed that there are some folks that are doing genuinely ingenious things with Sass. I consistently sit back and think, "Wow, I’ve never seen anything like this before." But when it comes to a production web app that has to be understood by hundreds of people at the same time, I don’t believe that this is the reaction we want when someone looks at the code. As a result, I’ve been trying to write Sass code that is actually so simple that it almost looks dumb. One easy way to make code a lot simpler is to reduce the amount of nesting: .element {
 .heading { ... }
 } This looks fine when there’s code inside — and it’s pretty easy to understand — but add a complex bit of design in the mix (say, using pseudo elements and media queries) and you suddenly have a rather complex set of rules in front of you. Creativity and cleverness can be harder to scan and identify one small part of the code that you’re looking for. Plus, in this example, we’ve unnecessarily made our .heading class a little bit more specific which might encourage us to override things in a hacky way elsewhere in the codebase. We could write the following: .element { ... }
 .element-heading { ... } I know this looks foolishly simple but the relationship between these two classes is easier to see and easier to extend in the future. Bundling all that code into a single nested class can get out of hand real fast. Even if it happens to look a lot cooler. (As an aside, Andy Bell's post on using the ampersand in Sass — and the resulting comments — is a great example of the clash between creativity and practicality.) Anyway, the point I’m trying to make here is that CSS (and JavaScript for that matter) is a strange language because there are no definite rules you can make about it. It all really depends on the codebase and the project. But I think we can safely say that our code ought to be a lot more boring than our prototypes when it moves to production. Continue to make prototypes that are wild and experimental or impossibly weird! Code quality be damned. Source: Clever code | CSS-Tricks

    Read at 02:40 pm, Apr 17th

  • Clever JavaScript does not mean simple or readable | Go Make Things

    Source: Clever JavaScript does not mean simple or readable | Go Make Things

    Read at 11:52 am, Apr 17th

  • How 'Liberal' Late-Night Talk Shows Became a Comedy Sinkhole - MEL Magazine

    In 2005, I attended the taping of what turned out to be a landmark episode of The Daily Show. The front half was the usual skewering of that day’s news, nothing too memorable — but the guest was the infamous Christopher Hitchens, a prickly proponent of the Iraq War, something the audience and host Jon Stewart regarded as a colossal mistake. While the two men on stage began their conversation with the obligatory chumminess of the late-night TV interview, it was bound to become a fierce debate on Iraq, and that’s exactly what happened: For around 20 minutes, Stewart challenged Hitchens’ excuses for a disastrous invasion, and Hitchens punched back, impressively enough that he could at one point observe the crowd had gone quiet. It was an electrifying encounter — one of the early examples of the breathless “so-and-so DESTROYS political opponent” fare that has choked the internet in years since. When Hitchens left, Stewart more or less apologized for the intensity of their debate, joking that the production team would have a great time trying to edit it down into a coherent segment. In truth, it wasn’t that common for him to go on the offensive, and anyone in that room intuitively understood why: It may have been cathartic, and even enlightening, but it wasn’t very funny. Talented as Stewart was (or is) at sneaking punchlines into a thorny discussion of geopolitics, those moments found him resisting a deep well of gravity created by bloody, corrupt and spiraling American empire. When you slice right into that issue, it will never be a laughing matter. The brutal reality of lives destroyed and a region in chaos cannot be domesticated for your living room. Understandably burnt out and ready to pass the torch, Stewart left The Daily Show in 2015 and has largely kept to himself in the Trump era. This makes the demarcation between the remarkable run of The Daily Show and The Colbert Report during the Bush and Obama presidencies and the current ecosystem of late-night talk shows especially crisp. In fact, Stewart’s career tells the story of what I regard as the three phases of political consciousness within the format. He took the reins of the show in 1999, right as the comedy hacks finally ran out of bad Monica Lewinsky jokes. From there, he (and soon Stephen Colbert) walked the tightrope of cogent, biting political satire, incidentally gifting mainstream network shows with freedom to ignore or address Washington at will. Then Colbert transitioned to that platform (theoretically leaving his political commentary behind), Stewart bounced, Trump took power in a shock election, and we entered a third act for TV writers expected to cull humor from the state of government and its leaders. Remember, the late-night model wasn’t really built for this: Johnny Carson, presumably liberal, explicitly avoided such topics and guests of that orbit; David Letterman wrapped his opinions in a hundred layers of irony; Jay Leno remained safely noncommittal and recently complained that today’s hosts are one-sided, begging for a return to every centrist’s favorite value: “civility.” But while it’s easy as ever to hit Leno as the epitome of uncool and brush off his asinine prescription (rudeness is hardly a hindrance to good comedy), the diagnosis from which he proceeds is inescapably true: These shows are fucking unwatchable. ‘Everyone Is on Autopilot’ You could fairly accuse me of hating late-night talk shows long before they transformed into entertainment for Resistance Boomers who think that calling Trump “the Cheeto-in-Chief” is devastatingly clever. For me, they are a frustrating waste of awesome talent. It’s painful to watch someone like Colbert, who makes me double up in laughter with his performance in the oddball ’90s sitcom Strangers With Candy, go through the paces of yet another weeknight monologue on the president’s bald hypocrisies. Then there are the people behind the scenes, toiling at bits they know are jarringly uncomical, with no way of challenging the hierarchy that demands them. One such writer, a man with an impressive résumé, reached out to me as I started this piece. He works at one of the major network late-night shows, and he’s despondent. (For obvious reasons, I won’t reveal his identity or other specifics on his employer.) “I have been venting about this very shit to [a friend] for about five months now,” he writes to me in a Twitter DM. “To me, this is all because of two big things, one being that the late night writers’ rooms are all extremely homogeneous groups of cynical, miserable white comedy dudes who figure out the ‘formula’ for the show early on and then never really work harder than they need to. Which makes sense, because the other big thing is that the people who make the actual decisions on these shows are all older, white dudes who are out of touch (but don’t think they are) and are never thinking in terms of comedy or upending power or doing anything interesting with the format, they just maintain the status quo and follow a formula of ‘thing we’ve done + a celebrity = hit.’” No doubt this was the same dynamic that gave us the first wave of late-night political hackery, when Bill Clinton’s rampant horniness and abuse of office turned into a parade of repetitive innuendo and cruel jokes at Monica Lewinsky’s expense (for which Letterman, at least, has voiced some regret). This time around, the stagnation makes for a punishingly superficial critique of Trump’s tenure and the man himself. It’s only natural that these Trump “takedowns” would lack the substance of, say, the Stewart-Hitchens confrontation. With rare exceptions, Kimmel, Corden, Colbert, Conan, Fallon and Meyers aren’t trying to push us anywhere uncomfortable; they’re who you watch to unwind at bedtime. This means papering over much of the true horror of being alive in this country right now — migrant family separation, emboldened Nazis, environmental and kleptocratic plunder — to feast on low-hanging fruit. “Monologue-wise, there’s just a bunch of shortcuts-to-jokes that every writer knows to hit for Trump stories now,” the exasperated TV writer tells me. “Talk about Trump loving fast food, reference a photo where he looks awful, call him orange, mention the Stormy Daniels thing (always in some not-so-thinly-veiled anti-sex-work way), say he tweets a lot, use one of his catchphrases like ‘Fake News,’ etc. Everyone’s on autopilot.” He adds, “Trying to push any new idea, even if it’s low-risk, is a series of hurdles that almost always ends in different producers saying they ‘don’t see it,’ or shutting it down because they don’t get a reference that the entire rest of the world would get, or bristling at the idea of even mentioning race/gender/sex in any creative way that isn’t already some catchphrase on a department store T-shirt.” In his writers’ room, he says, they don’t even have the freedom to pursue different, “evergreen” subjects, because “the Trump stuff got more engagement and sort of legitimized them as a ‘show with a point of view,’ which is nonsense. It’s really just trying to chase John Oliver.” But if they wanted to follow the model of HBO’s Last Week Tonight With John Oliver, arguably the best comedy/news hybrid of the moment, they’d have to renovate their show from top to bottom. Besides, the success of Last Week Tonight has less to do with its roasting of Trump than a willingness to wander into the weeds on arcane or poorly understood stories to make sense of America’s fundamental brokenness. You get real information there. The TV writer explains that this isn’t something most late-night talk shows are equipped to offer, at least not anymore, so long as they cling to an outmoded approach: “At this point it feels like the only reason they acknowledge Trump is because he is the news, and ignoring him would be noticeable,” he says — though that also means we’ve had our fill of him already. Who in the goddamn hell is hungry for extra Trump analysis? “I’ve honestly never understood the notion of commenting on the news in late night anyway,” he adds, “but I think it’s just a relic of a time when you might legitimately be learning about things for the first time at 11 p.m. But now, with Twitter and a million different outlets for news, late-night monologues are [hacky] by 11 a.m.” ‘They’re Not Trying to Beat the Internet — Just Your Boring Coworkers’ Whereas the Lewinsky gags, abhorrent and vapid as they were, may have felt fresh to people who didn’t have the chance to make those jokes online, no lighthearted potshot at Trump taken by a late-night host will compare to the scabrously funny, unbroadcastable shit people tweet about the president 24/7. As the writer puts it, in terms of the race to land a solid blow: “They’re not trying to beat the internet, they’re still just trying to beat your boring office coworkers.” We got our hands on Trump's handwritten State of the Union address. #LSSC pic.twitter.com/1kSnACHTLp — The Late Show (@colbertlateshow) January 16, 2019 Oooh Mueller report just dropped! pic.twitter.com/4QX6EvItBn — The Daily Show (@TheDailyShow) March 22, 2019 Trump's Star Wars Cantina Remix pic.twitter.com/N5nkGsRbHb — Fallon Tonight (@FallonTonight) January 23, 2018 These shows are, however, nominally online, and equally banal in that medium. These social accounts are defended with zeal by the shows’ loyalists — people with avatars of bald eagles in pink pussy hats and tenuous web literacy. When I quote-tweeted a particular groaner posted by the staff at The Late Show With Stephen Colbert, wondering if they couldn’t do better, these folks came out of the woodwork to call me a snowflake, a Trump supporter and an unfunny nobody. Some just showed up to reply with their own incoherent Trump “jokes,” and one woman, having assumed my avatar of Ben Affleck smoking was a photo of me, said to “keep puffing on the cigarette.” Lung cancer: a fine punishment for disrespecting her favorite TV show. ❄❄❄❄❄❄❄❄😢😢😢😢😭😭😭😭 — SV Taylor (@sharonvt75) April 10, 2019 @TurtleWoman777 who came first the trump or the egg! — Mylakeon (@tutorkag) April 10, 2019 Can we get some intelligence in a MAGAt? — Zeacher (@Zeachers) April 10, 2019 I loved that set !! Trump Busted LYING AGAIN !! What a Racist PIG !! pic.twitter.com/kmuilK63AN — Bitsy CS Ross (@BistyCSRoss) April 10, 2019 You selected that photo sweetie. That means you’re on board. — Ange (@civilagain) April 10, 2019 What motivates these weirdos? Why do they care what I think? And how did they even stumble across that tweet? It’s telling, of course, that their political identity comprises bromides and parody songs from a barely-left-of-center media machine. I can only conclude that they are the last true believers in this mealy dreck that late night is pumping out. They’re nourished and sustained by the consoling lie that Trump is an aberration of the system, not an avatar of its very nature; that everything will go back to “normal” one day, provided we keep ridiculing his hideous combover and fake tan. They are the dim bulbs who adopted Robert Mueller as a daddy figure and still defend grope-y Democrats like Al Franken and Joe Biden. And they definitely think they’re the good guys. ‘Their Version of Liberal Just Means Not Being White Trash’ Another man in the industry (he describes himself as a “mid-level TV writer,” though not of the late-night sphere) tells me via Twitter DM that the skin-deep stabs at Trump aren’t intended to be apolitical — rather, they’re coded as courageous. “They think [joking about] ‘covfefe’ is brave,” he argues. “These are people whose version of ‘liberal’ just means not being white trash. And not calling their coworkers gay slurs.” Of course, that doesn’t stand in the way of their homophobic gloss on the Trump-Putin relationship. This derangement presumably stems from a refusal to face the America that propelled Trump to the White House. For all they hate him, they yearn, as he does, for a “lost” country that younger generations view with skepticism. “No one wants to confront the fact that they grew up in a time that was pretty sexist and racist because then they’d have to stop being nostalgic for everything,” this writer says. “See: Aaron Sorkin.” As such, the anti-Trump Boomers — faithfully catered to by the older, more powerful figures in TV while, allegedly, the newcomers there are told to shut up and use the tired playbook, because that’s what “works” — settle into a smug superiority that lets them vent their classist contempt. That’s true of some of the hosts and writing staffs, too. “Bill Maher isn’t actually liberal, he just hates people from Alabama,” the second writer says. When I reframe that idea as “‘I shop at Whole Foods, so I’m not a reactionary,’” he replies, “[This is] the politics of 75 percent of Hollywood writers.” And so that’s the ideology served. ‘They’re Literally Upholding the Status Quo in Every Way’ The first late-night TV writer gives me the impression we probably aren’t going to break out of this bind anytime soon. The system is complacent in its abject shittiness. “I think the worst part is that every single person in late night knows it’s a dumb factory of lazy ideas,” he says. “[The host] makes fun of it, the head writers make fun of it, the staff writers watch the tapings and just lament it all. But the alternative is taking a risk, and network TV just isn’t about that. Safety is the key.” He tells me that he plans to leave the job soon. “[N]o amount of money can validate how consistently miserable it makes me feel to waste so much time, knowing I will never be happy with anything I make,” he says. Still more dispiriting than that, he says, is his fellow creatives’ hostility to the aspirants capable of changing things for the better. He mentions his anger at writers mocking people who used the Writers Guild of America–associated hashtag #WGAStaffingBoost to seek work, “making fun of [the tweets] and reading them out loud. A bunch of privileged, white, staffed WGA writers, cackling at unemployed writers who are just trying to break into the industry but don’t have connections.” He laments this “bunch of cynical jerks who live by the law that vulnerability is embarrassing and worth looking down upon, and that they’ve gotten to where they are by just being better. No perspective to even realize how many times the [tweets] they chose to make fun of were … people saying they focus on diverse voices.” It seems that for every youthful, fun, excitingly nonwhite talk show like Desus & Mero, there are a dozen depressingly bland legacy series whose doors are firmly closed to innovation, lacking both the means and will to do anything with Trump besides “tick off the ‘we-mentioned-him-and-said-he’s-bad’ box and move on,” as the late-night writer describes it. And so that becomes the weak standard of defiance. Which is to say, the awful talk shows are complicit in this barbaric regime by diminishing any rebuke of it to the scope of a half-assed Alec Baldwin impression. In truth, it would be better if they didn’t mention Trump at all; that would possibly sting his ego. Alas, the not-long-for-late-night writer says, they will continue hitting him with an inflatable hammer, because a genuine crisis isn’t enough to disrupt business as usual, and these places are “full of people who think they’re doing so much better than everyone else, with no perspective to see they’re literally upholding the status quo in every way.” Personally, I can’t find anything funny in that. Miles Klee Miles Klee is MEL’s resident tank-top dirtbag, shitposter and meme expert. He’s also the author of the novel ‘Ivyland’ and a story collection, ‘True False.’ Source: How ‘Liberal’ Late-Night Talk Shows Became a Comedy Sinkhole – MEL Magazine

    Read at 07:47 am, Apr 17th

  • PluginVulnerabilities.com is Protesting WordPress.org Support Forum Moderators by Publishing Zero-Day Vulnerabilities – WordPress Tavern

    image credit: Jason BlackeyeA security service called Plugin Vulnerabilities, founded by John Grillot, is taking a vigilante approach to addressing grievances against WordPress.org support forum moderators. The company is protesting the moderators’ actions by publishing zero-day vulnerabilities (those for which no patch has been issued) and then attempting to contact the plugin author via the WordPress.org support forums: Due to the moderators of the WordPress Support Forum’s continued inappropriate behavior we are full disclosing vulnerabilities in protest until WordPress gets that situation cleaned up, so we are releasing this post and then only trying to notify the developer through the WordPress Support Forum. You can notify the developer of this issue on the forum as well. Hopefully the moderators will finally see the light and clean up their act soon, so these full disclosures will no longer be needed (we hope they end soon). In the linked incidents cited above, Grillot claims that moderators have deleted his comments, covered up security issues instead of trying to fix them, and promoted certain security companies for fixing hacked sites, among other complaints. In response, Plugin Vulnerabilities has published a string of vulnerabilities with full disclosure since initiating the protest in September 2018. These posts detail the exact location of the vulnerabilities in the code, along with a proof of concept. The posts are followed up with an attempt to notify the developer through the WordPress.org support forum. Grillot said he hopes to return to Plugin Vulnerabilities’ previous policy of responsible disclosure but will not end the protest until WordPress.org support forum moderators comply with the list of what he outlined as “appropriate behavior.” WordPress’ security leadership is currently going through a transitional period after Aaron Campbell, head of WordPress Ecosystem at GoDaddy, stepped down from his position as head of security in December 2018. Automattic Technical Account Engineer Jake Spurlock is coordinating releases while the next person to wrangle the team is selected. This announcement was made in the #security channel, but Josepha Haden said there are plans for a more public post soon. Campbell did wish to publish the details of why he stepped down but said that he thinks it is important to rotate that role and that “the added influx of fresh energy in that position is really healthy.” When asked about the Plugin Vulnerabilities’ protest against WordPress.org, Spurlock referenced the Responsible Disclosure guidelines on WordPress’ Hackerone profile. It includes the following recommendation regarding publishing vulnerabilities: Give us a reasonable time to correct the issue before making any information public. We care deeply about security, but as an open-source project, our team is mostly comprised of volunteers. Spurlock said that since those guidelines are more pertinent to core, dealing with third-party plugins is a trickier scenario. Ideally, the plugin author would be notified first, so they can work with the plugins team to push updates and remove old versions that may contain those vulnerabilities. “The WordPress open-source project is always looking for responsible disclosure of security vulnerabilities,” Spurlock said. “We have a process for disclosing for plugins and for core. Neither of theses processes include posting 0-day exploits.” Grillot did not respond to our request for comment, but the company’s recent blog posts contend that following responsible disclosure in the past would sometimes lead to vulnerabilities being “covered up,” and even at times cause them to go unfixed. WordPress.org support forum moderators do not permit people to report vulnerabilities on the support forums or to engage in discussion regarding vulnerabilities that remain unfixed. The preferred avenue for reporting is to email plugins@wordpress.org so the plugins team can work with authors to patch plugins in a timely way. However, in the wild west world of plugins, which includes more than 55,000 hosted on WordPress.org, there are times when responsible disclosure falls apart and occasionally fails users. Responsible disclosure is not a perfect policy, but overall it tends to work better than the alternative. The Plugin Vulnerabilities service even states that they intend to return to responsible disclosure after the protest, essentially recognizing that this policy is the best way to coexist with others in the plugin ecosystem. In the meantime, publishing zero-day vulnerabilities exposes sites to potential attacks if the plugin author is not immediately available to write a patch. The only thing WordPress.org can do is remove the plugin temporarily until a fix can be released. This measure protects new users from downloading vulnerable software but does nothing for users who already have the plugin active. If site owners are going to protect themselves by disabling it until there is a fix, they need to know that the plugin is vulnerable. Plugin Vulnerabilities’ controversial protest, which some might even call unethical, may not be the most inspired catalyst for improving WordPress.org’s approach to security. It is a symptom of a larger issue. WordPress needs strong, visible security leadership and a team with dedicated resources for improving the plugin ecosystem. Plugin authors need a better notification system for advising users of important security updates inside the WordPress admin. Most users are not subscribed to industry blogs and security services – they depend on WordPress to let them know when an update is important. Refining the infrastructure available to plugin developers and creating a more streamlined security flow is critical for repairing the plugin ecosystem’s reputation. Like this:Like Loading... Related Source: PluginVulnerabilities.com is Protesting WordPress.org Support Forum Moderators by Publishing Zero-Day Vulnerabilities – WordPress Tavern

    Read at 07:28 am, Apr 17th

  • CSS and accessibility - QuirksBlog

    CSS and accessibility I am likely going to write a “CSS for JavaScripters” book, and therefore I need to figure out how to explain CSS to JavaScripters. This series of article snippets are a sort of try-out — pre-drafts I’d like to get feedback on in order to figure out if I’m on the right track. Today’s topic is CSS and accessibility. I want to warn people for common accessibility pitfalls, but on the other hand want to do it in a sneaky, underhand way. In order to do so I need a list of common problems. No chapter I have decided that the book will not have a “CSS and accessibility” chapter because I suspect the people who need it most will skip it. Accessibility is “not realistic,” after all, and complicated, and nobody who’s blind visits our site anyway etc. You know the score. Instead, my plan is to kind-of weave accessibility issues throughout the book, and treat them together with the technique they relate to. I am even going to try to avoid the word “accessibility” altogether, though I’m not yet certain I’ll succeed. A list When in doubt, make a list. What I’m currently looking for is a list of CSS/accessibiklity tips and tricks that will solve the most common 80% of the problems. That’s where you come in. I am not certain if I’m going to treat ARIA. I have the feeling that if your HTML and CSS are structured correctly you don’t need any ARIA in 90% of the cases (but please correct me if I’m wrong). So complicated ARIA use cases fall outside the scope of this list. With all that in mind, please give me your simple, easy-to-implement CSS and accessibility tips and tricks. I’ll add them to the list below, and I’ll write them into the book in a sneaky, underhand way. (I have no clue how that will actually work in practice, but it’s worth a try.) The master CSS/accessibility list The book is going to treat these topics: Accessibility problems with changing the order of flex and grid boxes; what happens when source order is not visual order? (auto-flow: dense for grid; see also http://adrianroselli.com/2019/04/reading-order-bookmarklet.html for reading order bookmarklet) Lack of contrast and how to solve it. The position: absolute; left: -9999px class of solutions. (I am assuming these are safe as long as you apply them to the correct bits of content.) Keyboard focus and :focus, :focus-within etc. If it’s a button or a link, make it a button or a link. (Strictly speaking this is an HTML trick. But I’ll likely be able to squeeze it in somewhere.) https://medium.com/@matuzo/writing-css-with-accessibility-in-mind-8514a0007939 Consequences of display: none; element taken out entirely. Reduced motion, high-contrast, and similar media queries. (OK if they’re browser-specific) How display: content can remove semantics http://adrianroselli.com/2018/02/tables-css-display-properties-and-aria.html CSS symbol fonts or other icons may be read aloud (this may be beyond the scope of the book, since I won't treat fonts) Difference between display: none, visibility: hidden, and opacity: 0. Viewport height MQs (personally I'm not sure they're that great because of serious mobile issues with toolbars) Prevent outline: none; we need those dotted outlines! CSS-only disclosures such as dropdowns; usually not keyboard accessible Sometimes JavaScript is more accessible than CSS. (Need practical examples; https://gomakethings.com/i-was-wrong-about-javascript-free-dropdowns/) Modals. (Is this truly a CSS issue? Currently I see it more as a design issue.) [Your CSS/accessibility issue here] Source: CSS and accessibility – QuirksBlog

    Read at 04:13 pm, Apr 16th

  • JavaScript's new #private class fields – @thejameskyle

    JavaScript's new #private class fields What they are, how they work, and why they are the way they are This article is best enjoyed while listening to:"Noise Pollution" — Portugal. The Man This article is also available in Russian Private class fields are now at Stage 2 in the JavaScript standard process. It's not finalized yet, but the JavaScript standards committee expects the feature to be developed and eventually included in the standard (although it may still change). The syntax (currently) looks like this: class Point { #x; #y; constructor(x, y) { this.#x = x; this.#y = y; } equals(point) { return this.#x === point.#x && this.#y === point.#y; } } There are two main parts of this syntax: Defining private fields Referencing private fields Defining Private Fields Defining private fields is mostly the same as defining public fields: class Foo { publicFieldName = 1; #privateFieldName = 2; } In order to access a private field, you need to have defined it. So in case you don't want to instantiate a value when defining the property, you can do so: class Foo { #privateFieldName; } Referencing Private Fields Referencing private fields works similar to accessing any other property, only it has a special syntax. class Foo { publicFieldName = 1; #privateFieldName = 2; add() { return this.publicFieldName + this.#privateFieldName; } } There's also a shorthand version of this.#: method() { #privateFieldName; } Which is the same as: method() { this.#privateFieldName; } Referencing private fields of instances Referencing private fields isn't just limited to this. You can also access private fields on values that are instances of your class: class Foo { #privateValue = 42; static getPrivateValue(foo) { return foo.#privateValue; } } Foo.getPrivateValue(new Foo()); // >> 42 Here, foo is an instance of Foo so we are allowed to lookup #privateValue from within the class definition. Private Methods (coming soon?) Private fields are coming as part of a proposal focusing on just adding class fields. The proposal does not make any changes to class methods, so private class methods will be coming in a followup proposal and will likely look like this: class Foo { constructor() { this.#method(); } #method() { // ... } } In the meantime, you can still assign functions to private fields: class Foo { constructor() { this.#method(); } #method = () => { // ... }; } Encapsulation If you're using an instance of a class, you cannot reference that class's private fields. You can only reference private fields from within the class that defines them. class Foo { #bar; method() { this.#bar; // Works } } let foo = new Foo(); foo.#bar; // Invalid! Further, to be truly private, you shouldn't be able to even detect that a private field exists. In order to make sure that you can't detect a private field, we need to allow public fields with the same name. class Foo { bar = 1; // public bar #bar = 2; // private bar } If private fields didn't allow for public fields with the same name, you could detect the private fields existence by trying to write to a property of the same name: foo.bar = 1; // Error: `bar` is private! (boom... detected) Or the silent version: foo.bar = 1; foo.bar; // `undefined` (boom... detected again) This encapsulation should also be true for subclasses. A subclass should be able to have a field of the same name without having to worry about the parent class. class Foo { #fieldName = 1; } class Bar extends Foo { fieldName = 2; // Works! } Note: For more about the motivation behind encapsulation or "hard private" read this section in the FAQ. So why the hashtag? A lot of people are wondering "why not follow conventions from many other languages and use a private keyword"? Here's an example of that syntax: class Foo { private value; equals(foo) { return this.value === foo.value; } } Let's look the two parts of the syntax separately. Why don't declarations use the private keyword? The private keyword is used in a lot of different languages to declare private fields. Let's look at the syntax of language like that: class EnterpriseFoo { public bar; private baz; method() { this.bar; this.baz; } } In these languages, public and private fields are accessed the same way. So it makes sense that they get defined this way. However, in JavaScript, because we can't use this.field for private properties (which I'll get to in a second), we need a way of syntactically communicating the relationship. By using the # in both places, it's much clearer what is being referenced. Why do references need the #hashtag? We need to use this.#field instead of this.field for a couple reasons: Because of #encapsulation (see the "Encapsulation" section above), we need to allow public and private fields with the same name at the same time. So accessing a private field can't just be a normal lookup. Public fields in JavaScript can be referenced via this.field or this['field']. Private fields won't be able to support the second syntax (because it needs to be static) and that could lead to confusion. You'd need expensive checks: Let's take a look at a code example. class Point { #x; #y; constructor(x, y) { this.#x = x; this.#y = y; } equals(other) { return this.#x === other.#x && this.#y === other.#y; } } Notice how we're referencing other.#x and other.#y. By accessing the private fields, we are assuming that other is an instanceof our class Point. Because we've used the #hashtag syntax we've told the JavaScript compiler that we're looking up private properties from the current class. But what would happen if we didn't use the #hashtag? equals(otherPoint) { return this.x === otherPoint.x && this.y === otherPoint.y; } Now we have a problem: How do we know what otherPoint is? JavaScript doesn't have a static type system, so otherPoint could be anything. Which is a problem for two reasons: Our function behaves differently depending on what type of value you pass to it: Sometimes accessing a private property, other times looking up a public property. We'd have to check the type of otherPoint every single time: if ( otherPoint instanceof Point && isNotSubClass(otherPoint, Point) ) { return getPrivate(otherPoint, 'foo'); } else { return otherPoint.foo; } Even worse, we'd have to do this for every single property access within a class to check if we're referencing a private property. Property access is already really slow, so we definitely do not want to add any more weight to it. TL;DR: We need to use a #hashtag for private properties because the alternative of using standard property accesses would create unexpected behavior and result in huge performance problems. Private fields are an awesome addition to the language. Thanks to all the wonderful hardworking people on TC39 who made/are making them happen! This work is licensed under a Creative Commons Attribution 4.0 International License. Source: JavaScript’s new #private class fields – @thejameskyle

    Read at 01:24 pm, Apr 16th

  • The first picture of a black hole made Katie Bouman an overnight celebrity. Then internet trolls descended.

    April 12, 2019, 9:01 PM GMT / Updated April 13, 2019, 12:28 PM GMTBy Ben CollinsKatie Bouman, a researcher who helped create the first image of a black hole, quickly gained internet fame Thursday for her role in the project after a photo of her went viral.But internet trolls soon followed, questioning Bouman’s work and floating false claims that she did not have much of a role in the project. Colleagues rallied to her defense, but the situation highlighted the vitriol that women continue to face on the internet, and the continued vulnerability of major internet platforms to trolling campaigns.Bouman, a postdoctoral fellow who will soon be an assistant professor at the California Institute of Technology, noted in a Facebook post Wednesday that “no one algorithm or person made this image” and published a photo of the many people she worked alongside.The photo of the black hole was the end result of the work of hundreds of researchers and eight telescopes.Bouman’s public recognition — much of it applauding an example of a woman at the forefront of a major scientific effort — drew attention from misogynist communities on the internet. Some users congregated on Reddit and created videos questioning Bouman’s contribution that were then uploaded to Instagram and YouTube.By Friday, falsehoods claiming it was not Bouman but a male colleague who deserved credit for the black hole image overtook legitimate coverage in search results on YouTube and Instagram.On YouTube, the first video result for users who search for “Katie Bouman” returns a video titled “Woman Does 6% of the Work but Gets 100% of the Credit: Black Hole Photo.” The video is riddled with inaccuracies, and largely draws from a falsehood created on Reddit and pushed heavily by a “men’s rights” community.Hours later, a similar search showed that the video was no longer appearing at the top of YouTube's results.The video claims Andrew Chael, a “straight white male” did most of the work, based on the number of publicly available lines of code for the project on the website Github.Chael, an astrophysicist and graduate student at Harvard University who worked with Bouman, responded on Twitter saying the conspiracy theory is “awful and sexist,” and added that he’s gay. The theory claims that Chael wrote 850,000 lines of code, which he says is also wrong, adding there are 68,000 lines of code total in the current software.A YouTube spokesperson told NBC News that the company is working to change its system to value authoritative content.“We've taken a number of steps to address this including surfacing more authoritative content across our site for people searching for news-related topics, beginning to reduce recommendations of borderline content and showing information panels with more sources where they can fact check information for themselves,” the spokesperson said in an email. “We’ve seen meaningful progress as a result and are committed to making more improvements going forward.”(1/7) So apparently some (I hope very few) people online are using the fact that I am the primary developer of the eht-imaging software library (https://t.co/n7djw1r9hY) to launch awful and sexist attacks on my colleague and friend Katie Bouman. Stop.— Andrew Chael (@thisgreyspirit) April 12, 2019 Becca Lewis, a research affiliate at nonprofit research institute Data & Society who studies extremism on YouTube, said this was another example of YouTube’s algorithm “rewarding engagement and time spent on the site to maximize advertising revenue” instead of facts.“Time and again, we see that this leads YouTube to recommend sensationalist content that is often conspiratorial or bigoted,” Lewis said. “In turn, content creators are incentivized to create this kind of content, and a culture has emerged on the platform that is deeply reactionary.”Instagram had also been co-opted by the anti-Bouman campaign. An account impersonating Bouman, with the username “katieboumanoffficial,” was the first result for users looking up “Katie Bouman” in Instagram’s search box.The account, which impersonated an Instagram model until November, began impersonating Bouman late Thursday night, posting several headshots and screenshots of YouTube videos featuring Bouman.Descriptions on the images of the account, however, spread false claims about Bouman. One description changes Chael’s name to “Andrew Chad,” a reference to “Chads,” internet misogynist terminology for men who are attractive to women.“He is Andrew Chad. He wrote 850,000 of the 900,000 lines of code that were written in the historic black-hole image algorithm!” the description reads.Instagram did not respond to a request for comment.Ben Collins covers disinformation, extremism and the internet for NBC News.Source: The first picture of a black hole made Katie Bouman an overnight celebrity. Then internet trolls descended.

    Read at 02:49 pm, Apr 15th

  • Jonathan Bull - Co-founder and CEO | Developer to Manager

    Hello! What's your background and what do you do? I’m the Co-founder and CEO of EmailOctopus, an affordable email marketing platform. We’ve been in business since 2014 and are mostly aimed at startups, small businesses and entrepreneurs. Our USP is that we’re around five times cheaper than other solutions out there. Programming has always been a passion of mine, and I started it as a hobby when I was around ten. That led me to start creating websites and then my first business when I was fourteen. I studied Software Engineering at university and had a couple of programming roles after that; first at the Royal Opera House in London, then as Head of Digital at a startup news agency focused on cryptocurrency reporting. I set up EmailOctopus five years ago with my brother Gareth, who’s a marketer, and I maintained the business alongside my full-time work. Two years ago it finally got to the point where I could quit my day job and focus fully on running my own business. It’s been a huge learning curve — not just moving away from development and into management, but learning everything else I didn’t know about being solely responsible for keeping a business afloat. The company is based in the UK but my wife and I decided to move to Vancouver last summer and I’ve been working remotely from here ever since. Taking that decision is obviously a huge benefit of what I do, but being remote adds new challenges to managing the team back home. How was your transition from software development to management like? The transition has been fun, messy, difficult and it certainly isn’t over yet. EmailOctopus has continued to grow steadily over the past two years — we’ve now had 30,000 customers send five billion emails through the platform. We’re still a small team of five, so I wear many hats alongside being a manager and leader. I still get drawn into development and there’s constant technical firefighting as the platform grows. At the moment my number one priority is building a strong roster of contractors so I can step away from the day-to-day engineering and focus more on management and the future of the company. In terms of learning to lead, I’ve been doing this on my own so have had to pick things up along the way, and I’ve missed out on having a strong manager myself to learn from. When I first went full-time on EmailOctopus, my brother and I hired Tom, our COO, to pick up a lot of the business operations, and he was integral to getting things up and running while I focussed on the technical side. Now that we’re bigger, I’m pushing myself to focus more on leadership and strategic direction. What does your day-to-day work look like, and what motivates you to do it every day? The first two hours of my working day are the most important: that’s when our working hours overlap and I get to talk to the team in the UK. We have a handover call where everyone discusses what they’ve done that day, then each week I’ll have 1:1 conversations with all members of the team. This generally happens at my kitchen table, then I take the bus downtown where I have a desk in a coworking space. In terms of my day-to-day tasks, things are pretty varied. I’ll spend around 40% of the day programming and reviewing code, then the rest of the time is meeting with the team, scoping upcoming projects, working with contractors, managing the finances, reviewing our marketing… It’s both rewarding and stressful being involved in so many different things. My favourite part of the day is sitting down to review what the UK team has produced — it’s awesome to see how much has been created while I’ve been asleep. Seeing our product grow is my number one motivation and reward. People really do value our platform and we’re helping them grow their businesses in turn, so it’s great to hear positive feedback from customers. What are the biggest challenges you've faced so far? What did you do to overcome them? My biggest personal challenge is tearing myself away from programming and thinking of myself as a manager first, developer second. I’m doing that more now but I should have done it sooner. I still have a tendency to get sidetracked and become absorbed by a small technical task — for example, this morning I spent way too long on the design of a checkbox. If I don’t watch myself, this sort of thing becomes a way to procrastinate and put off management tasks like making business decisions. Programming will always be where I feel most comfortable, but ultimately I’m rewarded by seeing the company grow — and it can’t do that while I’m just programming. We’ve also just recruited another full-time member of the team in the UK recently, and I’ve realised how much harder it is to build that relationship and welcome someone when you can’t spend time face-to-face. I take for granted how easily I work remotely with the older team members because I know them so well, but with new people it takes longer when you can’t chat about a problem or go for a beer after work. I’m conscious of that and I try to travel back to the UK every few months so I still feel connected. And the benefit of being remote is that you have to try harder to be clear in your communication, and organised about documenting everything, so I think it makes us a stronger team overall. What has been the biggest surprise so far? Something you didn't expect? To be honest, I never thought I’d enjoy managing a team. I’ve always been motivated by making and building things, and when I worked in other organisations I didn’t want my managers’ jobs. But it turns out I really do love it, and I find it so rewarding to see my team’s good work, especially when they’ve done something great that I never would have thought to do. It sounds cheesy but I now know that we can build much better, more exciting products working as a team rather than me going it alone. What's the best advice you've received about being a manager? I read this somewhere online recently and wish I could remember the source, but I can’t. The gist was that half of being a manager is managing other people, and half is managing your own behaviours. That’s something I always try to keep in mind: am I being a good role model? Am I being clear? Am I reliable? What do you tell developers who are considering making the switch or new to the role? I tell them that the reward and satisfaction you get from your job will inevitably change. Programming is so instantly gratifying: build something, launch it, find a problem, fix it. There’s a steady drip feed of validation all throughout your day which feels great and is pretty addictive. But once you move up into a management role, a lot of that goes away and the reward you do get is secondhand — it’s seeing someone else’s success and sharing it with them. And your end goal is rarely clear, there’s not someone else defining the scope of your work. It’s up to you to decide what’s next for the team and then get everyone on board. With that in mind, moving into management definitely isn’t going to be a great option for all developers. So think about it fully and decide whether you’re willing to let go of what you enjoy about coding. Final call to action! Where can we go to learn more about you? Check out EmailOctopus or find me on Twitter. Source: Jonathan Bull – Co-founder and CEO | Developer to Manager

    Read at 07:52 am, Apr 15th

Week of Apr 7th, 2019

  • Omar al-Bashir: Sudan military coup topples ruler after protests

    Sudan's President Omar al-Bashir has been ousted and arrested by the military after nearly 30 years in power. Speaking on state TV, defence minister Awad Ibn Auf said the army would oversee a two-year transitional period followed by elections.

    Read at 05:30 pm, Apr 13th

  • Domain-Oriented Observability

    Observability in our software systems has always been valuable and has become even more so in this era of cloud and microservices.

    Read at 05:27 pm, Apr 13th

  • Testing Stateful React Function Components with React Testing Library

    With the introduction of React Hooks, there is more of an incentive to write function components in React since there is no longer a need use classes when building components.

    Read at 04:07 pm, Apr 13th

  • From Redux to Hooks: A Case Study

    After several years of using Redux for most of our projects we decided to try useReducer/useContext approach instead. Here is what we learned. Using Hooks instead of Redux for state management is by no means easier.

    Read at 04:00 pm, Apr 13th

  • Trump Uses 9/11 Footage To Advance Right-Wing Attacks On Ilhan Omar

    Trump joins a chorus of conservative media voices that have tried to paint Omar saying “some people did something” during that speech as being flippant about Sept. 11.

    Read at 10:15 pm, Apr 12th

  • Second-Order Thinking: What Smart People Use to Outperform

    Things are not always as they appear. Often when we solve one problem, we end up unintentionally creating another one that’s even worse. The best way to examine the long-term consequences of our decisions is to use second-order thinking.

    Read at 10:15 pm, Apr 12th

  • Trump says he is giving ‘strong considerations’ to releasing immigrant detainees in ‘sanctuary cities’

    President Trump moved aggressively Friday to take ownership of an internal White House plan to release immigrant detainees into “sanctuary cities” that his aides had sought to minimize a day earlier by saying it was shelved months ago after only informal consideration.

    Read at 07:28 pm, Apr 12th

  • Why Ecuador Finally Got Sick of Julian Assange and Ended His Refuge at the Embassy in London

    Six years, nine months and 24 days after walking into the Ecuadorian embassy in London and declaring asylum, WikiLeaks founder Julian Assange was dragged back out onto the streets by British police officers. Assange, 47, who was pale and heavily bearded, shouted “The U.K.

    Read at 09:28 am, Apr 12th

  • Julian Assange Arrested in London as U.S. Unseals Hacking Conspiracy Indictment

    WASHINGTON — The WikiLeaks founder Julian Assange was arrested on Thursday in London to face a charge in the United States of conspiring to hack into a Pentagon computer network in 2010, bringing to an abrupt end a seven-year saga in which he had holed up in Ecuador’s embassy in Britain to avoid

    Read at 09:23 am, Apr 12th

  • AP Interview: Pelosi: ‘I don’t trust Barr; I trust Mueller’

    WASHINGTON (AP) — House Speaker Nancy Pelosi said Wednesday she doesn’t trust Attorney General William Barr and suggested his statement that he believes President Donald Trump’s campaign was spied on undermines Barr’s independence as the nation’s top law enforcement officer.

    Read at 09:17 am, Apr 12th

  • Twelve days of chaos: Inside the Trump White House’s growing panic to contain the border crisis

    He had threatened to close the southern border and ordered a halt to foreign aid for three Central American nations.

    Read at 09:15 am, Apr 12th

  • Miller and Kushner on a potential collision course in Trump’s border crisis

    In President Trump’s latest blowup over immigration, senior policy adviser Stephen Miller hovered omnipresent in the background — goading him in his threats to close the border, warning him of the dangers of looking weak and encouraging the president’s sudden purge of his homeland security tea

    Read at 09:04 am, Apr 12th

  • Glaciers and Arctic ice are vanishing. Time to get radical before it's too late

    Forget “early warning signs” and “canaries in coalmines” – we’re now well into the middle of the climate change era, with its epic reshaping of our home planet.

    Read at 08:13 am, Apr 12th

  • Too far right and left? DC think tank releases manifesto for radical centrism

    If you've had enough of all the political bickering coming from every side, a Washington think tank released a manifesto that it hopes will inspire those in the middle.

    Read at 08:00 am, Apr 12th

  • The Serif Tax

    Twitter Facebook Twitter Facebook

    Read at 07:56 am, Apr 12th

  • The Democratic Electorate on Twitter Is Not the Actual Democratic Electorate

    Perhaps the most telling poll of the Democratic primary season hasn’t been about the Democratic primary at all — but about the fallout from a 35-year-old racist photo on a yearbook page. Gov.

    Read at 07:53 am, Apr 12th

  • K-pop social media, (Anti-)fan labour, and Networks of (mis)information

    I am an anthropologist of young people’s internet cultures and have spent the past 13 months learning (from scratch!) about K-pop fan practices on social media through intensive reading of academic literature, thoroughly combing through popular media, and immersing myself in various K-pop communit

    Read at 06:56 pm, Apr 11th

  • Is your pregnancy app sharing your intimate data with your boss?

    Like millions of women, Diana Diller was a devoted user of the pregnancy-tracking app Ovia, logging in every night to record new details on a screen asking about her bodily functions, sex drive, medications and mood.

    Read at 09:30 am, Apr 11th

  • Socialism, but in Iowa

    DSA members in the state view socialism as a vehicle for changing their own immediate circumstances—and they want to build a movement that transcends electoral politics. DES MOINES—Caroline Schoonover has two immediate goals. One of them is to systematically dismantle capitalism.

    Read at 09:13 am, Apr 11th

  • Congress Is About to Ban the Government From Offering Free Online Tax Filing. Thank TurboTax.

    ProPublica is a nonprofit newsroom based in New York. Sign up for ProPublica’s Big Story newsletter to receive stories like this one in your inbox as soon as they are published. Just in time for Tax Day, the for-profit tax preparation industry is about to realize one of its long-sought goals.

    Read at 06:08 pm, Apr 10th

  • Trump Says the U.S. Is ‘Full.’ Much of the Nation Has the Opposite Problem.

    An aging population and a declining birthrate among the native-born population mean a shrinking work force in many areas.

    Read at 06:02 pm, Apr 10th

  • ‘Taco Truck Tammy’ Threatens to Call ICE on Food Truck Workers

    Many people, if confronted with a taco truck in their neighborhood, would probably be quite pleased. What a delightful opportunity to step out—perhaps still in your pajamas, order a carnitas taco, and then hop right back inside.

    Read at 05:52 pm, Apr 10th

  • House Democrats Pass Bill to Restore Net Neutrality

    Democrats in the U.S. House of Representatives made good on a campaign promise on Wednesday, passing legislation that would effectively reinstate in its entirety the 2015 Open Internet Order—rules that, for a brief time, ensured net neutrality was the law of the land.

    Read at 05:50 pm, Apr 10th

  • Trump removes Secret Service director as purge of DHS leadership widens

    President Trump continued to dismantle the leadership of the nation’s top domestic security agency Monday, as the White House announced the imminent removal of U.S. Secret Service Director Randolph D.

    Read at 05:32 pm, Apr 10th

  • GOTO 2018 • Why I Was Wrong About TypeScript • TJ VanToll

    This presentation was recorded at GOTO Copenhagen 2018. #gotocon #gotocphhttp://gotocph.comTJ VanToll - Developer Advocate at ProgressABSTRACTIn 2014, I made a strong argument that TypeScript was destined to be irrelevant and that my company should not use it in any of our projects.Fast forward to 2

    Read at 03:24 pm, Apr 10th

  • Trump Purge Set to Force Out More Top Homeland Security Officials

    WASHINGTON — President Trump moved to clear out the senior ranks of the Department of Homeland Security on Monday, a day after forcing the resignation of its secretary, Kirstjen Nielsen, as he accelerated a purge of the nation’s immigration and security leadership.

    Read at 09:33 am, Apr 10th

  • The perks of patronage

    I started a newsletter a few years ago. I added it as an afterthought to one of my blog posts, with the message: “Sign up here to get updates when I post something new”. That blog post happened to blow up, so I found myself with a solid audience within a few days.

    Read at 09:25 am, Apr 10th

  • Bernie Sanders Is Making Union Solidarity an Essential Theme of the 2020 Campaign

    When working-class Wisconsinites took to the streets in February of 2011, as part of what would become a historic mass mobilization against the anti-labor policies of Governor Scott Walker, they had with little support from national political figures.

    Read at 09:17 am, Apr 10th

  • Getting creative with the Console API!

    Debugging in JavaScript has always been inseparably connected with the Console API, which is most of the time used only through console.log(). But, did you know that it doesn't have to be this way? Hasn't console.

    Read at 08:28 pm, Apr 9th

  • Bernie Sanders’s Love of the Filibuster Is His Craziest Position

    To imagine that Bernie Sanders could be elected president and enact something resembling his agenda requires a number of extremely generous assumptions.

    Read at 08:24 pm, Apr 9th

  • NYC mayor orders mandatory measles vaccinations after Brooklyn outbreak

    A vial of the measles, mumps, and rubella virus (MMR) vaccine is pictured at the International Community Health Services clinic in Seattle, Washington, U.S., March 20, 2019. Picture taken March 20, 2019.

    Read at 08:21 pm, Apr 9th

  • Code caching for JavaScript developers · V8

    Code caching (also known as bytecode caching) is an important optimization in browsers. It reduces the start-up time of commonly visited websites by caching the result of parsing + compilation. Most popular browsers implement some form of code caching, and Chrome is no exception.

    Read at 08:13 pm, Apr 9th

  • Kirstjen Nielsen Resigns as Trump’s Homeland Security Secretary

    WASHINGTON — Kirstjen Nielsen, the homeland security secretary, resigned on Sunday after meeting with President Trump, ending a tumultuous tenure in charge of the border security agency that had made her the target of the president’s criticism.

    Read at 09:42 am, Apr 9th

  • Expecting More Big Changes, Newly-Elected Democrats Left Frustrated with Albany's Culture

    Bumping up against a midnight deadline Sunday night to pass the state budget, there was frustration in the state Senate Chamber when Democrats cut off floor speeches of freshman to keep the roll call vote moving: Lawmaker: Sen. Salazar, how do you vote? Sen.

    Read at 09:36 am, Apr 9th

  • Democratic Rift Over N.Y. Budget as Progressive Backlash Grows

    ALBANY — After New York State leaders reached a deal on a new $175 billion budget, Gov. Andrew M. Cuomo praised it as “the best budget” of his tenure. The Assembly speaker, Carl E. Heastie, called elements of it “critical” and “historic.”

    Read at 09:34 am, Apr 9th

  • How The New York Budget Sausage Got Made

    Assembly Majority Leader Crystal D. Peoples-Stokes, D- Buffalo, speaks while debating bills in the Assembly Chamber at the state Capitol, Sunday, March, 31st. (Hans Pennink/AP/Shutterstock) Fewer plastic bags across New York. New tolls around Manhattan.

    Read at 09:30 am, Apr 9th

  • It Still Takes Almost No Effort to Find White Nationalists on Facebook

    To weary enthusiasm, Facebook announced last month it would ban white nationalists and white separatists from the social network, dissolving the company’s bizarre distinction between those ideologies and white supremacism. The policy change, first reported by Motherboard, felt like progress.

    Read at 09:26 am, Apr 9th

  • Higher Order Components in a React Hooks World

    For most people working with regularly with React, it’s hard to go very far without encountering higher-order components (or HoC’s). To the uninitiated, it is a pattern that leverages React’s…

    Read at 09:21 am, Apr 9th

  • The Stephen Miller Presidency

    The more politically frustrated Trump becomes, the more he embraces his most extreme adviser. Brace yourself, America.

    Read at 09:16 am, Apr 9th

  • The last few weeks I’ve had several conversations with a coworker about consistency in code: why do we do things one way here, and a different way there? Some of this is macro level; Where do we split chunks of related functionality into different files? Some of it is micro level; what should the

    Read at 07:03 am, Apr 9th

  • Republicans Are Warning Drug Companies Not To Cooperate With A Congressional Investigation

    The House Oversight Committee is attempting to study how drug companies set prescription drug prices, but Republicans have warned the industry that it may be better for them not to cooperate.

    Read at 06:51 am, Apr 9th

  • Democrats need to get over their fear of disrupting private health insurance

    One of the biggest problems that has bedeviled Democratic Party attempts to reform the janky American health-care system is fear of backlash. About half the population is insured with private, employer-based coverage, leading liberals to adopt a defensive posture.

    Read at 09:53 pm, Apr 8th

  • The Media Gaslighting of 2020’s Most Likable Candidate

    At CNN’s town hall event on Monday, the American people saw something we’d been told was impossible: Elizabeth Warren winning over a crowd. The Massachusetts senator took aim at a variety of…

    Read at 09:48 pm, Apr 8th

  • Why I no longer use D3.js

    Every time I work on a project with visualisations, project managers usually react in horror when I say I’m not using D3. Why is there concern? Why would I choose to not use D3? When answering these questions, we have to understand the context in which D3 was created.

    Read at 09:43 pm, Apr 8th

  • Ember.js: The Documentary (Official Release)

    Starring Yehuda Katz and Tom Dale (co-creators of Ember.js), as well as many other big names from the #Ember community, "Ember.js: The Documentary" explores why and how #Emberjs came to be, the pioneers behind its creation and the life-altering decisions that go into making #opensource software.Mor

    Read at 09:15 am, Apr 8th

  • Fox News Rejected an Oscar-Nominated Documentary’s Ad Over Nazi Imagery, but It Doesn’t Always Seem to Bother Them

    On Wednesday, the Hollywood Reporter informed us that Fox News CEO Suzanne Scott had personally intervened in order to prevent an ad for an Oscar-nominated documentary short, A Night at the Garden, from running nationwide during Sean Hannity’s show.

    Read at 08:16 am, Apr 8th

  • US union seeks $100m in largest wage theft case involving federal contractor

    An American union is seeking to win more than $100m in back wages from a private call center firm in a move that, if successful, would win the largest wage theft case involving federal contractors in history.

    Read at 07:58 am, Apr 8th

  • Hunger and an ‘Abandoned’ Hospital: Puerto Rico Waits as Washington Bickers

    VIEQUES, P.R. — A newborn’s cries rarely echo anymore though the hallways of what passes as a hospital on the ravaged island of Vieques, off the coast of Puerto Rico.

    Read at 07:55 am, Apr 8th

  • Bernie Sanders Is the Frontrunner. Obviously.

    He leads the declared candidates in the polls, and he's dominating in fundraising. So why is he being ignored?

    Read at 10:43 pm, Apr 7th

  • Five issues coming up after the state budget

    Democratic lawmakers and Gov. Andrew Cuomo may have struck a $175.5 billion budget deal, but a series of contentious issues will keep them busy in the 10 weeks left in this year’s legislative session.

    Read at 10:39 pm, Apr 7th

  • Five issues coming up after the state budget

    Democratic lawmakers and Gov. Andrew Cuomo may have struck a $175.5 billion budget deal, but a series of contentious issues will keep them busy in the 10 weeks left in this year’s legislative session.

    Read at 10:39 pm, Apr 7th

  • Joan Gamell

    Hello! What's your background and what do you do? Hi there, I'm a front-end developer currently working at Slack. In the past I was a developer and Engineering Manager at Expedia, and also worked at LinkedIn for a bit.

    Read at 10:34 pm, Apr 7th

  • Ahmed El Gabri

    Hello! What's your background and what do you do? Like many developers, I'm self-taught. I have no Computer Science background whatsoever (although I'm always working on improving this).

    Read at 10:29 pm, Apr 7th

  • Kim Moir

    Hello! What's your background, and what do you do? My background is as an open source release engineer and backend Python developer. I spent many years optimizing build and release pipelines to ship products faster and more securely on many different platforms.

    Read at 03:13 pm, Apr 7th

  • Access

    A short documentary about accessibility and universal design featuring Cory Joseph. For more details on this film, including downloads, alternate versions, FAQs, and resources, visit: AccessMovie.org

    Read at 01:27 pm, Apr 7th

  • Why you still don't understand the Green New Deal

    Political news coverage tends to focus on strategy over substance, and that’s making it less likely that the public will agree on big policy ideas when we need them the most.Subscribe to our channel! http://goo.gl/0bsAjOThe Green New Deal is an ambitious proposal that outlines how the U.S. might b

    Read at 01:14 pm, Apr 7th

  • Developer to Manager

    Hello! What's your background and what do you do? I have a CS degree from the University of Edinburgh, and then I dropped out of grad school at the University of Ottawa.

    Read at 01:02 pm, Apr 7th

  • TS Tricks: Higher Order Components

    Higher order components are a useful pattern for creating composable logic within a React application. While they're not as popular as other tools like render props or hooks, they're still worth knowing.

    Read at 11:08 am, Apr 7th

  • How the “Golden Rule” of React components can help you write better code

    Recently I’ve adopted a new philosophy that changes the way I make components. It’s not necessarily a new idea but rather a subtle new way of thinking. Again, it’s a subtle statement and you may think you already follow it but it’s easy to go against this.

    Read at 11:07 am, Apr 7th

  • Different contexts behind terminology

    markets: Chomsky explains that markets are institutionally inefficient, environmentally suicidal & solidarity-destroying. If we're fighting to organize over google's internal email system, might it be harder if google's split into 10 smaller warring secret societies?

    Read at 11:06 am, Apr 7th

  • Rolling your own Redux with React Hooks and Context

    For managing shared state in complex JavaScript applications, Redux is undisputedly the most popular choice.

    Read at 11:04 am, Apr 7th

  • Here’s the US Army version of HoloLens that Microsoft employees were protesting

    In November, we learned that Microsoft won a $479 million contract to supply the US Army with a version of its HoloLens augmented reality headset — a move that Microsoft’s own employees decried this February, prompting Microsoft CEO Satya Nadella himself to respond.

    Read at 10:44 am, Apr 7th

  • How to Disagree with Someone More Powerful than You

    Your boss proposes a new initiative you think won’t work. Your senior colleague outlines a project timeline you think is unrealistic.

    Read at 10:43 am, Apr 7th

  • 35. Shotgun surgery and React components

    I wrote this post for my newsletter, sign up here to get emails like these every week.Last week I wrote a post about the best time to write tests and hinted at preparatory refactors. In this post, we dig into the implementation details with React components. Let me tell you a story. You work on an application which has has a Form. And it’s a slightly smart form, it doesn’t let users click the submit button until you give it some input. Just some small UX niceness. Now, you have been assigned the task to add another field in this form while maintaining the smart functionality. Pfft, Just another input field. No big deal, right? Let’s open up the code for this component. The code for the component itself is not that interesting. This Form component doesn’t have the logic for making the form smart. The logic is abstracted in a custom hook useSmartForm, which provides the values Form can use - disabled and the onChange handler. This abstraction seems like a good idea because we probably use this in other forms across the application as well. Whoever wrote this must be smart. Let’s look at the code inside this custom hook: Nothing too fancy. I love how easy it is to move functionality into custom hooks. (If React Hooks are new to you, read this post first) Now that you know how this smart form works, let’s talk about adding that field. Wait, this custom hook supports only one field. What?! Who wrote this stupid piece of code?? It’s like they didn’t even think of this use case. A change that was supposed to simple is going to be a lot of work. Sometimes I run git blame on a file like this one and find my own commit from 6 months ago. 😅 The person who wrote that piece of code, most likely did the best job they could based on the information they had at that point. However, that information is no longer valid. So, it’s our job to update it. To add this functionality, it will require us to make changes in the Form component, the custom hook and related tests at the same time. The clean code gurus call this Shotgun surgery - firing changes in too many places and hope you don’t break anything else. Been there, screwed that up. Image credit: Alexander Shvets and Dmitry Zhart   The strategy I like to follow now (as explained in last week’s post) is: make the change easy, then make the easy change – Kent Beck Step 1: Make the change easy (to perform): Refactor the hook with this new information (support for multiple fields). This step is known as the preparatory refactor. Step 2: Make the easy change: Add the second form field.   Before we jump on to refactor our custom hook, it would be really cool if we already had tests so that we don’t accidentally introduce any bugs. Did the person who wrote the original code also write tests for it? Probably not. Let’s be honest, it was probably you who wrote that code and didn’t write any tests. But, I don’t blame you. Maintaining a good test suite with respectable code coverage is hard. Quite often, I find myself in the situation where I have to make a complex change, but don’t have enough tests. This is where you introduce Step 0.9: Write just one test only for the part you’re about to change - the form component.   My favorite way of writing tests is with react-testing-library. Here’s what the test looks like: You can run the test with jest Looks good. I’d push this as a commit or even pull request of it’s own. There are a few things to really like here: There is very little implementation detail of the form component in this test, so you can change the underlying code without changing the tests (big code smell if that’s not the case) Our test identifies the input and button the same way a user would - by text / placeholder.   Now, that we have some simple tests, let’s jump on to Step 1: Preparatory refactor. In this step, we’re not interesting in adding the new form field just yet. We want to refactor the custom hook to make it look like when we wrote it, we already knew it will have to support multiple fields in the future. Following is the starting point, copy pasted from above: Milestone 1: Change the data structures but still support just one field No changes made to the Form component yet, let’s make sure the existing functionality still works. Milestone 2: Add support for multiple fields Running tests once more, Great. Again. we haven’t touched the Form component yet. Even if we never add that field, this is still useful work. Let’s push this in a commit / pull request.   You ready to make the easy change to Form? Easy, right? Now that we have changed the functionality of Form, the tests should have failed. (we broke the old logic intentionally) Final step, let’s update this test with a trigger for the second field. That should do it.   To summarise, Instead of trying to make changes in too many files at once, perform a preparatory refactor first - to make the change easy. If you don’t have tests, write a small test, just for the part you’re about to change. Then make the easy change.   Hope that was helpful on your journey Sid Source: 35. Shotgun surgery and React components

    Read at 07:50 am, Apr 11th

  • Statement from npm – npm, Inc. – Medium

    Why have I been blocked? This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data. Source: Statement from npm – npm, Inc. – Medium

    Read at 09:12 pm, Apr 10th

  • The nations of the Amazon want the name back - BBC News

    Image copyright Getty Images Image caption Amazon countries say giving control of the domain to the tech giant could impact on their sovereignty Online retail giant Amazon and the governments of eight South American countries have been given a final deadline to reach an agreement over how to use the ".amazon" web address extension after a seven-year dispute. What will happen next?It's a name that evokes epic proportions: the world's largest rainforest; a global tech company; and now a diplomatic saga nearing its end.This is the battle of the Amazon and it starts back in 2012.The Internet Corporation for Assigned Names and Numbers (ICANN), the body that polices the world wide web's address system, decided to expand its list of generic top-level domains (gTLD) - the bit that comes after the dot in a web address.The new rules allowed companies to apply for brand new extensions, offering internet users and businesses more ways to personalise their website name and addresses.But eight countries containing the Amazon rainforest objected to the retail giant's plans concerning the new .amazon domain name. Image caption The case is pitting Amazon rainforest countries against the US tech giant The governments of Bolivia, Brazil, Colombia, Ecuador, Guyana, Peru, Suriname and Venezuela - all members of the Amazon Cooperation Treaty Organization (ACTO) - say that relinquishing the domain exclusively to Amazon could impact on matters of their sovereignty.Diplomats have told the BBC that they are not seeking to deny Amazon use of the domain but are proposing a "shared governance" of it.According to their proposals, Amazon would be immediately allowed to use the domains which are relevant to its commercial interests, such as "books.amazon" or "kindle.amazon".But each country in turn would be entitled to use domains which relate to their cultural heritage - imagine Amazon nations coming together to promote the region under the "tourism.amazon" domain, for example.Crucially, the countries want to establish a committee in which both Amazon and the eight countries would have the opportunity to object to new top-level domains in the future.But Amazon has rejected these proposals, instead suggesting that the .amazon extension be used in conjunction with two letters representing each country - br.amazon for Brazil, for example. Image copyright Getty Images Image caption Users can now end their website names with more than 1,200 new extensions, including .blog and .you The company has declined to comment ahead of the 7 April deadline, but pointed to previous remarks by its vice-president of public policy, Brian Huseman, who vowed that Amazon "will not use the TLDs in a confusing manner".Amazon has promised to work with governments to identify and block the use of "names that touch national sensitivities" and has pledged to support a new top-level domain using local terms such as .amazonia and .amazonas.And last year it tried to persuade the countries by promising them $5m (£3.8m) worth of free Kindle e-readers and hosting services. They turned down the offer.In a letter sent to ICANN in March, the Ecuadorian Ambassador to the US, Francisco Carrión, said: "We are not looking for financial compensation. Nor are we after ex-gratia concessions to use one or a few second-level domains. "It is a matter of sovereignty for many of us, and the offer to share the TLDs with the company Amazon Inc. is already a compromise." Image copyright Getty Images Image caption Other contentious cases of geographical TLDs include .patagonia and .africa The current dispute follows similar cases already settled. In 2013, for example, the US-based outdoor clothing brand Patagonia withdrew an application for the .patagonia extension after objection from Argentina and Chile. A Mexico-based company had to reach a financial agreement with the town of Bar, Montenegro, in order to obtain consent to register the .bar extension.And in 2016, ICANN granted the registry of the .africa gTLD to a charity based in Johannesburg, South Africa, after it received support from three quarters of African Union countries.But the Amazon saga has been quite unlike any other. More Technology of Business Amazon's application was initially deferred, but Brazilian and Peruvian diplomats managed to overturn it by securing the support of the group that represents governments within ICANN - the GAC.That in itself required diplomatic pressure to change the US position from supporting Amazon Inc. to remaining neutral in the dispute.Then Amazon appealed and a review panel ordered ICANN to make a decision by reaching its own conclusions.If the parties don't reach a consensus by 7 April, Amazon will have two weeks to argue its case again before ICANN makes up its mind. Image copyright Getty Images Image caption ICANN is under pressure to resist the push of governments concerning geographic domain names The case is prompting questions about the independence of ICANN.Amazon's Brian Huseman told ICANN that "globally, hundreds (if not thousands) of brands have names similar to regions, land formations, mountains, towns, cities, and other geographic places". These could be put off applying for new gTLDs because of "uncertainty" over ICANN policy over geographic names.The US-based body is under pressure to resist the push of governments and some believe it might be more open to arguments coming from the business sector this time around.But Daniel Sepulveda, who served as a US Ambassador, deputy assistant secretary of state, and co-ordinator for communications and information policy from 2013 to 2017, says: "The ICANN community would make a mistake if it diminishes Brazil's concerns or engages in aggressive libertarian rhetoric".He believes ICANN needs to strike a fine balance between the interests and freedoms of businesses, organisations and individuals using the internet, without alienating anyone."This is a sensitive situation that requires diplomacy, the exercise of mutual respect, and creative mechanisms for ensuring all sides feel fairly treated," he says.So if Amazon and the eight nations don't reach agreement before the deadline, ICANN has a very difficult decision to make - one that might end up pleasing no-one.Follow Technology of Business editor Matthew Wall on Twitter and Facebook Source: The nations of the Amazon want the name back – BBC News

    Read at 12:00 pm, Apr 10th

  • Single Payer Myths: Removing People From Employer Plans – People's Policy Project

    Molly Adams / FlickrCritics argue that single payer has a unique problem in that it would remove people from employer-provided health plans. Krugman: A far more important consideration is minimizing disruption to the 156 million people who currently get insurance through their employers, and are largely satisfied with their coverage. Moving to single payer would mean taking away this coverage and imposing new taxes. Chait: First, most people who have employer-based coverage like it and don’t want to change. Rattner: Amid the many complications of Medicare for All, the question of what would happen to the 157 million Americans who get their insurance from their employers and the 19 million who are enrolled in Medicare Advantage loom large. One remarkable aspect of this particular criticism (which I am going to call the “switching pain” criticism) is that it never seems to be fleshed out beyond a few sentences. I do not know why exactly this is. But one reason might be because, when you do so, the argument becomes totally indefensible. 1. Single Payer Causes Zero Net Switching Pain In our current healthcare system, virtually all workers are forced to switch away from an employer plan onto the public Medicare plan around age 65. Moving to a single payer plan would thus cause two offsetting outcomes: Workers would no longer switch to Medicare at age 65. Workers would switch, during the one-off transition, to single payer at their current age. So moving to a single payer system creates 1 unit of switching pain (number 2) while eliminating 1 unit of switching pain (number 1). Therefore moving to a single payer system creates 0 net units of switching pain even for those currently insured by employers. All it does is move up the eventuality of switching to Medicare from age 65 to whatever age you happen to be right now. Additionally, calling it “switching pain” is probably not even right. I adopt that term because that is how the critics describe it. But, as Zaid Jilani recently reported, we switch around 10,000 people onto Medicare every day as they turn 65 and those who go through the process seem pretty happy about it. It’s not switching pain. It’s switching pleasure. 2. Single Payer Actually Reduces Switching Pain The fact is that the thing that most disrupts people’s employer-provided health insurance is the system of employer-provided health insurance. Twenty million people were fired or laid off last year from jobs and another 40 million quit or separated from their job for another reason. Not every one of these people had insurance from their job, but many of them did. If we assume half of these job separators had employer-provided healthcare, then that means the current system of employer-provided health insurance pushes 150 million people off their employer-provided health insurance every 5 years. And that’s only counting the workers themselves, not their spouses and kids. The above graph shows how many people lose their job in a given year, but what about how many jobs a given individual has over the course of their career? A longitudinal study conducted by the BLS showed that people held an average of 11.9 different jobs between ages 18 and 50. Once again, we do not know how many of those 11.9 jobs had employer-sponsored health care, but even if we assume only half did, that means that individuals suffer the pain of switching health care at least six times in their working career. Single payer would eliminate this churn and therefore eliminate the switching pain associated with it. And, since single payer, by itself, causes no net switching (point one above), this means that single payer dramatically reduces switching pain. So the evil that single payer is supposed to cause is actually the evil that single payer solves. 3. Current System Requires Constant Switching In addition to forcing people to switch every time they separate from a job, the current system also requires them to switch (or consider switching) every year that they are in a job. The only way the health insurance market works as a market is if, at open enrollment each year, workers reassess their options and switch to whatever plan is best. Of course, in most cases, it is not workers who are tasked with the decision of whether to switch to a new insurance plan. It is their employers who, if they are behaving in the way the market requires, must go out each year and see if there are better insurance plans on offer. If the employer finds a better plan, then the employer will forcibly switch all of their employees to it. Thus, even if you stay on with the same job, you are constantly at risk of being forcibly moved to another health plan. 4. Satisfaction Surveys Critics of single payer like to cite (or mention in passing without citing) surveys showing that people are generally satisfied with their employer-provided health insurance. There are two problems with this. First, the same surveys show the people are more satisfied with public health insurance. People on military or veteran’s health care, which is a full-blown UK-style system, are the most satisfied. They are followed closely in satisfaction by those on our major public health programs, Medicare and Medicaid. Second, asking everyone if they are satisfied with the health system or their health insurance is not a good way to assess how much people actually like the insurance they have. Health insurance is insurance, meaning that some people get a lot of benefits paid out from it while most get very little, at least at a given point in time. Those who do not currently need a bunch of medical care have no idea how good their insurance is because they rarely use it. If you asked me how I like my car insurance, life insurance, and renter’s insurance, I guess I would say “they are great, the companies never bother me.” But insofar as I’ve never made a claim on any of those policies, the real answer is “I have no idea.” Those who do not currently use the system will of course be satisfied. But when they have an accident and get hit with a budget-busting deductible, they’ll probably reconsider. In short, the whole premise of this metric is wrong. 5. Politics Knowers After you have demonstrated that the switching pain argument is wrong on the merits, critics will typically retreat to some kind of political argument about how the objective incorrectness of the point will not solve the political difficulty of it. You see this move in a lot of single payer stuff. For instance, critics will say it involves a big tax hike and then you’ll respond that the taxes will just replace private premiums and then they go “but that’s not how it will be interpreted.” In reality, nobody knows how it will be interpreted and the conventional wisdom of the political class (which is itself often constructed in self-delusional ways) has not had a great track record recently. These political arguments proceed as if the Democratic establishment is completely incapable of persuasion and framing and as if the Republican establishment is going to say things about single payer that it hasn’t already said about every health care proposal favored by liberals. If liberals can pass a plan that Republicans say is socialized medicine run by bureaucrats who can decide to kill you when they want, why can’t they do it again? Finally, in recent surveys, most people say they want a single payer system and, however ignorant you think poll respondents are, it seems clear from the questions asked that they at least know they would not be on their employer’s insurance anymore. If you want a “hard” indicator of where people are on this politically, actually asking them that question seems to be a more direct way of getting an answer than indirectly reading the tea leaves of health care satisfaction surveys. This is the fourth post in our Single Payer Myths series. The series tackles common arguments against a single payer system one at a time. Source: Single Payer Myths: Removing People From Employer Plans – People’s Policy Project

    Read at 08:20 am, Apr 10th

  • GoDaddy Acquires ThemeBeans, CoBlocks, Block Gallery, and Block Unit Tests – WordPress Tavern

    GoDaddy has acquired CoBlocks, ThemeBeans, Block Gallery and Block Unit Tests, one of the leading Gutenberg product lines in the WordPress ecosystem. Founder Rich Tabor is joining GoDaddy as Senior Product Manager of WordPress Experience and will lead a team dedicated to understanding users’ needs and expanding the company’s Gutenberg-related products. Tabor’s fellow CoBlocks founders Jeffrey Carandang and Alex Denning will not be joining GoDaddy. All the commercial themes in the ThemeBeans catalog are now available for free on GitHub. Current customers will continue to receive theme support and remote updates until April 8, 2020. According to Aaron Campbell, GoDaddy’s head of WordPress Ecosystem & Community, CoBlocks will continue to be freely available on WordPress.org. It currently has more than 3,000 active installations and averages a 4.7-star rating. “Nothing will change with the plugin except that it will be added to the GoDaddy account on .org,” Campbell said. “It’s possible it might be renamed or rebranded in the future, but that’s unknown either way at this point. And yes, it will still be on the WordPress.org directory for everyone not just GoDaddy customers (and we plan to add more to it as we develop new blocks).” Campbell could not yet share a roadmap for the plugin as Tabor just started and will be heavily involved in determining the plugin’s future at GoDaddy. Tabor will also be leading a development team that is brining on more React talent to assist with Gutenberg tasks. “Hiring React devs that are capable with Gutenberg is a newer thing that we’re really not totally sure whether it’ll be difficult or not or even how it’ll look,” Campbell said. “Do you hire WordPress people? React people Only those that do both? Do you hire both and pair them up to learn from each other? It’s a thing we’re learning in this new post-Gutenberg world.” Tabor said he was surprised that his products had attracted GoDaddy’s interest but also found it to be validating of his own efforts and the potential of the block editor. “Throughout my time building themes, and then blocks, I’ve learned the real value of getting eyes on a project: Not only do you get the community rallying behind your ideas, such as the Block Manager recently added in Gutenberg 5.3, but you receive a TON of feedback and inspiration,” Tabor said. “Building on that feedback, consistently delivering clever ideas, and executing on the marketing front with inspiring videos, has landed us in a very opportune position.” GoDaddy has acquired a handful of WordPress companies and services during the past few years (ManageWP, Sucuri, WP Curve), but Tabor’s products are the first Gutenberg-related acquisition for the company. “I think it means that the WordPress ecosystem is important, that it’s maturing, and probably most of all – that it’s moving and changing,” Tabor said. “And I think all of those are good. “Gutenberg has changed a lot in WordPress. It’s not just a new editor or new interface, it’s a whole new system that brings with it a whole new group of challenges. Companies like GoDaddy recognizing this and supporting innovation is a healthy sign of growth and maturity.” GoDaddy’s resources will enable CoBlocks, ThemeBeans, and Block Gallery to move faster and add features that were previously out of reach for Tabor’s small team. “We’ll go from just two developers, to a team of incredibly bright engineers,” Tabor said. “And I won’t be spending time figuring out all the intricacies of monetizing a premium plugin in today’s ever-changing WordPress ecosystem. Instead, I can focus on leading the team’s efforts on bringing a better page building experience to WordPress.” He will also have access to insights and data that will enable his team to make more informed decisions about the tools and blocks they build. “This view into how entrepreneurs and business owners are using WordPress is something I could never have achieved at a meaningful scale, and I know it will help me move more confidently in the future landscape of Gutenberg,” Tabor said. Like this:Like Loading... Related Source: GoDaddy Acquires ThemeBeans, CoBlocks, Block Gallery, and Block Unit Tests – WordPress Tavern

    Read at 08:17 am, Apr 10th

  • Medicare for America Will Force People Off Their Insurance – People's Policy Project

    Molly Adams / FlickrPaul Krugman has a piece in the New York Times where he tries to compare Medicare for All to Medicare for America. The piece provides good insight into the developing centrist consensus on these matters, including its heavy reliance on straightforward falsehoods. The sole argument Krugman uses to favor Medicare for America over Medicare for All is that the former lets people keep their current insurance if they want. This is objectively wrong. Here’s Krugman: The big difference [between Medicare for America and] a Sanders-type plan is that people would be allowed to keep private coverage if they chose […] To me, then, Medicare for America — which lets people keep employment-based insurance — looks like a much better bet for actually getting universal coverage than Medicare for All. Medicare for America has a lot of moving parts, but the relevant part for our discussion here is the one that creates a new public health plan and then lets employers forcibly switch all their employees to that plan. This is an option that the vast majority of employers are expected to exercise. Under prior analyses of this type of plan (previously called “Americare”), almost all employers switch over to the public plan because it has a much lower price. What this means is that, under Medicare for America, most people with employer-sponsored insurance will not be allowed to keep private coverage if they chose. Instead, their employer will force them on to the new Medicare plan. If they like their current insurance, they will not be able to keep it. The only difference for them between Medicare for All and Medicare for America is that they will be informed that their insurance has changed via a letter printed on company letterhead instead of a letter printed on government letterhead. That, and the fact that the financing for Medicare for America will rely on the head taxes we call premiums instead of payroll taxes, which draw more from the rich than the poor and middle. That Medicare for America will result in at least tens of millions of people on employer insurance being forced onto the new public plan is undeniable. But one response you might hear to this characterization is to say that employers can already force employees to switch plans, so this is nothing new. And that’s true of course. But what that response reveals is that the entire premise of the “forced switching” critique of Medicare for All is bankrupt. It is already the case that people can be forced off their employer-sponsored insurance either by being fired or because their boss decides they want to go with a new plan. Indeed, this happens literally all the time. In 2018, 66.1 million people separated from their job, each of them losing their health insurance if they got it through that job. In our current system, if you like your health insurance, you do not get to keep it. Your boss decides whether you get to keep it by deciding whether to retain you and by deciding each year whether to change health plans. To be clear, this is not meant to be a criticism of Medicare for America. Indeed, one could make the argument that Medicare for America is clever precisely because it takes the wildly authoritarian system we currently have — where instead of individuals choosing their health insurance, their boss chooses it for them — and leans into it in a way that gets bosses to force most people onto Medicare. But that argument requires you to recognize what is going on and so far pundits like Krugman seem to be entirely confused about this. In terms of the “political argument,” I genuinely don’t understand how people can convince themselves that Medicare for America is less of a political problem than Medicare for All when both will result in huge swaths of people with employer insurance being forcibly switched onto Medicare without them having any choice in the matter. The only thing you could really say is that Medicare for America obscures what it is doing better and thus can trick the public more easily. That seems like a stretch to me, but then again, if they tricked Paul Krugman, then maybe they can trick a lot of people much dumber than him. Source: Medicare for America Will Force People Off Their Insurance – People’s Policy Project

    Read at 08:02 am, Apr 10th

  • Opinion | Don’t Make Health Care a Purity Test - The New York Times

    There are multiple ways to achieve universal coverage.ImageCreditCreditAndrew Harrer/Bloomberg We’re now in the silly season of the Democratic primary — a season that, I worry, may last all the way to the nomination. There are many honorable exceptions, but an awful lot of reporting seems to be third order — not about the candidates, let alone their policy proposals, but about pundits’ views about voters’ views of candidates’ electability. It’s a discussion in which essentially nobody has any idea what he or she is talking about.Meanwhile, however, there are some real continuing policy debates. They’re not mainly about goals: Whoever t he Democrats nominate will profess allegiance to a progressive agenda aimed at reducing inequality, strengthening the social safety net and taking action on climate change. But there are some big differences about how to achieve those goals.And the starkest divide involves health care. Almost surely, the eventual platform will advocate “Medicare for TK.” But what word is eventually chosen to replace the placeholder “TK,” and more important, what that means in terms of actual policy, will be crucial both for the general election and for what comes after if Democrats win.On one side, there’s “Medicare for All,” which has come to mean the Bernie Sanders position: replacing the entire existing U.S. health insurance system with a Medicare-type program in which the government pays most medical bills directly.On the other side, there’s “Medicare for America,” originally a proposal from the Center for American Progress, now embodied in legislation. While none of the announced Democratic candidates has endorsed this proposal yet, it’s a good guess that most of them will come around to something similar.[For an even deeper look at what’s on Paul Krugman’s mind, sign up for his weekly newsletter.]The big difference from a Sanders-type plan is that people would be allowed to keep private coverage if they chose — but they or their employers would also have the option of buying into an enhanced version of Medicare, with substantial subsidies for lower- and middle-income families.The most important thing you need to know about these rival plans is that both of them would do the job.Many people realize, I think, that we’re the only advanced country that doesn’t guarantee essential health care to its legal residents. My guess is that fewer realize that nations achieve that goal in a variety of ways — and they all work.Every two years the Commonwealth Fund provides an invaluable survey of major nations’ health care systems. America always comes in last; in the latest edition, the three leaders are Britain, Australia and the Netherlands.What’s remarkable about those top three is that they have radically different systems. Britain has true socialized medicine — direct government provision of health care. Australia has single-payer — it’s basically Bernie down under . But the Dutch rely on private insurance companies — heavily regulated, with lots of subsidies, but looking more like a better-funded version of Obamacare than like Medicare for All. And the Netherlands actually tops the Commonwealth Fund rankings.So which system should Democrats advocate? The answer, I’d argue, is the system we’re most likely actually to create — the one that will play best in the general election, and is then most likely to pass Congress if the Democrat wins.And there’s one big fact on the ground that any realistic health strategy has to deal with: 156 million Americans — almost half the population — currently receive health insurance through their employers. And most of these people are fairly satisfied with their coverage.A Medicare for All plan would in effect say to these people, “We’re going to take away your current plan, but trust us, the replacement will be better. And we’re going to impose a bunch of new taxes to pay for all this, but trust us, it will be less than you and your employer currently pay in premiums.”The thing is, both of these claims might well be true! A simple, single-payer system would probably have lower overall costs than a hybrid system that preserves some forms of private coverage.But even if optimistic claims about Medicare for All are true, will people believe them? And even if most people do, if a significant minority of voters doesn’t trust the promises of single-payer advocates, that could easily either doom Democrats in the general election or at least make it impossible to get their plan through Congress.To me, then, Medicare for America — which lets people keep employment-based insurance — looks like a much better bet for actually getting universal coverage than Medicare for All. But I could be wrong! And it’s fine to spend the next few months arguing the issue.What won’t be fine will be if activists make a no-private-insurance position a litmus test, declaring that anyone advocating a more incrementalist approach is no true progressive, or maybe a corrupt shill for the medical/industrial complex. As you might guess, my concerns aren’t drawn out of thin air; they’re things I’m already hearing.So Democrats should try to make this a real debate, one about the best strategy for achieving a shared goal. Can they manage that? I guess we’ll find out.The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.Paul Krugman has been an Opinion columnist since 2000 and is also a Distinguished Professor at the City University of New York Graduate Center. He won the 2008 Nobel Memorial Prize in Economic Sciences for his work on international trade and economic geography. @PaulKrugman Source: Opinion | Don’t Make Health Care a Purity Test – The New York Times

    Read at 07:59 am, Apr 10th

  • White Woman's New 'Clean' Chinese Restaurant Provokes Immediate Backlash: Gothamist

    A white woman who recently opened a "clean" American Chinese restaurant in the West Village is fending off a wave of criticism decrying her marketing strategy as racist and culturally appropriative. Nutritionist Arielle Haspel opened Lucky Lee's for lunch this week, initially positioning her dishes as alternatives to the "oily," "salty" cuisine that, as she put it in an Instagram post, makes people "feel bloated and icky the next day." That post disappeared from Lucky Lee's account after Eater questioned Haspel about the language, prompting her to explain that her food is for "people who love to eat Chinese food"—itself an umbrella term—"and love the benefit that it will actually make them feel good." That means people with sensitivities to gluten, wheat, refined sugar, Haspel said; people who want to avoid GMOs and MSG, even though there exists no definitive evidence to suggest that last one actually causes allergies. There's a lot to read between those lines: Namely, that if Haspel's food is "clean," the cuisine she purports to improve upon is not; that if her offerings "actually make [people] feel good," then the original leaves people feeling bad. (Or "icky," as the case may be.) As Grub Street points out, a long-standing stereotype about Chinese restaurants paints them as dirty, and even if she intended to invoke "clean eating"—as in, avoiding refined and processed foods—Haspel still seems to assume that Chinese food is preservative- and additive-heavy. In reality, Chinese food as Americans know it is often sweet and starchy because it has been tailored to American tastes. "It's very much erasure, the way that she's stepped on years and decades and centuries of tradition, of the migration of Chinese immigrants who were actually banned from taking jobs that were reserved for white people," Esther Tseng—a freelance food writer—tells Gothamist. "Either doing a Chinese restaurant or running a laundry were the only jobs that they were allowed to do. Does she know that? Does she know that history? Does she know why there's sugar added to some Chinese recipes, in order to cater to the white palate?" In suggesting "that a lot of other American-Chinese restaurants don't care as much about their ingredients," Tseng continued, Haspel seems to be "elevating herself above this Chinese-American tradition of feeding as many people as they can with their dishes, or adapting their recipes for a wider audience," at the same time she tries to profit off of it. Gothamist's request for comment remained unanswered at time of publication, but in an Instagram post, Lucky Lee's addressed some of the backlash flooding its various comments sections. (Although it bears noting that some people interpreted the less-than-glowing response as woke culture run amok.) "When we talk about our food, we are not talking about other restaurants, we are only talking about Lucky Lee's," a caption explained. "Chinese cuisine is incredibly diverse and comes in many different flavors (usually delicious in our opinion) and health benefits. Every restaurant has the right to tout the positives of its food. We plan to continue communicating that our food is made with high quality ingredients and techniques that are intended to make you feel great." View this post on Instagram The other day we received some negative comments on an Instagram post. Some of your reactions made it clear to us that there are cultural sensitivities related to our Lucky Lee’s concept. We promise you to always listen and reflect accordingly. A number of comments have stated that by saying our Chinese food is made with 'clean' cooking techniques and it makes you feel great that we are commenting negatively on all Chinese food. When we talk about our food, we are not talking about other restaurants, we are only talking about Lucky Lee's. Chinese cuisine is incredibly diverse and comes in many different flavors (usually delicious in our opinion) and health benefits. Every restaurant has the right to tout the positives of its food. We plan to continue communicating that our food is made with high quality ingredients and techniques that are intended to make you feel great. Chef/owner, Arielle's husband's name is Lee and his life-long love of Chinese food was inspiration for the restaurant. The name Lucky Lee's reflects the story of how the recipes were conceived. We also received negative comments related to being owners of a Chinese restaurant but not being Chinese. Owners Arielle and Lee are both Jewish-American New Yorkers, born and raised. Similar to many other Jewish New Yorkers' diets, bagels, pastrami sandwiches and yes, American Chinese food, were big and very happy parts of their childhoods. New York is the ultimate melting pot and Lucky Lee's is another example of two cultures coming together. To us, this is a good thing. We love American Chinese food and at Lucky Lee's it is our intention to celebrate it everyday and serve great food. #luckyleesnyc A post shared by Lucky Lee’s (@luckyleesnyc) on Apr 9, 2019 at 8:44am PDT Further, the caption explained, Haspel's husband's name is Lee, and his "life-long love of Chinese food" inspired the restaurant. In a statement to Eater, Haspel emphasized that she is "very inclusive, and ... here to celebrate the culture." Still, some have expressed skepticism: As Tseng pointed out, it's not really Haspel's place to center herself in a conversation about inclusion in a culture to which she does not belong. And then, many a white restaurateur has leaned on the "lucky" trope in naming their Chinese restaurant, and as one commenter pointed out on Twitter, might she have gone another route if his name were, say, Brad? Lucky has become code for something awful.Lucky Cricket: Andrew Zimmern's new Chinese restaurant (dragged by @hooleil) Lucky Cat: Gordon Ramsay's upcoming "authentic Asian" restaurant, with no Asian chefLucky Lee's: nutritionist Arielle Haspel's "clean" Chinese restaurant https://t.co/McAqc6BTAu— Cathy Erway (@cathyerway) April 9, 2019 And saying it’s just named after her husband Lee. If his name was Brad, I don’t think she would have gone that route...— Alaia Williams (@AlaiaWilliams) April 9, 2019 In any case, Lucky Lee's Yelp page seems to have been scrubbed of the sea of negative reviews complaining about all of the above. If anyone from the restaurant gets back to us, we will let you know. Source: White Woman’s New ‘Clean’ Chinese Restaurant Provokes Immediate Backlash: Gothamist

    Read at 07:53 am, Apr 10th

  • The high cost of slow tests

    Your test suite runs too slowly, and it’s annoying—but it’s definitely not an emergency. After all, you’ve got a whole slew of bug fixes and feature requests queued up, and those are more important than your test suite. So you can never quite justify spending the time to speed it up. But while it’s true that your test suite is a means, not an end, a slow test suite can be very expensive, and well worth your time to speed up. To see why, in this article I will go over the some of the costs your slow tests can cause, some obvious, some less so: Wasted developer time. Context switching. Reduced velocity. Bypassed tests. TEASER_END The obvious cost: wasted time Let’s say it takes 6 minutes to run your team’s test suite. 6 minutes isn’t that long, right? If each developer on the team ends up waiting for the test suite twice a day, and the team has 10 developers, that’s 10×6×2=120 developer minutes/day spent waiting. Put another way, that’s 25% of a single developer’s 8-hour workday. Given developer salaries in the US, and the fact that a feature that takes a month to develop can be sold and resold to tens or hundreds or thousands of customers, we can reasonably assume that a developer can produce $400K of value in software per year. Combine those two numbers and we get a sense of the cost of time spent waiting twice a day for a 6-minute test suite: hundreds of thousands of dollars a year. $100,000/year for 10 developers. $500,000/year for 50 developers $1,000,000/year for 100 developers. These aren’t accurate numbers, of course, but they’re in the right range: slow tests add up. When waiting gets boring: task switching Beyond a certain point, of course, you aren’t going to sit there staring at you screen waiting for the tests to finish. Instead, you’re going to switch to another task. Then, when the tests finish (or when you remember to check) you’ll switch back, see if something failed, fix it, rerun the tests, and then switch back to the other text. All this task switching has a cost: remembering what you were doing, why you were doing it, figuring out where your relevant browser tabs are hiding, and so on. On the level of cognitive abilities, there’s extensive psychological research (summarized here by the American Psychological Association) showing that task switching slows down performance of tasks. Given the tooling and cognitive complexity of programming, the costs of task switching are quite high, though difficult to measure. Really slow tests: reduced velocity, bypassed testing Once your test suite is sufficiently slow, additional costs get added on. Consider for example a test suite that takes 4 hours to run. First, it becomes quite difficult to merge a feature or bug fix within a single day. The smallest mistake that causes the test suite to fail can push finishing up the task to the next business day—and if you’re not careful, the day after that. Second, this also makes the task switching problem worse. You need to remember what you were up to yesterday, which is a lot harder than remembering what you were up to half an hour ago. Third, the reduced velocity can clash with the need to ship things like emergency bug fixes. The slower the test suite, the more tempting it is to bypass it—"just this once"—in order to deploy fixes to customers faster. And that leads to more bugs, and more emergency deploys. Slow tests are expensive! Because your test suite is a critical bottleneck in the development process, impacting your whole team multiple times a day, small delays can quickly add up to big costs. Don’t put off slow tests as an annoyance: do the math on how much time your team is wasting, and then spend a commensurate amount of time speeding it up. A week’s worth of developer time this month will save you a whole lot more over the course of a year. Source: The high cost of slow tests

    Read at 02:10 pm, Apr 9th

  • Pipdig Under Investigation, Company is Refusing Customers’ Refund Requests – WordPress Tavern

    In the wake of last week’s Pipdidg scandal, the WordPress blogger and developer communities have been working together to help the company’s customers get on new themes and ensure the safety of their websites. Pipdig has been reported to various UK and internet authorities and is currently under investigation. Pipdig’s hosting provider has proactively disabled malicious code in certain files while the company conducts its own investigation. Props to @kualo, @pipdig's hosting provider, for stepping in and commenting out (disabling) malicious code. To @pipdig's WordPress customers: make sure you're using version 4.9.0 and you'll be *okay*, for now at least. I still can't recommend staying with them, though. pic.twitter.com/V0c40A29lL — Nicky Bloor (@nickstadb) April 3, 2019 Meanwhile, Pipdig has been denying customers’ refund requests, in accordance with its “no refund” policy. Customers have received responses from the company claiming that the recent accusations were either “false, twisted, or sensationalized.” Anyone trying to get a refund from Pipdig, this is the reply I got #pipdig pic.twitter.com/sGaysyyVkW — Sophiaaaxo🍑 (@sophiatranterxo) April 5, 2019 Customers who have purchased Pipdig products within the last 180 days may still be able to receive a refund through other channels. The Twitter thread below suggests lodging a payment dispute with PayPal or your bank or credit card provider, by referencing consumer protection laws and providing evidence of Pipdig’s false and misleading conduct. Explainer: How to get a refund from @Pipdig. If you have bought the plugin in the last 180 days first email #pipdig asking for a refund. /1 — ⓘⓌⓡⓘⓣⓔ (@opinionhacker) April 2, 2019 Help for Affected Pipdig Customers Switching to New Themes If you work in WordPress every day, you may not realize how much of a challenge it is for some users to switch themes. WordPress developers and bloggers are stepping up to provide resources to help those who want to transition to a new theme. “I understand that bloggers using Pipdig themes for WordPress might want to switch away, but don’t have the time, money, or skills to do so right away,” Mark Jaquith said. “So here’s P3 Neutraliser — a plugin that will prevent the P3 plugin from updating or ‘phoning home.'” The plugin is available on GitHub with step-by-step instructions for downloading and installing it. It is intended as a stopgap measure for users to activate while they are in the process of transitioning to a new theme. Former Pipdig customers are struggling to find new themes, as a large number of them fall into the fashion blogger demographic. This is a niche with specific requirements for design and functionality. Many are also confused about the findings in the reports and don’t know how to act on this information. I need to change my theme from Pipdig to another safe one but I'm struggling 😭 I'm in love with my Pipdig theme now. However, I do like the 17th Avenue themes. Does anyone know if they're safe? #pipdig I don't want to do this all over again in a few months 😩 — Melissa🌹 (@rosymelissax) April 7, 2019 Not sure what to do i have a pipdig theme for my blog 😭 — Erin (@Erin_Louisee) April 3, 2019 SO overwhelmed by all the #pipdig issues I'm reading & don't understand half of it… Defs time for a theme refresh but no idea where to start. Do I spend ££ designing one with a developer? V confusing for someone who has no coding knowledge at all. Anyone else feeling the same? — Luisa-Christie 💙 Ⓥ (@luisachristie) April 3, 2019 Searching WordPress.org for fashion-inspired themes does not turn up many relevant results. Former Pipdig customers hunting for new themes will need a more curated list of recommendations. WordPress developer Tia Wood published a post with a list of both free and commercial alternative themes that may be helpful to those still looking. Freelance designer Rachel Sulek has a Twitter thread with options that are comparable to Pipdig’s theme designs. Like this:Like Loading... Related Source: Pipdig Under Investigation, Company is Refusing Customers’ Refund Requests – WordPress Tavern

    Read at 07:29 am, Apr 9th

  • From Flow to Typescript. Why?

    It all started almost two years ago. I was sick with constant silly javascript mistakes like undefined is not a function in my apps. So, I have decided to add optional static typing. Two years ago the javascript land was completely different. Both Flow and TypeScript had a lot of disadvantages: poor libraries support, from none to almost none IDE support, type issues, and limitations. I have chosen Flow just because it was easier to start with. Plug it into your .babelrc and start working. Almost 6 months ago I have made a decision to move all our frontend projects from Flow to TypeScript. It was a tough battle inside my head. So, I have decided to write it down to help other people to choose the right tool. And not to make my mistakes. These tools are quite similar, both providing type-safety to plain javascript. And this article is not about types or differences between structural and nominal subtyping. It more about the current state of these tools. You rarely change typing tools because of types. I will start with the most important aspect of all technical decisions. Yes, it is about hype-driven-development. Please, do not make your face like this. I will explain how it works, and possibly you will change your mind. I quite often speak about our stack, write articles about it, etc. And every time I said that we were using Flow other developers asked me: “But why not TypeScript”? And every time I had to explain my choice. Going deep into details, history, and tooling. Sometimes even explaining the state of current projects and our workflow. This was not a pleasant experience when you are not advocating for something. I was just a user. I do not really prefer one to another. And it felt really strange to had this conversation over and over again. Moreover, we make services for our clients, and we hire other developers. And some of them literally wants to work with TypeScript and does not want to work with Flow. Why? Because they heard about TypeScript and how awesome it is. While the hype train around Flow is not so massive. Me: Hi, we use X, Y, Z, and Flow for this project Dev: Flow? Why not TypeScript? Me: Oh, are kidding me? :facepalm: If you do not want to fight this hype train but make it work for you it is better to step aside and use whatever is hyped. Keeping in mind that there’s no massive change for your current workflow. Vue 3.0 will support TypeScript out of the box, Nuxt already supports TypeScript. There are a lot of projects that ship types together with the source code. axios, vuex, vue-router, lodash to name a few. What about Flow support? Vue currently uses Flow for typing (switching to TypeScript starting from 3.0), but these types are development only. You cannot take them and use in your own projects. Maybe there are different types? Yes, Flow has its own repository for types. The problem is that installing types is a whole new extra step. You have to configure postinstall hook to make sure that types are also rebased after each npm install call (yes, they use git rebase). When you will dig into flow-typed packages you will find that it is mostly React oriented. Flow even has a lot of React primitives in the standard library. Which I find really strange. But what about Vue specific types (since we use Vue a lot)? Yes, you can find @vue-flow-type package maintained by a single person. The sad thing is that I am this single person. I am really tired of maintaining types for several popular projects. And as you can imagine there are bugs, type changes, new releases, etc. TypeScript wins this one for me. Its distribution system does not force me to do extra work. Just install something and it will work. Because types/ subfolder is shipped together with the source code via npm. No extra steps are required. Library authors maintain types/ folder together with the rest of codebase. They can be sure that everything works correctly. Let’s discuss IDE support for Flow projects. Or I would say “no IDE support”. That’s not a big thing, I can write my code using just nano. But I spend a lot of my life inside text editors and I want them to be friendly. Sadly, Flow plugins for all major IDEs (and text editors) are buggy and unreliable. For example, VSCode plugin does not work at all. And at the same time, VSCode is known for its first-class TypeScript support. With intellisense, type-checking, and autocomplete out of the box. Have a look at our VSCode + TS + Vue setup. With this simple feature, your development workflow starts to feel more responsive, and the feedback loop time is significantly decreased. The other thing that was ruining my Flow experience is the number of unfixed bugs in Flow itself. For example, when you install Vuex all Vue components are extended with an extra property which can be accessed with this.$store. The thing is there’s no way to tell Flow that Vuex was added. And this bug is opened since 2015, for 4 years now! Of course, you can still write your own types: But now you have to maintain your own types by yourself. Do you want to add this.$router property? Please, add it yourself. Nuxt specific types? You are on your own. Compare it with the standard TypeScript approach: Existing types can be extended with special declarations. And library authors do that for you. Remember what I said about types distribution? This feature makes the distribution even better. The second well-known bug from 2015 is that you cannot annotate this even if you have to. Some libraries have strange APIs. With Flow you just cannot do anything, typing is lost there. But with TypeScript you can annotate what this means in every context. And it is great for a lot of use-cases. Why these bugs are not fixed? I don’t know. They brought a lot of attention during the years. A lot of people wanted these things, but Flow team does not share their vision on the project. And they release things that they want, not the community. Talking about releases I must mention their policy: “just release things and make users fix their code”. Here’s the release history and what it has done to my project. Almost every release breaks my code. Considering that it is a template with almost no code – it is really scary. By the way, Flow team does not follow SemVer, they just release incrementally. After one release jsx inside .vue files stopped working. I was not able to fix it ever again on new versions. I took the lazy path: pinned the version and just ignored the updates after this incident. TypeScript has clear release policy, SemVer, and wide attention to the community. It is much better to maintain in the long run. We have made our choice and said “Good bye” to Flow. Now all our projects and our project template supports TypeScript. And we regret nothing! By the way, our template is truly awesome. It supports: Nuxt for server-side rendering and boilerplate isolation TypeScript everywhere: code, tests, configuration Jest for unit tests, TestCafe for E2E tests Docker for development and production Awesome documentation that covers every aspect of the project Try it out! Source: From Flow to Typescript. Why?

    Read at 12:07 pm, Apr 8th

  • How to make your Résumé an NPM package – Noteworthy - The Journal Blog

    Why have I been blocked? This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data. Source: How to make your Résumé an NPM package – Noteworthy – The Journal Blog

    Read at 10:05 am, Apr 8th

  • A current list of my top problems in pressthink, April 2019 - PressThink

    A current list of my top problems in pressthink, April 2019 Updated from time to time. Ranked by urgency. 7 Apr 2019 2:05 pm 2 Comments → 1. Absent some kind of creative intervention, 2020 campaign coverage looks like it will be the same as it ever was. Who’s ahead? What’s it gonna take to win? The debacle in 2016 has not brought forth any dramatic shift in approach. The “savvy” style remains in place. Its practitioners are confident that they can prevail. They are probably right. 2. The Correspondent, with which I am publicly identified, met its crowd funding goals and now has to deliver on these principles. That will not be easy. 3. With his hate campaign against journalists, Trump has been successful in isolating about a third of the electorate in an information loop of its own. These are people beyond the reach of journalism, immune to its discoveries. Trump is their primary source of information about Trump. The existence of a group this size shows that de-legitimizing the news media works. The fact that it works means we will probably see more of it. 4. Fox News is merging with the Trump government in a combination unseen before. We don’t know what that combined thing is, or even how to talk about it. The common shorthand is “state media.” But that’s only half the picture. It’s true that Fox is a propaganda machine. But it is also true that the Trump government is a cable channel— with nukes. 5. Around the world, so called populist movements are incorporating media hate into their ideology— and replicating. No one knows how to stop or even slow this development. 6. Now in its 15th year, the business model crisis in journalism is still unsolved. (But at least we know that except in rare cases digital advertising is not going to be the answer.) 7. Membership models in news need to be participatory to work, but we’re falling behind in our understanding of how to make that happen. With ad-supported media, we know what the social contract is. We know how it works with subscription, as well. For membership, we do not know what that contract is. 8. The harder I work on some these problems (1, 3, 4, and 5 especially…) the more cynical I get. The more cynical I get, the harder it is to believe that any of that work matters. Source: A current list of my top problems in pressthink, April 2019 – PressThink

    Read at 03:57 pm, Apr 7th