Commenting Codes: Yes or No? Blogpost Cover

Commenting Codes: Yes or No?

Recently went across an article written by Riyad Mamadov titled Don’t Waste Your Time Commenting Source Code. It kind of struck home. I’ve worked with lots of programmers who comment on their code like pros but the algorithms could be improved upon.

Of course, I’m not saying they should be flawless in algorithms, but I agree with Riyad that, I’d rather you spend more time improving your codes than to comment your codes.

I always feel that commenting on codes is nothing more than helping others learn from what you do. So, if you’re writing an open-source code, yeah, by all means, comment your heart out. But if you’re working on a customized project for production, I don’t see why you should bother commenting on how the code works, other than simple important notes like TODOs or the likes.

Also, if you’re thinking “What if I’m collaborating with someone? I should document codes to let him know right?”. My answer to you is, if you’re working with someone who has no idea what your code does, you have bigger problems than commenting.

Leave a comment:

Top