2 ms·
> code in comments that isn't being maintained drift even further. This is also true of "its in the repo" and that doesn't get hit by "find and replace". I do
by zer00eyz 7y ago
> code in comments that isn't being maintained drift even further.
This is also true of "its in the repo" and that doesn't get hit by "find and replace".
I don't think it should be done for EVERY case, rather the cases where clarity is replaced with something that is ambiguous but meets another need. Performance hacks are notorious for being "ugly" and "magical" and having a readable companion piece would make sense.
To clarify I don't think it replaces "prose" but should exist along side it, and be mixed into it.
- eyelidlessness 7y ago> This is also true of "its in the repo" and that doesn't get hit by "find and replace". It's very much not! The thing "in the repo" is of exactly the same vintage as the thing in the next commit. The thing "in the comments" is preserved in amber next to a growing thing that no longer matches it. Inevitably to understand the thing "in the comments" you have to go back to commits of the same age.
- eyelidlessness 7y agoTo add to my earlier response: if I needed to achieve the performance critical cleverness required solution and felt it needed a human readable code sidekick, I would include both as real running code alongside each other, both of which running the same set of tests, and both of which required to be run by whatever CI/automated tests are used by the project. Comments are for humans to read, not machines.
- zer00eyz 7y agoI like this approach, it would cover 80-90% of the cases where it would provide value!