This is a little rant. If you don’t like those, move along.
I think coders have been slowly becoming lazier, and now it’s really started to get on my nerves. I’ve seen SOOO much public code lately that is just frightening! I’m not referring to the algorithms or other technical aspects of the code here, but rather to the lack of formatting.
I’m not starting a religious war here. I don’t care if you put your opening brace on the same line or the next. I don’t care if the braces are indented or not. I don’t care if you use tabs or spaces. I don’t care if indents are 3 spaces or 12. I don’t care if you mark members with an "_", an "m_" or any other wart. (Well, to be fair, I do have opinions on all of those, I just don’t care if your opinion differs.)
No, what I care about is consistency. It’s the lack of consistency that I’ve been seeing lately that’s lead to this rant. In fact, it goes beyond a lack of consistency. Developers aren’t even TRYING to make their code readable or maintainable. Want an example of what I’m ranting about? Check out the published code in this article on CodeProject. I don’t even know how hard you have to work to get code this unformatted, considering all editors today at the very least auto-indent for you. VisualStudio will even indent pasted code that originally had a different indent properly. And one of my bigger pet peeves is with extraneous blank lines. A single blank line in logical places to call out sections of code is very appropriate. I use a lot of them in my own code. But in that first code snippet there’s no consistency in the way blank lines are used, and I count at least 8 lines that have no purpose existing. Worse, some of those are consecutive.
Are we really becoming to lazy to bother making our code look professional, instead of looking like it was mashed out on a keyboard by a monkey with 3 missing fingers?
Disclaimer: I don’t mean to pick on the author of that CodeProject article. I’ve not read the article yet, and it may be of high quality, ignoring this glaring issue.