Slashdot Mirror


Defining Useful Coding Practices?

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."

4 of 477 comments (clear)

  1. Stop reading the code, stupid! by Anonymous Coward · · Score: 1, Funny

    Works for congress.

  2. Re:Soem of the complaints aren't valid by Chees0rz · · 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

    (I had to add a space... /. got mad at my long string...)

  3. Re:Soem of the complaints aren't valid by lukas84 · · Score: 5, Funny

    There are better ways to give advice than insulting the person while you do it.

    But giving advice without insults is called consulting and costs money.

  4. Re:Lowest Common Denominator by dcam · · Score: 3, 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.

    --
    meh