News for hackers. Stuff that matters.
Re:Why I Use Perl: Testing by rcthompson on Tuesday August 14, 2012 @03:45AM (#4379843)
One real gem from this article: "The collective test suite of the CPAN is the continuous integration test suite of the Perl 5 language itself."

All the tests written for all the Perl modules on CPAN are effectively also tests for Perl itself, because when a new Perl snapshot causes any test in any CPAN distribution to break, the Perl maintainers are automatically notified so they can fix it. That's pretty cool by itself, but it also speaks to the attitude that if a change in Perl 5 core breaks a test, by default this is a bug in Perl 5 core that must be fixed.

It's interesting that by taking this seemingly limiting attitude ("don't break working code"), you gain the ability to treat all the tests for code written in your language as tests for your language.

Do any other languages have something like this?

Re:Why I Use Perl: Testing by rauljara on Tuesday August 14, 2012 @08:20AM (#4380503)
This is a really cool concept. And no, I don't know of any other languages that have something like this -- but I'm not convinced it's actually a good thing. Promising to never break old code means that your language can never really fix old mistakes. The only way you can evolve your syntax is by adding more, never changing or taking away ideas that turned out to not be very good. But, at the same time, not breaking old code is really nice, and something that has probably helped to keep perl relatively popular.

One solution I like a lot actually comes from a terrible language. The Stata statistics package has its own language, that is awful. But at the top of each file, you can specify the version of the language that you are writing in. If the version isn't specified, it uses the most recent interpreter; otherwise it uses the interpreter specified by the version. It allows the syntax to evolve without ever breaking backwards compatibility. Newer versions can call functions[1] written in older versions, so they still have to maintain backwards compatibility of the virtual machine. But aside from that, they could completely rework the syntax and no old code would break.

From a programmer's perspective, it's a fairly elegant solution to handle different versions.

--edited a few times for clarity

[1] Stata doesn't really have a way to make user defined functions. Instead, they're called programs, which should give you some hint as to Stata's awfulness.

Re:Why I Use Perl: Testing by nnutter on Tuesday August 14, 2012 @09:12AM (#4380702)
Perl does something similar, see the [feature] keyword.

[feature]: http://perldoc.perl.org/feature.html

Re:Why I Use Perl: Testing by sigzero on Tuesday August 14, 2012 @09:55AM (#4380891)
They don't promise to "never" break old code. There is a big discussion about cleaning up Perl going on (and getting funded by The Perl Foundation) I believe.