I was reading Ken Arnolds “Style is Substance” essay this morning (as part of Joel Spolskys book “The Best Software Writing I“) and can’t resist to add my 2c worth (plus I won’t tell you were I was sitting when reading the essay 🙂
Coding Style doesn’t matter. It doesn’t matter where you put your curly braces (as long as you’re doing it in a consistent way).
What does matter is
- that your code clearly expresses your intent
- doesn’t violate the DRY principle
If you do that, your methods will be short enough to make coding style irrelevant – magic. Because coding style will get in your way only if it is used to structure your code. And code isn’t structured by a certain coding style, it is structured by classes and methods and design principles on how objects should work together.
It’s just easier to debate white-space & curly braces. Everyone can do that. But not everyone can write clear code. Spend your energy on improving your coding skills.
It took me years to come to this conclusion. Don’t make the same mistakes I made.
And, BTW, of course, as long as you’re working in my team, you are supposed to put your curly braces where I say they belong 🙂
Jason Fried notes that The days of consistency are over. It sure looks like. Today Microsoft previewed Office 12 with a totally new UI – while some components of Office 12 (OneNote comes to my mind) seem to stick to the “old-fashioned” Look & Feel.
Here are some rambling thoughts of mine on the whole topic viewed from the humble perspective of software developer working on a cross-platform desktop application.
Here‘s an interesting podcast on “The long tail” (the statistical distribution of sales observed by (online) businesses). Very worthwhile.
Ich sach’ mal, das laß ich lieber.