Cold Hard Code

Moose for haters.

I'd like to have a little article about Moose for haters.  Why?  Well, because Perl people are prolific people.  They talk a lot, and it's good stuff.  But haters don't want to listen to that.  Here goes.  It's not perfect, and not even accurate.  It's accurate enough, but this is for the haters.  If you're a perl hacker, go read gphat's slides.

What is Moose?  Moose is a syntactically different object system.  What that means in real term is simple; It makes Perl better, by basically making all those snide remarks people make completely irrelevant.

First off, It's not just syntactic sugar.  That's what is immediately apparent, but there is a lot more to Moose- and if you are using Moose for the syntactic sugar, just drop Perl altogether and go back to PHP.   We (or the Python camp) will see you in a few years when you mature as a developer.

The syntactic sugar Moose offers is great, and shouldn't be discounted as it makes Perl less ugly and more readable1.  Moose's real power is evident when you just sit down and work with it a bit, build a program or two and discover the  API into class definitions (going meta).

Just take a minute and think about this.  You can define and manipulate information about the definitions of your class.  The meta-object.  Total crackpottery, right?.  Huge applications are built in C++ and Java, and they don't have a meta-object protocol.  That just means they're inferior.  People talk about Lisp, and how you can do a lot with very little code.  The problem is that all Lisp developers are just a little short of insane.  Perl developers aren't insane, they just can't market themselves or their products.  Moose brings in the aspects of Lisp that make it so damned easy to be amazingly productive, without requiring you to be crazy to use it.

This API into the meta-stuff is what makes Moose classes so easy, and easy to understand.  You don't have to learn Lisp to get it.  I don't know Lisp, and I use Moose extensively.  I also am not a CS guru, and can use git extensively.

If you don't know what Roles are, or have at least been briefed on the discussions about Roles and Inheritance, you probably need to read up on that just to get an idea of what's being talked about.  Otherwise, you have two choices.

The first choice is to start using Moose, listen to all the really smart people, and love it and constantly say, "Wow, my code just works and works well."

Or, continue to ignore Moose, and write bad code in whatever language you use.

However much hype Ruby and Rails get, it's because of one thing and one thing alone - Marketing.  It amuses me to no end to hear about how developers hate marketing, then jump on whatever fanboy bandwagon creaks past them. 

As for all those who call Perl "line noise", it's obvious they don't know Perl and are just repeating something that originated in marketing.

And yeah, I'm a hater, too.  At least I know it.


[1]
I don't actually think Perl is ugly or unreadable.  That's probably because my code doesn't suck.
jshirley

Written by Jay Shirley

Jay Shirley combines technical fundamentals with modern, practical savvy. An open source veteran with plenty of notches in his personal and professional belt, the combination of his work and his field vision (soccer metaphor!) has few rivals.

Comments