This article is more than 1 year old

Can't agree on a coding style? Maybe the NEW YORK TIMES can help

Having controlled our commas for decades, Grey Lady now positioning our braces

For decades, dour broadsheet the New York Times and its style guide have presided over the world of posh writing: its English usage manual serves as both a bible for upmarket writers and a blunt instrument with which to beat sensationalist tabloid hacks such as your humble correspondent.

Now the Grey Lady has turned her hand away from setting the standard on commas and em dashes to an entirely different kind of punctuation: defining proper Objective-C programming style. Semicolons, braces, whitespace and so on are all familiar territory to the NYT's editors, but here we have a set of rules for developers.

The style guide, which is relevant to any coder of C-like languages, has the following sorts of wisdom:

if (!error) return success;

The above is outlawed. If() must be followed by an indented block wrapped in matching {} braces, the leading brace on the same line as the if(). And the indent must be four spaces. You may as well kick off a git versus svn argument.

The documentation adds: "Long, descriptive method and variable names are good." Just like its headlines, then.

The guide was published this month, and updated only hours ago; the newspaper's iOS app team have invited contributions - via GitHub, of course. The paper's senior mobile software engineer Matthew Bischoff explained:

The New York Times has a long history of publishing style guides. We first released The New York Times Manual of Style and Usage in 1950 so that reporters inside and outside The Times could have a definitive resource for our somewhat quirky rules.

But what about style for our favorite programming languages? At The Times, software developers are as obsessed with brackets and braces as journalists are with word choice and punctuation.

At The Times, we care deeply about all the words we write — help us make the ones read by compilers as good as the ones in the newspaper.

Your humble hack never knew GCC or LLVM cared that much. ®

No doubt you have an opinion on the Grey Lady's style of programming (I mean, honestly, braces on the SAME line as the if()?), so flame away in our comments section, no holds barred; just hit the button below.

More about

More about

More about

TIP US OFF

Send us news


Other stories you might like