6 ms·
Any language would be improved if it had Perl's testing and library culture. Two things it's absolute unsurpassed at so far.
by staunch 14y ago
Any language would be improved if it had Perl's testing and library culture. Two things it's absolute unsurpassed at so far.
- ryeguy 14y agoDoes ruby not have the same level of both?
- adrianhoward 14y agoShort 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/ 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/ 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.
- noste 14y agoAccording 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 http://rubygems.org/stats 2. http://rubygems.org/gems?letter=A http://rubygems.org/gems?letter=A
- adrianhoward 14y agoYou'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.
- bgilroy26 14y agoDon't worry, it happens all the time [1]. http://news.ycombinator.com/item?id=3238544 http://news.ycombinator.com/item?id=3238544
- vog 14y agoIronically, this is the same issue of sloppy testing, just at another level (i.e. missing usability tests on the http://rubygems.org/gems http://rubygems.org/gems website for at least months, maybe years)
- jcmhn 14y agoThe 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.
- JonnieCache 14y agowrt testing, ruby is getting there with http://travis-ci.org 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.
- pjscott 14y agoTravis-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/ http://about.travis-ci.org/docs/user/getting-started/
- zalew 14y agoIt will be amazing when it supports any repo path. Now it's just a github utility.
- zentrus 14y agoCheck 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/ http://www.modulecounts.com/
- adrianhoward 14y agoNice 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?
- milano 14y agoComposer (with http://packagist.org/ http://packagist.org/) is getting popular in the PHP world.
- pwaring 14y agoThe closest PHP has to CPAN is PEAR (http://pear.php.net 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/ https://github.com/pear/)
- Aethaeryn 14y agoThey're missing a few languages. For instance, Quicklisp.[1] [1] http://www.quicklisp.org/beta/ http://www.quicklisp.org/beta/
- jonathansizz 14y agoExcept that there's over 107,000 Perl modules on CPAN, and fewer than 40,000 Ruby gems.
- adrianhoward 14y agoThat's not comparing like with like. Gems are the equivalent of CPAN distributions.
- edwinnathaniel 14y agoNot even Java? With large Maven repository for pretty much almost everything under the sun?
- Goladus 14y agoI 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.
- shaggyfrog 14y agoDefinitely 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.
- cytzol 14y agoIIRC, 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)
- jleader 14y agoPrompting 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.
- adrianhoward 14y agoThat 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/ https://metacpan.org/, http://cpantesters.org/ http://cpantesters.org/, http://cpanratings.perl.org/ http://cpanratings.perl.org/, etc.