DEV Community

Discussion on: Top 10 Coding Principles Every Developer Must Know

Collapse
 
hagerst profile image
hagerst

I'm sorry but point 7 is rubbish. The comments will get of sync very quickly. You should add comments only if the code is unclear and to state why you are doing something a certain way. Good clean code should need very few comments

Collapse
 
mylesftop profile image
Myles

I agree. A lot of the suggestions are good, but comments are a reference that isn't checked at compile-time, so it takes manual review to keep them correct.

If you're following the other guidelines (e.g. SRP, KISS, YAGNI), then you should only need a few well-placed comments on the bits of code that need to be sophisticated - and if you need to comment basic features of the language, that's something that needs addressing with learning, not code changes.