3 ms·
The main question for me is what the half life is for code I write. In c, with no dependencies, and -Werror disabled, it is likely decades. In python with lot
by hedora 6y ago
The main question for me is what the half life is for code I write. In c, with no dependencies, and -Werror disabled, it is likely decades. In python with lots of dependencies, it is probably weeks or months.
Where does rust with lots of dependencies (since that seems to be what cargo encourages) sit on the spectrum?
- gameswithgo 6y agoI believe 100% of Rust code written since 1.0 should still work today.
- steveklabnik 6y agoWe have fixed some soundness holes that means some broken code accepted by older compilers will not compile today. There also have been some type inference changes that technically could break some code. While we are allowed to break things in this way, we want it to feel as if it were literally 100%, so we often will do things like “warn instead of fail to compile for a very long time” before making changes, or “discover that an inference change breaks the ecosystem too much so back it out until it won’t anymore.”
- glandium 6y agoThere's also a category of breakages that happen when libstd adds methods to types or traits. You get a unstable-name-collision warning for a while and then your code breaks. I'm not looking forward for code using Itertools::intersperse to break.
- Waterluvian 6y agoI think this is true for Javascript and as a result old code still runs. I think that's great. But there's also an absolute minefield of bad features that don't get deprecated. Not that that's not addressable with tooling or feature limiting version flags.
- smt88 6y agoYou are mistaken. Dozens[1] of JavaScript features and APIs are deprecated (they will be removed) or obsolete (they have already been removed). 1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- Waterluvian 6y agoInteresting thanks. I knew there were deprecated features you're discouraged from using but I wasn't aware of the ones that were removed. So if ECMA (or whoever now?) is okay with theoretically breaking some websites maybe thru should clean up more things like "with" and double equals.
- aidenn0 6y agoSee my sibling comment, but I'd really like a replacement for "with" before it goes away completely.
- gameswithgo 6y agoRust will deprecate bad features with their edition system, but the compiler will still support the old editions.
- aidenn0 6y agoHaving worked on something that emits JS, I appreciate this. We finally got around to making things work with strict a few years ago, and still run into bugs because losing "with" was so painful -- we used it to introduce a new scope without changing the scope that "return" will return from; javascript could really use a named return construct. We can fake it with exceptions but it makes the generated code very hard to read.
- reificator 6y agoI'd bet that 90% of Javascript code probably still runs today, but that's only because I think that so much JS has been written in recent years compared to the early years. If you take the average codebase from, let's say 2006, I would honestly put down money that under 25% would still run to this day. While most churn that people complain about on the frontend now is "optional" churn, the first two decades were full of breakage. Not only are there wide swaths of APIs that have been rightly removed, there are even keywords that have been deprecated and aren't available in strict mode.
- smt88 6y agoIn languages with static analysis, there is often a false tradeoff between long-lived code and security. For Python (and JavaScript and most modern languages), security updates are mixed up with API changes. In some cases, security updates require breaking old code. If the language has great static analysis, you get a handy guide of everywhere your code needs to change. For example, I have a C# code base that's now 5 years old and has survived through several major C# and .NET updates, and it was never more than 2-3 hours of work to just click and fix the compiler errors (JetBrains automates a lot of it, too). Rust sounds like it has that benefit as well. The compiler is so good that broken code is easy to find and fix.
- wk_end 6y agoAs someone who's last gig was working on a 10-15 year old Python hell-base, I sure do wish half of the code died every few "weeks or months".
- pansa2 6y ago> In c, with no dependencies, and -Werror disabled, it is likely decades. How might C code like this eventually fail, assuming future C standards remain backwards-compatible? Perhaps because C code is likely to contain (currently benign) undefined behaviour, which future compilers may take advantage of?
- ender341341 6y agoThey've removed `gets` from the standard library, though I don't know if any common implementations have actually removed it. I'd say there are at least a couple other landmines that could be removed but I have a much harder time seeing those actually getting killed off.