TL;DR - I'm listing real-life situations such warnings would address. Mostly about how people behave and what they expect. Just to demonstrate how important and useful such warnings could be.
Jeremy Evans wrote:
I am against ruby emitting warnings just because it thinks there may be a newer ruby version available.
It's not about warning that e.g. Ruby 2.2.4 may be outdated, but that 2.1 will never get another bug fix (except for security).
A warning earlier is better than any "breakage" later. I agree warnings can be annoying. Then again, either people want important warnings (and this one important), or they can turn them off anyway with RUBY_OPT.
the solution is not to modify the interpreter, but to stand your ground and tell the users (...) to fork the library.
I agree about standing ground. It just is a huge emotional and time commitment to explain to every angry person one at a time. I probably just have to find better ways of explaining things.
Likewise, (...) you are free to fork the library and update it so that it only works on recent ruby releases.
That's true. I actually wish I'd done that earlier in some cases.
IMO, dropping support for previous ruby releases is just a cost-benefit calculation.
I agree. It's that the users complaining aren't usually making that calculation rationally. They don't assess the actual costs.
People with genuine needs ask for backports. (Which I don't mind). But they don't mindlessly upgrade every library expecting their Ruby to be supported, either. Upgrading anything is actually very dangerous in such situations.
Use cases for warnings:
-
Library maintainers with bad assumptions like "Ruby < 2.2 is still officially supported" or "Ruby doesn't follow SemVer" or "Ruby 2.2 is only 'recommended'" or "security fixes mean it's still supported" or "a Ruby version is part of a gem's API", etc. A Ruby warning helps explain that a broken Ci build is just a missing long-overdue Ruby upgrade. I'm happy to support urgent bugfixes being backported. I understand business needs. And people with those needs are usually very reasonable anyway, so they never complain anyway.
-
Users using vulnerable versions of Ruby who don't even know their version is vulnerable. To them, it's not just about new features or benefits - they simply get angry too if even their ancient Ruby 1.9.3 "no longer works". So what I don't have is some "official" statement explaining: "Ruby < 2.2 is not supported. Security patches are provided, but only as a last-resort measure. This means it is ok for developers to drop support for Ruby < 2.2, unless they have clients who's businesses need access to earlier versions while migrating. Migration should be straight-forward in most cases." It isn't like e.g. support for Ruby 1.9.3 was dropped suddenly yesterday.
-
The biggest danger is e.g. people building services with outdated+vulnerable Ruby versions from older virtual machine images/containers. I think this is more important than any "developer inconvenience" when working with already outdated Rubies. IMHO sticking to only supported Ruby versions actually shows professionalism in the Ruby community, even if it's "just" a warning.
-
Urgency. A warning (or deprecation) can be dismissed or turned off without taking any other action. Meanwhile, a sudden bug or misscommunicated version dependency causes a lot of stress and unplanned work. If I implement warnings/checking as part of my library, every "user affected" is an hour-long argument. Their reasoning is: "if Ruby isn't showing a warning, the library developer is just making things up and causing unnecessary problems".
-
Bugs in Ruby are the hardest to debug. They're just very time consuming if they occur. It's always the library that's suspect first, not an outdated Ruby version. So by staying up to date, professionals can avoid many hours wasted tracing "already-fixed-bugs" in their outdated Rubies.
-
"Complaint chain". Maintainers don't like users complaining so they prefer "everything to be supported". Same with developers - they don't like maintainers complaining. (But with a warning in Ruby, there's no "surprise"). This means everyone ends up using 1.8.7 until there's no other option but upgrading. (So it can take many years until developers can start using Ruby 2.3-only features without reimplmenting them also in "1.8.7-compatible" code).
-
Understanding versioning and dependencies takes advanced skills. Most users don't have those. (And it's why I don't blame those "angry" maintainers). It's more practical to show a warning than to expect developers to accurately declare versions without a single mistake. (It's very hard to test and there are no good tools to help, either). Upgrading Ruby simply helps solve those issues, because there's only "one version of Ruby supported at a time".
-
The whole idea of supporting "many interpreter versions" with one codebase is something exotic. E.g. you don't expect all unmodified Python 2.x sources to work on Python 3.x. Even today, you can see most projects "confused" about how to treat the existence of multiple Rubies: 1.9.3, 2.0, 2.1, 2.2, 2.3. That's already "5 versions" of Ruby to support. Some projects still insist on supporting 1.8.7. In a library codebase that looks ok. But to test it all, you need a build matrix 5^^X (X = factors to test on a single version). And that's not even counting patch-level versions of dependencies.
-
Having no more than "two official Rubies" helps everyone. And it's not "official" if "just" a library owner like me says so. It isn't "ok" to use Ruby < 2.2. It's a potentially dangerous business situation already. It's like driving a broken car. If life is tough, there may be no other choice. But if you don't know you're driving a broken car, a warning gives people a reason to upgrade before they complain about accidents they'll have later on.
-
Users rarely know about the benefits and gains. If they did, they'd upgrade sooner. (And they'red be less artificial demand for "backward-compatibility").
Changing the interpreter makes things easier to communicate. The earlier and more "official", the better.
So I believe having warnings like these would be an enourmous benefit to communicate good practices and understanding in the community.
(Which would allow more productive time spent improving and promoting Ruby).