Hacker News new | ask | show | jobs
by nailer 2197 days ago
> When you have some "complex" technical code. Using natural language is sometimes the most effective way to explain what is done by the related code.

Totally agreed here. There's some code in underscore that recursively copies strings as a way of writing '' because it happens to be fast. You'd think it was really weird if it wasn't marked as a performance optimisation.

> When you deal with some business logic that can become weird at one point (process all these things in some ways, excepts these ones, weird edge cases, etc.). From a developer perspective, it does not always make sense, but it's always useful to have some background explaining why the code has been written in such way.

That's the 'why' addressed explicitly in the article.

> Also, I disagree with the facts that comments are born out lazyness. "Lazy" developers don't bother writing comments. Actually, there don't care, and most of them do not even realise that at some point in time, someone will have to browse, read and understand their code.

> The only kind of comments I've seen from such people are "commented code", because "it might be useful" (it never does).

It sounds like you largely agree with the article. Save comments for 'why', you want to eliminate meaningless comments.