Not Wicked: inconsistent coding standards
You know what's very uncool? When people change coding standards throughout a section of code. I can't stand it!
I normally follow the K&R style, though I don't cry when people follow one of the other styles. K&R's guidelines are often called "the one true brace" approach, though I don't think any one particular format is much better than another.
I do cry when they use a mix of all sorts and don't have any elegance to their code.
In their defence, I think this script has been hacked on by a bunch of different people, but still, I adapt my style to match the code I'm working in if need be... so can others.
It almost makes me want to not steal their code at all ;)
Update: 09/12/2005 08:20AM
For the record, this includes people that use camelCaseVariables sometimes and under_scores_elsewhere. Grr!
Great post, I wasn’t sure what you were referring to until I read http://en.wikipedia.org/wiki/Indent_style and enlightened myself on the various coding styles.
I could see how varying styles would send your crazy, especially when you are trying to follow multiple/nested control statements.
I personally use the BSD/Allman style. It is funny because it follows a similar standard of Pascal; my first ever programming language.
I used to be a fan of the under_score_variable naming convention, but soon strayed toward camelCaseVariables once I was introduced to OO programming.
Expecting everyone to follow the same standards and styles is like expecting everyone to speak Engrish… I mean English ;)
I use BSD/Allman style typically because a lot of the Visual Studio auto-generated code is created in that style. I guess that is an example of following someone elses conventions.
BSD/Allman for me too. :) Just what I’m used to.
And as for variable names, underscoresSuck ;)
underscores_rule :) much more like reading english instead of one big mashed together word!
I use BSD/Allman style and camelCase on my own code, and use whatever style I’m told to use (which is usually whatever the codebase is in) when I’m being paid for it.
There is an ancient code formatting tool that comes with gcc called indent. It is designed to format C code, but I’ve been using it on the FCKEditor Javascript (which has all the whitespace removed) without any problems.
Hopefully we can all agree that Hungarian notation is a terrible idea.
Same sorta coding as CSS and Flash Actionscript. Which when I use these I tend to stick to the K&R style as it keeps the code without excess hard returns for just a { symbol/bracket.
Sometimes keeping it all on one line for CSS also e.g .style {font: arial;} depening on the amount of CSS and how neat and compacted I want the file to be.
As for underscores, I prefer them like Fitzy said, its easier to read than a mushed up word with camelCase.