CPAN once a week / month / day

CPANgamificationyak shaving Sat 1 March 2014

Like many CPAN authors, I'm hooked on CJM's CPAN once a week contest. Talking to BOOK yesterday, he wondered how hard it would be to create a clone, using CPAN::ReleaseHistory or BackPAN::Index. That sounded like a fun challenge (read: yak shave), so I said I'd timebox it, and try to produce a minimal clone in an hour...

I'm starting to think that BOOK is outsourcing his yak shaving to me...

Right off I decided to look for monthly, weekly and daily chains, only aiming to produce active chains in the hour. Having such a limited amount of time meant I gave myself permission to cut corners, and immediately decided to trade off memory usage against development- and run-time.

I knew that Date::Calc had a Week_of_Year() function and got hacking based on that. With 1 minute to spare I had a script that printed ASCII lists, with the top 10 for monthly, weekly and daily chains. But the weeks were running from Monday through Sunday (unlike CJM's contest, which runs from Sunday through Saturday). I had to switch to using %U with strftime(), which BOOK had been telling me to all along. I got confused about timezones for a while as well.

This evening I hacked it some more to produce the longest chains of all time, and to generate web pages, which you can see at:

And the code is on github:

Take a look at the monthly leaderboard: Dave Rolsky has been releasing to CPAN at least once a month for over 13 years. That's long-term sustained contribution to the Perl community. Most authors come and go, wax and wane, but the guys in that list were driving CPAN forward through the long dark tea-time of Perl 5.

Perl's whipupitude makes it perfect for this sort of time-boxed code slinging. The hour limit makes you focus on the end-goal and cut corners to get things done. It was great fun. Choose an idea for something small and give it a go.

BOOK and I have started talking about the idea of a whipupathon. Maybe something to try at the QA Hackathon...?

comments powered by Disqus