Remix.run Logo
coffeebeqn 4 days ago

I also do that but I’d argue that business rules/quirks count as a “why”

bostik 4 days ago | parent | next [-]

While I agree, I think that's still incomplete. To me good comments have always been about "what is being done AND why".

Or to put it another way: to provide the necessary context for figuring out why a particular piece of code is written the way it's done. (Or what it's supposed to do.)

mashally 4 days ago | parent | prev | next [-]

I agree with that as well, the "why" explains the business logic and that makes much more sense to me. Otherwise, I might end up explaining the algorithm (the "what") instead of the business behind it.

gbin 4 days ago | parent | prev | next [-]

I agree it is about "what the code is technically doing" vs why which is "what external factor you need to understand to read this"

troupo 4 days ago | parent | prev [-]

They are often a "why" in the form of "what the hell" :)