DEV Community

Cover image for Should Perl die gracefully?
Mark Gardner
Mark Gardner

Posted on • Originally published at phoenixtrap.com on

Should Perl die gracefully?

A comment on the Medium version of last week’s article got to me:

I wish they’d just leave Perl static. Then we wouldn’t have to waste money retesting legacy Perl apps on the newest version every couple of years, in case new features we don’t want breaks code that’s been unchanged for years. […] Sometimes things should just be left to die gracefully.

William Smith

Programming languages, like all software, change to meet new challenges. Developers add new feature enhancements, users find bugs for them to fix, and occasional design errors need to be corrected. In Perl’s case, the Perl 5 Porters (the group of volunteers that develop and maintain Perl) have had an explicit backward compatibility and deprecation policy since 2011 that tries to protect the Perl user community from the breakage of old code while still moving the language forward. In short, they do their absolute best to minimize your testing and changes.

To that end, the Perl developers have done an amazing job presenting new syntactical features as only enabled when adding the appropriate use feature or use VERSION construct. If you do not add this code, the new syntax will not be enabled and your legacy code will not break. Incompatible changes, if there are any, are always documented in a release’s perldelta document (hint: it’s under the heading “Incompatible Changes”).

Given all this, it is a monstrous thing to demand an entire volunteer community stop enhancing their platform so that your particular applications can remain static while continuing to take advantage of the support policy generously offered for recent releases. If you need an unchanging platform, don’t upgrade it—and take all the responsibility that implies, such as the backporting of security fixes beyond the three-year support commitment offered (again, gratis) by Perl’s developers.

You have no right to demand Perl stands still and “dies gracefully” any more than anyone has the right to demand that of you.

Top comments (7)

Collapse
 
thibaultduponchelle profile image
Tib

Your last sentence sounds a bit harsh 😃

His comment sounds like a non-sense to me, how could you blame Perl for compatibility? Especially compared to almost all other programming languages.

Perl is impressive by how stable and backward compatible it is. You can find a more than 10 years old perl script (even a bad one) and it will probably run without any problem on a perl interpreter installed on your system (whatever its version). At worst you would have a very small edit but nothing painful.

All the optional features sets introduced by the core team are not damaging this.

We even have some partial forward compatibility where some features can be retrofitted to old version of perl via modules. For instance, try/catch is added to perl 5.34.0 and is available for previous perl thanks to Feature::Compat::Try module.

This is mad 😀

Collapse
 
mjgardner profile image
Mark Gardner

Sorry, I get a bit impassioned when my livelihood is besmirched.

Collapse
 
tja1980 profile image
Tristan Addie

Id be amazed if a perl application had time to mature to legacy status in this day an age, with code reuse policies, rewrites/refreshes as part of contracts being renegotiated, perlbrew, peer review, change controls there's just so much control in change management it's hard for things to be missed if they break with new or old features.

Collapse
 
raigaurav profile image
Gaurav Rai • Edited

The person who complained about compatibility in Perl has no idea what he is talking about. Its ironic that the language mentioned by that guy in Medium article breaks the compatibility even in the minor versions. 😁

However there is a good question which comes out of it. How much backward compatibility matter ? I know Perl has put a lot of focus on backward compatibility. But the rise and popularity of Python prove that backward compatibility is not a big deal. 😬
Even though version 2 and 3 are quite different and they break the compatibility within minor version also, people doesn't jump the ship and migrate to other languages. They just migrated from 2 to 3 or will be migrating in future( or maybe not).

Perl feature guard are awesome thing ☺️. But I am yet to find a production code in corporate environment using that. I found that people are not in habit of using it(or unware of it).

Collapse
 
tanami profile image
Tanami

someone sent this to me but they had gleaned the opposite meaning of the post, lol (I guess they didn't actually read it)

Collapse
 
mjgardner profile image
Mark Gardner

People only read headlines on the Internet? Shocking.

Collapse
 
tanami profile image
Tanami

well what I mean is that people are probably not reading this article and taking it as "oh, Perl is dying"