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

That kind of code doesn't explain all the different ways of accomplishing the piece's goal you tried and why they were lacking.

Some random developer comes at a later time, thinks this code is more complicated than required, refactors it and only then sees why you didn't do it that way. This happened to me many times (both in the "original dev" role and the "random future dev" one).

Comments can easily clarify why this particular piece of work is implemented in this manner and not the others you tried, saving a lot of time to the future devs.



I don't think you disagree with the article here. Most code should be straightforward and no comment of the sort you describe is necessary.




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

Search: