Slashdot Mirror


Programming Things I Wish I Knew Earlier

theodp writes "Raw intellect ain't always all it's cracked up to be, advises Ted Dziuba in his introduction to Programming Things I Wish I Knew Earlier, so don't be too stubborn to learn the things that can save you from the headaches of over-engineering. Here's some sample how-to-avoid-over-complicating-things advice: 'If Linux can do it, you shouldn't. Don't use Hadoop MapReduce until you have a solid reason why xargs won't solve your problem. Don't implement your own lockservice when Linux's advisory file locking works just fine. Don't do image processing work with PIL unless you have proven that command-line ImageMagick won't do the job. Modern Linux distributions are capable of a lot, and most hard problems are already solved for you. You just need to know where to look.' Any cautionary tips you'd like to share from your own experience?"

9 of 590 comments (clear)

  1. Re:Comment your code by Anonymous Coward · · Score: 5, Funny

    Put enough comments in your code so that five years from now you (and others) can remember what you indented the code to do

    I indented the code to make it readable. That's so obvious I don't need a comment to remind me.

  2. Re:Comment your code by DMiax · · Score: 5, Funny

    Put enough comments in your code so that five years from now you (and others) can remember what you indented the code to do.

    I know, Python right?

  3. Re:Comment your code by Korin43 · · Score: 4, Funny

    I don't know. I prefer to comment, just in case:

    while 1:
            # Indentation
            dosomething()

  4. Re:Comment your code by TeknoHog · · Score: 5, Funny

    Put enough comments in your code so that five years from now you (and others) can remember what you indented the code to do

    I indented the code to make it readable. That's so obvious I don't need a comment to remind me.

    (pun indented)

    --
    Escher was the first MC and Giger invented the HR department.
  5. Re:Comment your code by nacturation · · Score: 4, Funny

    dead comments mislead the person following later into believing a lie a lie that could potentially have major impacts on the software.

    // the following code delivers cake to the subject

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  6. Re:Lesson #8 by danieltdp · · Score: 4, Funny

    The reason are two fold:

    1) The amount of morons *always* exceeds the amount of experienced and reasonable people

    2) Usually, morons don't have a clue that they... well... are morons!

    I for one can assure you that I'm NOT a moron :-)

    --
    -- dnl
  7. Re:Comment your code by gringer · · Score: 5, Funny

    // the following code delivers cake to the subject

    // the above comment explains the joke

    == changelog ==
    * removed redundant comments

    --
    Ask me about repetitive DNA
  8. Re:One more tip by dbIII · · Score: 4, Funny

    C# is already .NET, there has never been any other version.

    Java :)

  9. Re:Comment your code by IICV · · Score: 4, Funny

    Is there a reason your haystack is a list and not a binary tree?

    Clearly, this is why you need comments! Haystacks aren't lists - they're heaps.