Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?

Ask Slashdot: Do Coding Standards Make a Difference? 430

An anonymous reader writes "Every shop I've ever worked in has had a 'Coding Style' document that dictates things like camelCase vs underscored_names, placement of curly braces, tabs vs spaces, etc. As a result, I've lost hundreds of hours in code reviews because some pedant was more interested in picking nits over whitespace than actually reviewing my algorithms. Are there any documents or studies that show a net productivity gain for having these sorts of standards? If not, why do we have them? We live in the future, why don't our tools enforce these standards automagically?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Do Coding Standards Make a Difference?

Comments Filter:
  • by man_of_mr_e ( 217855 ) on Friday December 21, 2012 @03:48PM (#42363027)

    Coding standards were largely developed to prevent developers from reformatting each others code in a format war.

    Joe works on code, checks it in. Bill gets a task to work on that code, doesn't like Joe's formatting, so he reformats, checks that in.. Joe works on the code again, finds it's been reformatted, then he reformats it again.

    This is hell when doing diff's and figuring out what changes from version to version. Coding standards help to prevent that.

    Another reason for coding standards is to set a level playing field for everyone.

  • by Decameron81 ( 628548 ) on Friday December 21, 2012 @03:56PM (#42363115)

    THE reaSON WHy coDiNg standards_exist is thatTheyIncrease THE_REaDABILITY oF YOur cODe.

  • by Anonymous Coward on Friday December 21, 2012 @04:28PM (#42363539)

    I have a coding standard. The coding standard is,

    1. use tabs for indentation, spaces for alignment.
    2. put a space after a comma

    Basically, so shit is readable. There are coding standards for English too. That you put a space after punctuation and that you start a sentence with a capital. Yeah, people still fuck up grammar. They still write run-on sentences. They still can't spell.

    There is nothing special about code that hasn't already happened in regular languages. Having a simple, easy to follow coding standard is OK. Being over the top is a little unproductive but then it depends on the size of the project. There may be a different rigor when adhering to your workplace's coding standard vs. something like Linux kernel.

    So yes, coding standards make a difference if there is more than 1 developer involved.

panic: kernel trap (ignored)