Coffeehouse Post

Single Post Permalink

View Thread: The hardest part about programming is...
  • User profile image

    , Bass wrote

    Comments are often used as a crutch for sloppy code. Comments can also and often lie, they are ignored by the compiler and thus can say anything no matter how incorrect. Code can not lie. It does what it says.

    Clean code shouldn't need comments. The only time you should use comments is if your code is doing something extremely strange and you couldn't figure out any clean way of doing it.

    I'll bet the guy who wrote the 10 year old C++ code I am debugging for memory leaks thought it was obvious what he was thinking, when he wrote it.  Alas, no documentation *at all*.  A whole load of low level memory manipulation to fit into one can only presume was 640K of memory ... <sigh>.