Skip to content

Comment on Comment your damn code

Comments

I prefer tests over comments.

Comments can't guarantee to represent what the codes does always. "Don't be lazy" is a fine argument, but it takes one time that you are under pressure to ship right away and you don't comment. Tests, on the other hand will keep failing until they describe the updated version of the code.

We should strive to make code obvious, when it's not obvious, then you should comment, or better: simplify your code.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.