Remix.run Logo
tangotaylor 4 days ago

“What” comments can be quite nice to quickly parse through code.

But I don’t think they’re worth it. My issue with “what” comments is they’re brittle and can easily go out of sync with the code they’re describing. There’s no automation like type checking or unit tests that can enforce that comments stay accurate to the code they describe. Maybe LLMs can check this but in my experience they miss a lot of things.

When “what” comments go out of sync with the code, they spread misinformation and confusion. This is worse than no comments at all so I don’t think they’re worth it.

“Why” comments tend to be more stable and orthogonal to the implementation.