Defining Useful Coding Practices? 477
markmcb writes "A NASA engineer recently wrote about his disappointment that despite having well-documented coding practices, 'clever' solutions still made the code he has to maintain hard to follow. This got me thinking about the overhead spent at my own company regarding our code. We too have best practices that are documented, but most seem to focus on the basics, e.g., comments, modularity, etc. While those things are good, they don't directly ensure that quality, maintainable code is written. As the author points out, an elegant one-liner coupled with a comment from a few revisions ago makes for a good headache. I'm curious what experience others have had with this, and if you've seen manageable practices that ultimately offer a lot of value to the next programmer down the line who will have to maintain the code."
Stop reading the code, stupid! (Score:1, Funny)
Works for congress.
Re:Soem of the complaints aren't valid (Score:3, Funny)
(That said, I wouldn't embed a variable's acceptable value range into its name -- that should be taken care of with unit tests and assertions, and noted in comments or docs.)
You know somebody didn't make it this far in your comment and there is now a variable out there somewhere named averageClassGradeOfStudentsInMrsTwomblysClassIn PortlandHighSchoolZeroToOneHundredMaybeOne HundredAndTenIfTheyGotBonusPoints
/. got mad at my long string...)
(I had to add a space...
Re:Soem of the complaints aren't valid (Score:5, Funny)
But giving advice without insults is called consulting and costs money.
Re:Lowest Common Denominator (Score:4, Funny)
Five years, feh. I can't barely recognise the code I wrote 3 months ago.
I regularly look at some code and say, "who wrote this crap?". After checking the history I find it was me.