in reply to My greatest coding sin is:

Spending too long trying to fix broken code rather than starting again from scratch.

Seven out of ten times when I start over I end up going back and fixing the original broken code anyway; but starting over from scratch, by removing the influence of the existing structure, variable names, comments etc., the realisation of what is wrong with the existing code often falls into place very quickly, where staring at the original code often leads one's brain down the same path that led to the original error in the first place.

And on the other three occasions, the new code comes together more quickly and cleanly because the second time around you've a clearer picture of what you need to achieve.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: My greatest coding sin is:
by hippo (Chancellor) on Jan 05, 2016 at 12:16 UTC
    the second time around you've a clearer picture of what you need to achieve.

    Undoubtedly. There's also the added benefit that you are coding to the spec as it stands now rather than to a bunch of feature-creeping incremental changes.

      Indeed. Which reminds me of one of my all-time-favourite software-development related quotes:

      Walking on water and developing software from a specification are easy if both are frozen. (Edward Berard)

        Walking on water and developing software from a specification are easy if both are frozen.

        Oh, Let it Go...