3 ms·
This sounds right on the edge of the traditional situation in rewrites where everyone says how awful the old code is, so they rewrite it, but then the new code
by yjftsjthsd-h 5y ago
This sounds right on the edge of the traditional situation in rewrites where everyone says how awful the old code is, so they rewrite it, but then the new code doesn't handle edge cases (doesn't run on AIX/Illumos/NetBSD, yes(1) turns out to be really slow without that weirdness[0], file semantics have really weird edge cases that you only find after losing data), so the new code is adjusted to actually be as comprehensive as the original, at which point the new code is as ugly as the original. Of course, it depends on why the old code was ugly; if, as suggested below, some of it was being intentionally obtuse to avoid claims of copying, there might be room for actual improvement, and we do have more perspective and better tooling and new algorithms - real improvement is 100% possible, I would just be very cautious in assuming that based on an incomplete comparison.
[0] https://news.ycombinator.com/item?id=14542938 https://news.ycombinator.com/item?id=14542938
- shakow 5y ago> doesn't run on AIX/Illumos/NetBSD These OSs distribute their own coreutils. > yes(1) turns out to be really slow without that weirdness[0] I'm not sure there is a workflow where yes writing slower than 10.2GB/s is the bottleneck. Being able to go so fast is a nifty engineering feat, but hardly a necessity IMHO.
- Spivak 5y agoYes but scripts are written assuming GNU coreutils behavior and this makes them easier to port. No reason they shouldn’t work everywhere. I think a nontrivial portion of Mac users on HN probably use the GNU utilities on macOS.
- rodgerd 5y ago> No reason they shouldn’t work everywhere. No reason except the complexity of maintaining huge amounts of code to support dead processors and operating systems, or ones that are so rare that they might as well be dead.
- KptMarchewa 5y agoMacs generally use BSD tools when possible because Apple won't put GPLv3 code on their OS.
- WalterGR 5y agoInstalling the GNU versions is as easy as brew install coreutils etc., which I suspect is sort of what Spivak was referring to, and not that MacOS ships with them.
- brundolf 5y ago> file semantics have really weird edge cases that you only find after losing data), so the new code is adjusted to actually be as comprehensive as the original, at which point the new code is as ugly as the original I think the GP was getting at the fact that Rust/rustc handles many of these edge cases at the language/compiler/standard-library level, instead of at the application level. Which would mean, at least in theory, the new code would actually not have to be as ugly as the original in many cases.