Feeds

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

Boost IT visibility and business value

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.

The Essential Guide to IT Transformation

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
Leaked Windows Phone 8.1 Update specs tease details of Nokia's next mobes
New screen sizes, dual SIMs, voice over LTE, and more
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
Mozilla keeps its Beard, hopes anti-gay marriage troubles are now over
Plenty on new CEO's todo list – starting with Firefox's slipping grasp
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
The Essential Guide to IT Transformation
ServiceNow discusses three IT transformations that can help CIO's automate IT services to transform IT and the enterprise.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.