3 ms·
> x = 4 // assign 4 to x Ah, the chat gpt style of comments. > Instead do something like: The only negative is that there is a chance the comment become
by dsego 1y ago
> x = 4 // assign 4 to x
Ah, the chat gpt style of comments.
> Instead do something like:
The only negative is that there is a chance the comment becomes stale and not in sync with the code. Other coders should be careful to update the comment if they touch the code.
- Buttons840 1y agoIf the what becomes stale, you can tell. If the why becomes stale (and it can become stale), you'll never know, unless the what is also included.
- marcosdumay 1y agoThe reason you want people to document the "why" is because you can easily check if one reason has become stale, but you can never check if every single possible reason is still valid.
- fcantournet 1y agoThe why becoming stale is a feature, that's when you know there is a VALID reason you thought this looked weird and convoluted, instead of you completely missing the inherent complexity of the problem.