DEV Community

Discussion on: Clean code & programming principles – The ultimate beginner’s guide

Collapse
 
tilkinsc profile image
Cody Tilkins

What you are suggesting tends to make code bases more complicated with more steps. The problem translates into piecing together many different functions under many different hierarchies. It tends to prove that procedural programming is superior in that regard. Comments for everything is not necessary, but I've found you wonder if a specific function supports a feature. A good programmer with foresight makes comments for other users to understand edge cases as well as makes proper tests to prove that everything works.

Thread Thread
 
sargalias profile image
Spyros Argalias

Thanks for the reply. I agree with tests and I'm a big proponent of them :).

I also agree that if a comment would be useful and save someone a headache, it should be added. My point was only that comments should be the last resort compared to code that's obvious and sensible so it doesn't need comments.

I won't be adding it to the article for now because I don't see it as part of the fundamentals. More like a tip, that also needs the appropriate warning of only using comments as a last resort.

Having said that, I really appreciate that you took the time to make a suggestion. Thank you.

Some comments have been hidden by the post's author - find out more