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

1. Comments should be subject for tests (for example: https://docs.python.org/2/library/doctest.html)

2. They should describe the purpose of the code in general not the quirks in the code

3. The exception rule is when the code can't be self-explanatory. Hacks are undesirable, but in real life you have implement them sometimes anyway - then comments are necessary

4. Docstrings in everything are wrong, the code itself is a documentation.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: