On the Moose
24 Apr 2009I've been reading a lot about Moose lately, and I'm thinking it's about time I took it for a spin. The whole Perl world is all aflutter about it, so I'm sure everybody who's ever subscribed to a Perl-related blog has heard about it by now too. I haven't done a lot of coding in Perl recently, most of my stuff at work has been migrated to C# and most of the stuff I've been doing at home has been Parrot-related (C for the guts, PIR for the rest).
It's funny because I originally got into Parrot because of my overbrimming excitement for Perl 6. However, the more I got into Parrot, the less I seemed to be doing in Perl. Quite the irony!
I had been doing a lot of stuff at work with Perl, because it was quick and I could do great work with the database in a fraction of the time it took most other people to do. Then my boss decided that for the sake of standardization and interoperability that I should write my programs in the language that everybody else was using: Visual Basic.NET. Two words: "Hell No". The "upgrade" to VB.NET wasn't an upgrade at all and I basically hosted a little rebellion in order to switch to a language that felt less like building with legos and more like programming a computer. We argued for a good long while. It's amazing how vehement people were getting about wanting C++ instead of C#, especially when so many arguments in that direction were either baseless or blatantly false. Anyway, long story short I've been writing C# at work ever since, and I'm happy with it. I digress.
Prior to my C# work I've never really done a lot of OO programming. In school my work was all either assembly language, C, or MATLAB. Even though MATLAB is very high-level and has good OO support now, it was lousy in the OO arena back when I was in school. I took two courses in Java, one on basic "hello world" programming and one about datastructures+algorithms, but neither of those really dug into what it meant to be OO. I did a lot of my personal coding work in Perl 5, but let's face the fact that Perl 5's OO system is absolutely abysmal and I only ever wrote hideous Perl objects to avoid having to write hideous Exporter boilerplate everywhere and pollute my namespace. I also dabbled in Javascript, although I never really got into any of the OO features of that either, besides using classes as a way to separate unrelated stuff (also, I'm still not convinced that their implementation of classes is completely sane, but that's for a different post).
My work with C# has really taught me the value of OO (and it's also kindled an appreciation for strongly-typed languages). So I'm thinking to myself, what could be better then Perl 5 with a world-class OO system? Actually, the answer to that might just be "Perl 6 with a world-class OO system". So, as soon as I learn enough Moose to become functional with it, I want to start migrating some of my Perl 5 stuff to use it.
I'm looking for a good reference on the topic, preferrably a good book. I'm open to suggestions if anybody knows one, otherwise I'll pick up something from Amazon that looks like it has some decent non-computer-generated reviews.
This entry was originally posted on Blogger and was automatically converted. There may be some broken links and other errors due to the conversion. Please let me know about any serious problems.