|
|
|
|
|
by nijave
1737 days ago
|
|
The problem comes not with what the code does but why the code exists in the first place. The only time I ever feel the need to leave comments is to explain code that doesn't appear to be needed or isn't obvious why it exists. Usually this comes from agreed upon technical debt, short notice requirements with tight deadlines, or some other form of tradeoff. "We're doing a simple check and throwing an exception here since we have work to introduce a more comprehensive permission system in xyz epic" or something like "There's a complicated race condition in xyz so we're doing a simple sleep here since the proper fix involves introducing a distributed lock" Sure those types of things are cases you want to avoid but unfortunately you occasionally end up there anyway and leaving a short explanation about a compromise is better than ambiguous code that appears to serve no purpose |
|