Skip to content

Comment on Keep your source code SIMPLEparent

Comments

Comment the why, not the what.

It's good to comment the what too if it's hard to discern what it's doing from the code.

There have been a number of cases where, for instance, I had to call a bizarrely named API and do something unexpected in order to get an unintuitive outcome and in that case a "what" comment isn't such a bad idea.

Comment the intentions and motivations for behavior.

AboutSource Built by g1lg1l

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