Get the latest tech news

Maybe comments should explain 'what' (2017)


People say “Comments should explain why, not what.” I feel like starting a flame war today so I’m going to argue that comments should explain ‘what’ too. Please don’t use this as justification to write bad code, okay? Okay. First of all, why shouldn’t comments explain ‘what’? If you need comments to explain what’s going on, it suggests your code is unclear. If I write //weight, radius, price w = 10, r = 9, p = 1 That’s not as clear as saying

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of comments

comments

Photo of Explain

Explain

Related news:

News photo

Why do people leave comments on OpenBenches?

News photo

Comments on "Glauert's optimum rotor disk revisited"

News photo

White House AI czar Sacks says ‘no federal bailout for AI’ after OpenAI CFO’s comments