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.

Build a business case: developing custom apps

More from The Register

next story
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
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
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
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
Cloudy CoreOS Linux distro declares itself production-ready
Lightweight, container-happy Linux gets first Stable release
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.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
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.
Maximize storage efficiency across the enterprise
The HP StoreOnce backup solution offers highly flexible, centrally managed, and highly efficient data protection for any enterprise.