Monday, May 11, 2009

Groovy/Grails versus Perl continued

I've had some critical feedback about my previous post, where I compared a lot of programming languages with the Groovy/Grails combination and claimed G/G was the clear winner.

It struck a particular nerve with Perl people, who claimed I had omitted some important developments in their language in the past years. (I hope the PHP people won't find out what I wrote about their language or I'll have to go find my asbestos suit).

Before I go into the details of that discussion, first a brief remark about C#.Net. One of the commenters pointed out that I hadn't really demonstrated G/G's superiority there, merely used some tricks of logical reasoning. While I wouldn't want to discount logic, I have to admit that carey was right. .Net is a very broad platform, and there are some situations where Grails and Groovy cannot replace it. One example is that .Net can be used to make Windows DLLs. Of course no sensible G/G developer would want to make Windows DLLs anyway, but still.

Then Perl. Some people claimed I really needed to take a look at Moose and Mouse, two OO extensions for Perl 5 that can complement/replace the default Perl 5 OO abilities. I said previously that Perl 'lacks elegant OO' and I still stand by that remark. Three different OO subsystems? In one language? It's certainly an accomplishment, but in my view not a positive one. Think of all the subtle errors and maintenance issues that can be created when those subsystems are mixed in a single program.

Others claimed I should have said something about Catalyst. Catalyst is a web framework for Perl that is vaguely Ruby on Rails-like. At first glance it looks good - with a solid set of features on offer. An immense set of features. In facts the developers have managed to support practically every single Perl technology known to man. All kinds of persistence libraries. A broad selection of view/templating modules. No wonder that users complain of its complicated syntax. Like with the three OO frameworks, it shows that developers couldn't agree, couldn't make up their mind on what they really wanted. So instead they added everything in and hoped for the best. In Perl it's even an official language philosophy (There's more than one way to do it, aka Tim Toady). Java also suffers from this 'feature creep', with frameworks such as Spring and AppFuse, that try to support so many different ways of doing things that they lose sight of what developers want: simplicity and productivity.

So - how do I say this tactfully to Perl fans? You're sitting on a cooling body guys. A quickly cooling body. And instead of simply running away you're trying to cover up the evidence, waving Perl's arms and saying: 'see, it still moves!'.

To make real progress sometimes you have to select only the best parts of what you have, and jettison the rest. Groovy and Grails have done that for Java and its jungle of web frameworks. I hope Perl 6 will do the same for Perl, soon.

Update: please see here for Chromatic's well-written response. It's obvious that we don't agree 100% but I hope the combination of viewpoints makes for an interesting read.

5 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. "Some people claimed I really needed to take a look at Moose and Mouse, two OO extensions for Perl 5 that can complement/replace the default Perl 5 OO abilities."

    Neither system "replaces" anything, they enhance Perl's existing OO system. You can use a Moose class like any other Perl class (including subclassing it, if you want). Moose understands plain Perl classes for the purposes of delegation or subclassing. So really, there is no incompatibility or replacement going on, just *enhancement* that gives more information to things that need it (making possible the MooseX:: community of extensions).

    (It's worth noting that Mouse is an experimental system that the author wrote to help himself understand writing OO systems. It ended up being faster than Moose, because it has fewer features. Some people can live with less features for a shorter application startup time, so they use Mouse instead of Moose. But this is just a few people -- 99% of the Perl programmers I know today use Moose exclusively.)


    "Like with the three OO frameworks, it shows that developers couldn't agree, couldn't make up their mind on what they really wanted."

    This is just not true. We chose to make Catalyst easily extensible, and the wider community took advantage of that extensibility to put it to many uses. Do I really need to explain how this is a Good Thing?

    Anyway, the common theme here is "There's More Than One Way To Do It". It's Perl's motto, and it's true. Perl lets you do things the way you want to -- the result is that there are a lot of ways to do something. If you don't like that, you probably shouldn't use Perl. But of course, you can just pretend that the More Ways don't exist, and then you will have a language that can do everything your way... and still do that when you change your mind about what that one way is.

    Finally, your cooling body analogy is cute, but completely meaningless. Just because something sounds good doesn't mean you should write it.

    ReplyDelete
  4. You seem to only want a single IDE, a single (and particular) web framework, a single OO framework... Well, that maybe fine for you, but others might not agree.

    And believe me, there will be different "bests" for different situations. How about people who are stuck with cheap/easy webhosting with nothing but PHP/MySQL? How about non-web projects, how about coding on platforms that don't have Java?

    The fact that Perl, Java, and open source in general provide many alternatives on many levels should not be considered a minus but a plus. The best parts will emerge eventually by natural selection and not by the choice of a single person.

    ReplyDelete
  5. Personally, I try to avoid making sweeping statements about other languages and communities, lest it reflect back on my community.

    ReplyDelete