Skip to content

Comment on Comment your damn code

Comments

"Every 3 to 7 lines of code you'll find some amount of editorializing. Maybe every few hundred lines you'll find a good joke too."

I think there's the issue. In applications I write, every 3-7 lines of code is refactored into a method that is named exactly what it does, and every few hundred lines of code (usually much less) is in a separate file and class named on what he does. Broken out like that, there's not many places to put a comment that would be of any use.

But not broken out like that, of course you're going to need comments. But I think you'll find that comments aren't even enough.

"I know what the code says. But tell me the intent."

I think unit tests and expressive code work much better to achieve this goal.

Yes excactly!!!

AboutSource Built by g1lg1l

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