6 ms·
There's also the comments that tell you why the code does something obviously stupid but needs to continue replicating this stupid behavior because something el
by steveBK123 2y ago
There's also the comments that tell you why the code does something obviously stupid but needs to continue replicating this stupid behavior because something else depends on it behaving this way.
- paulryanrogers 2y agoThis is the way :mando: If it's not answering why or at least providing a very concise how to very verbose code, then it's just adding noise
- saurik 2y agoThat sounds like "explain[ing] why the code isn't written in another way" where the other way is "the way you are right now thinking it should be as you read this: the way that isn't obviously stupid".
- steveBK123 2y agoI'm thinking less in "way the code is written" and more "the way the code works". That is things like cases it doesn't support, or weird results in some cases. One example is a shop I worked many years ago that had a function which did time conversion on date times without adjusting the date portion. Obviously, objectively, wrong. However the callers to this function expected this errant behavior. Actually changing it to behave correctly would require a coordinated change. Putting that comment in place prevents a new hire from going "oh this is obviously wrong!" and fixing it, causing an outage.