3 ms·
Rust solves this kind of thing using "editions" that ensure some features are available, and disable deprecated features. Perl goes super far in this direction
by jitl 5y ago
Rust solves this kind of thing using "editions" that ensure some features are available, and disable deprecated features. Perl goes super far in this direction with user-defined pragmas (https://perldoc.perl.org/perlpragma https://perldoc.perl.org/perlpragma). Javascript something like this in `"use strict"`. But the standards bodies have ben against adding more of these, or gating new features behind them. The issue always comes down to, how would you choose what features to eliminate? Some, like `var`, can be turned off, no problem. But others like `.forEach` are more debatable. I like forEach, it doesn't seem like legacy to me to have both functional and imperative loops.
Another language that has continuously accreted language changes is C++, and I've really struggled to learn it for that reason. It's so hard to find a "how to do it right" kind of guidepost for C++. Like modern JS, there's so many build systems to pick before you even get started...