News for hackers. Stuff that matters.
Re:Filesystem devs should aim to make “badly written” app co... by eyelidlessness on Saturday November 30, 2019 @11:54PM (#21673928)
I agree completely don't do magic, keep it clean and simple. I disagree with leave the thing you replaced commented. It's not just that you can find it "in the repo", it's that things drift over time. Prose comments have that reputation but code in comments that isn't being maintained drift even further. No one even has any intention of maintaining commented code except if it happens to hit find and replace, and even then good luck.
Re:Filesystem devs should aim to make “badly written” app co... by zer00eyz on Sunday December 01, 2019 @12:21AM (#21673988)
> 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.

Re:Filesystem devs should aim to make “badly written” app co... by eyelidlessness on Sunday December 01, 2019 @12:31AM (#21674018)
> 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.

Re:Filesystem devs should aim to make “badly written” app co... by eyelidlessness on Sunday December 01, 2019 @12:36AM (#21674036)
To 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.
Re:Filesystem devs should aim to make “badly written” app co... by zer00eyz on Sunday December 01, 2019 @01:43AM (#21674219)
I like this approach, it would cover 80-90% of the cases where it would provide value!