News for hackers. Stuff that matters.
Re:Why I Use Perl: Reliability by staunch on Tuesday May 29, 2012 @03:20PM (#4039224)
Any language would be improved if it had Perl's testing and library culture. Two things it's absolute unsurpassed at so far.
Re:Why I Use Perl: Reliability by Goladus on Tuesday May 29, 2012 @08:56PM (#4040817)
I once had a large CPAN dependency install fail because one of the modules' tests included an http request to a 3rd party website which happened to be down that day. I wanted to strangle that developer when I finally tracked down the error (it wasn't failing with an obvious error that would let me easily recognize what was happening, I had to read the code itself). That is going a bit too far with the testing, I think.

And though I admit the culture is great overall, that does seem to be my experience with CPAN. You never know what you're going to get. It's like that to some degree with every language but with CPAN there's so much trust in the system it can be harder to identify and filter out the lesser quality stuff.

Re:Why I Use Perl: Reliability by shaggyfrog on Tuesday May 29, 2012 @09:00PM (#4040828)
Definitely sounds like a bad test. Unless there's a specific reason for the test to have an external dependency like that, the test harness could always bring up the (HTTP) service locally before it runs.
Re:Why I Use Perl: Reliability by cytzol on Wednesday May 30, 2012 @03:37AM (#4041821)
IIRC, the correct protocol with network testing is to prompt the user first that it's going to connect to another host, so they can skip the tests if there's something wrong with their network (or the site on the other end).

The other way to do it is to start an HTTP server locally and use that (which is what WWW::Mechanize does)

Re:Why I Use Perl: Reliability by jleader on Thursday May 31, 2012 @01:54PM (#4049365)
Prompting the user seems like a bad thing for an automated test to do!

The whole point of automating tests is so you can run them unattended: at install time, or under a continuous integration system after code check-ins, or for git pickaxe to find which change caused a bug, or whenever else you want to confirm that a whole lot of code still works as intended.

Re:Why I Use Perl: Reliability by adrianhoward on Wednesday May 30, 2012 @04:46AM (#4041961)
That is going a bit too far with the testing, I think

Agreed :-)

And though I admit the culture is great overall, that does seem to be my experience with CPAN. You never know what you're going to get. It's like that to some degree with every language but with CPAN there's so much trust in the system it can be harder to identify and filter out the lesser quality stuff.

There are lots of nice tools that help with that though. https://metacpan.org/, http://cpantesters.org/, http://cpanratings.perl.org/, etc.

Re:Why I Use Perl: Reliability by edwinnathaniel on Tuesday May 29, 2012 @05:24PM (#4040012)
Not even Java? With large Maven repository for pretty much almost everything under the sun?
Re:Why I Use Perl: Reliability by ryeguy on Tuesday May 29, 2012 @05:12PM (#4039939)
Does ruby not have the same level of both?
Re:Why I Use Perl: Reliability by adrianhoward on Tuesday May 29, 2012 @05:22PM (#4040005)
Short answer - no.

CPAN has had many more years than Ruby's Gems to mature and develop.

There are 2560 [edit: I was wrong. 39411 is the right number] gems on http://rubygems.org/. There are 24,920 distributions on CPAN. Well over 100k modules. The automated testing infrastructure, documentation, etc. also makes it much easier to figure out what modules work on what systems and what versions of perl than in ruby land. Things like meta.cpan.org and cpantesters.org are a god send that I wish I had when I'm using other languages.

And the testing infrastructure rocks.

It's evolved so everything produces and consumes TAP (http://testanything.org/) a simple human-readable protocol for expressing pass/fail results (with standard modules that help people output and consume TAP).

This means I can write tests procedurally, or in an xUnit style, or a BDD style, or a specification-based testing style, or use various DSLs for things like exception testing or for testing web apps... and so on.

I just use the style that seems most appropriate for the thing being tested. They all output TAP. All the standard test runners consume TAP. Everything "just works" and plays nice together.

I can even easily integrate tests running in other languages or environments as long as they output TAP.

In addition - since almost all of the Perl testing modules use a common TAP output module - you can usually integrate different styles in the same test code. So, if appropriate, I can pop some specification-based tests and some friendly web-testing DSL as assertions inside my xUnit tests.

Fun :-)

Wish other languages test environments were setup this way.

Re:Why I Use Perl: Reliability by jcmhn on Tuesday May 29, 2012 @06:10PM (#4040258)
The thing that is really awesome about the testing environment is that is makes it immediately obvious when a module on cpan has been abandoned.

That makes it easy to use a cpan module with confidence, which imo is not valued highly enough in other language communities cpan-like structures.

Re:Why I Use Perl: Reliability by noste on Tuesday May 29, 2012 @05:55PM (#4040181)
According to rubygems.org stats page[1], there are 39411 gems available. I think the number 2560 on "all gems" page[2] is the number of gems starting with letter "a".

1. http://rubygems.org/stats

2. http://rubygems.org/gems?letter=A

Re:Why I Use Perl: Reliability by adrianhoward on Tuesday May 29, 2012 @06:22PM (#4040304)
You're quite correct. My apologies.

I misunderstood the 39411 number to be the total number of gems submitted over all time, rather than the total number of extant versions. My bad.

Re:Why I Use Perl: Reliability by bgilroy26 on Tuesday May 29, 2012 @07:03PM (#4040454)
Don't worry, it happens all the time [1].

http://news.ycombinator.com/item?id=3238544

Re:Why I Use Perl: Reliability by vog on Wednesday May 30, 2012 @04:46AM (#4041962)
Ironically, this is the same issue of sloppy testing, just at another level (i.e. missing usability tests on the http://rubygems.org/gems website for at least months, maybe years)
Re:Why I Use Perl: Reliability by JonnieCache on Tuesday May 29, 2012 @07:54PM (#4040620)
wrt testing, ruby is getting there with http://travis-ci.org

Also the rspec ecosystem is becoming more and more mix-and-match.

It's nowhere near as integrated as perl yet though.

Re:Why I Use Perl: Reliability by pjscott on Wednesday May 30, 2012 @12:27AM (#4041380)
Travis-CI also works for a bunch of other languages, so if you're a library maintainer, it's definitely worth checking out:

http://about.travis-ci.org/docs/user/getting-started/

Re:Why I Use Perl: Reliability by zalew on Wednesday May 30, 2012 @04:21AM (#4041908)
It will be amazing when it supports any repo path. Now it's just a github utility.
Re:Why I Use Perl: Reliability by zentrus on Tuesday May 29, 2012 @07:42PM (#4040579)
Check this site out for a comparison of the various module counts per language. It is really incredible that rubygems surpassed CPAN last year and continues to grow at a very rapid rate. Quality may be another matter, but still, impressive.

http://www.modulecounts.com/

Re:Why I Use Perl: Reliability by jonathansizz on Wednesday May 30, 2012 @01:16AM (#4041486)
Except that there's over 107,000 Perl modules on CPAN, and fewer than 40,000 Ruby gems.
Re:Why I Use Perl: Reliability by adrianhoward on Wednesday May 30, 2012 @04:42AM (#4041954)
That's not comparing like with like. Gems are the equivalent of CPAN distributions.
Re:Why I Use Perl: Reliability by adrianhoward on Tuesday May 29, 2012 @08:09PM (#4040679)
Nice site. Well found.

I find it interesting that PHP doesn't have anything in the same league as Perl/Ruby/Python even after all these years.

Any PHP folk out there?

Re:Why I Use Perl: Reliability by pwaring on Wednesday May 30, 2012 @06:25AM (#4042182)
The closest PHP has to CPAN is PEAR (http://pear.php.net). It stalled for a long time, although development seems to have picked up a bit now that everything is on GitHub (https://github.com/pear/)
Re:Why I Use Perl: Reliability by milano on Wednesday May 30, 2012 @12:00AM (#4041313)
Composer (with http://packagist.org/) is getting popular in the PHP world.
Re:Why I Use Perl: Reliability by Aethaeryn on Tuesday May 29, 2012 @10:57PM (#4041161)
They're missing a few languages. For instance, Quicklisp.[1]

[1] http://www.quicklisp.org/beta/