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

I took over leadership of a project where the previous CTO was a "code should be self documenting" proponent and enforced a comment limit with a precommit hook. I think I made some of the developers cry when I asked why there were so few comments.


even worse, I worked on a project where you were not allowed to have comments in code, but if you really felt a need to explain something, you could put it in the projects readme.md, referencing the file and line number and why you did what you did.

Talk about a bone-headed outcome of claiming 'we don't allow comments in our code' mentality.


OMG. I fell afoul of commenting AND coding "standards" when I used Duff's device in an embedded system and my comment was something like.

/* Using Duff's device see <reference> for speed and code size */

The poor developer assigned to replace it with "better code" had an impossible task because they couldn't find anything to replace it that wasn't either much slower or much bigger.




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

Search: