This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: RE: Coding Standards
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Dan Moore is talking about Coding Standards. The good old religious war :)
Ken Arnold has an interesting post where he recommends that coding standards be integrated into the language specification, and enforced by the compiler.
His reasons:
There's no real productivity difference between one coding style and another.
There's real productivity lost in setting up pretty printers, re-formatting code manually, and arguing about the better style.
If programmers have latitude, they'll use it. (See perl.)
So, take away the freedom of programmers to format their code in a non standard manner. Make coding style part of the compiler--not as a warning though (as Bruce Eckel says "when you discover you can ignore them [warnings], you do")--actually have the compiler error out if the formatting is incorrect.
If you want this, then use Python.
Although I do understand that if you go with an approach like this, you get productivity gains from the fact that everyone can read code.... I also think that there are downsides from taking away style.
Imagine how boring it would be if we all wrote the same way.
What I think is a better solution, would be to have smart systems where you read code "how you want to read it". You set up your personal coding standards, and when you view anyones code you see it how you want to. And of course, anyone else can do that too.
With this in place, Cameron can do his weird braces trick, and I would see it like normal ;)
Of course, there are the coding standards such as where the braces go, and then there are other style issues (e.g. while(...) vs. for (Iterator ....) [which goes away a little with JDK 5]. A really smart system would be able to change a lot with the view.
For now we can use source munging tools.