Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It says: > Any shortfall between what you can express in code and what you would like to express in total becomes a plausible candidate for a useful comment.

This is a good way of looking at it... as long as you remember that this shortfall is often gigantic, and usually includes why this approach is being used instead of other techniques (which may have been used and abandoned for good reason).

Code does not exist in a vacuum. You should write code not just to compile, but to be read by others. And many times, the actual code might be only 30% of the important stuff. A good project may very well be 2/3 comments, 1/3 code, because it should include the reasoning behind coding decisions, which is often quite complex, but crucial to understanding why the code is written as is, and to understanding how to properly extend it.

Without that kind of documentation, you're doing a tremendous disservice to future programmers who seek to maintain or add to the code -- or to yourself, often times, when you pick up code you wrote yourself two years ago.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: