Cleaning Out Argument Labels

The guys over at CleanCoders made a video series on the creation of an iOS app. While refractoring, they decided to remove keyword arguments.

We also walked through the code replacing most of the keyword arguments with positional arguments – something that swift does not make particularly convenient. We did this because the code just looked better once it was done.

I think this is a terrible idea.

Coincidentally, I’m in the middle of the chapter on function naming in Clean Code. He argues against ternary arguments because it’s too easy to lose track of what arguments belong in the first, second, and third position. “Sounds like argument labels would help,” was my first thought. Looks like he disagrees. It makes me more skeptical of his other advice.

WSJ on Trump’s Carrier Deal

The Wall Street Journal editorial board critizies Trump’s Carrier deal, calling it a “shakedown:”

A mercantilist Trump trade policy that jeopardized those exports would throw far more Americans out of work than the relatively low-paying jobs he’s preserved for now in Indianapolis. Mr. Trump’s Carrier squeeze might even cost more U.S. jobs if it makes CEOs more reluctant to build plants in the U.S. because it would be politically difficult to close them.

Mr. Trump has now muscled his way into at least two corporate decisions about where and how to do business. But who would you rather have making a decision about where to make furnaces or cars? A company whose profitability depends on making good decisions, or a branding executive turned politician who wants to claim political credit?

I fully expected them to give Trump a pass. Credit to them for sticking to their principles.

At the Washington Post, Fred Hiatt characterized the deal as right out of Putin’s playbook:

It’s good that about 1,000 Carrier Corp. workers will not be losing their jobs. But there is a whiff of Putinism in the combination of bribery and menace that may have affected Carrier’s decision – the bribery of tax breaks, the menace of potential lost defense contracts for Carrier’s parent company, United Technologies.

If this were to become the U.S. government’s standard method of operation, the results would be Russian, too: dwindling investment, slowing economic growth, fewer jobs.

It’s always been clear that Trump understands bullying, but doesn’t care about policy. This deal is a reflection of that. There’s no policy or plan to keep manufacturing jobs; just a willingness to bully and bribe a specific company.

Secret Lambda Permissions

This is the culmination of half a days work trying to figure out why my Lambda function didn’t fire:

The console doesn’t support directly modifying permissions in a function policy. You must use either the AWS CLI or the AWS SDKs.

In other words: it is a secret setting that we hide from you. Just in case you’re trying to use a versioned lambda function or a function alias.

Election Percentages

Courtesy David Frum:

Nixon 1960: 49.55%
Gore 2000: 48.38%
Kerry 2004: 48.26%
Ford 1976: 48.01%
Romney 2012: 47.15%
Trump 2016: 46.17%

Fair Elections

I keep thinking about this tweet from Garry Kasparov:

Saying that fair elections are rigged is as much a crime against democracy as saying that rigged elections are fair.

It’s an odd twist that Trump is casting doubt on an election that he legally won (even if it was with a national minority). I attribute that to a strategy of working the ref. The lie of voter fraud is groundwork on propaganda that will be needed in future efforts to suppress voting rights.

It also made me think the same idea applies to the news: Saying that fair journalism is biased is as much a crime against truth as saying that biased journalism is fair.