Hacker News new | past | comments | ask | show | jobs | submit login

Exactly this. Don't litter your code with comments, use them when they make sense. For example, if you're doing something "against the grain" but have a good reason: leave a comment explaining why.



I quite liked the previous article we had "Comments are apologies" or something. HN seemed to rail against it overall, but it makes sense to me. It's sort of "Sorry, but this has to be this way because API <x> does thing <y>". Or "This is a bit convoluted, but necessary because the naive way is too slow." That doesn't have to be the literal text of the comments, but that's the sort of mindset they should be written in, imo.




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

Search: