Why I use perl and still hate dynamic language weenies too

Comments

Massively disappointed eh? We all have off days, and my initial response to the original "What's wrong with Ruby" post wasn't exactly my finest moment.

If you're massively disappointed with me for switching languages, you're on shakier ground I think. The switch had absolutely nothing to do with the communities around the respective languages and everything to do with the fact I was fed up with unrolling @_ every time I wrote a method. Once Perl 6 gets usable...
Yes, we all have off days - perhaps 'massively disappointed' was overly descending into rhetoric on my part, perhaps not, but it's worth remembering that comments to stuff like this are recorded for all time and will shape people's perception of your community - and it appears all dynamic language communities to those who don't understand just how different the perl, python and ruby groups are (though barring the small-minded people who -only- seem to have 'off days' I love all three for different reasons).

As I said, I rather doubted you'd switched languages for anything but technical reasons - I'm glad to have it confirmed though.

Unrolling @_? Do people still do that?

use Moose;
use MooseX::Sub::Arguments;

sub foo {
use args q($x, ArrayRef @z, Str $y?);
...
}
Sure, that's hyperbole again since the module isn't released yet, and sure, the implementation involves a little bit of source mangling trickery - but I still consider perl5 sufficiently flexible to be worth fixing these sorts of niggles rather than jumping ship. That's just me though; I'm happy to agree to disagree with anybody who's switched and is happier with $other_language because really, if we're going to have a technical holy war I'd rather it was something sufficiently silly like vi vs. emacs that we could do it over a beer.

Thanks very much for making the effort to reply and for doing so in a reasoned fashion. Now all we have to do is convince everybody else to do the same thing ... :)
It's not a permanent jump; I'm in the Ruby 'til 6 club. I may be a founder member.

I'd probably be back doing Perl now if I hadn't ended up maintaining Typo.

Unrolling @_ is the soundbite version of why I switched. In general I got fed up of the amount of hoopage that was involved in writing the kind of interfaces I wanted to provide. For all its faults (lack of 'my' declarations and the very silly scoping rules that flow from that, for starters) Ruby has some very nice stuff going on with its objects all the way down approach. However, it turns out that for all the posturing of the "Only ruby can do this because..." crowd, the language isn't as malleable as Perl in some respects. (It does have continuations though, so it's more malleable in others).

Ruby doesn't have CPAN though. And it doesn't have anything nearly as good as Date::Time. Unless Rael and co are working on a port at Stikkit...

I figured it was the soundbite version - the thing is the perl5 tools are getting better and better, and the flexibility of the object model especially with Moose added into the mix is an absolute win for me. Plus common ruby practice seems to involve stuffing methods into other people's classes and a fair bit of use of method_missing, which smells like a (less retarded but still dangerous) AUTOLOAD equivalent to me.

I dunno, I actually quite like ruby on the whole, it gets a fair few things right perl got wrong, but it strikes me as easier to get those things back into perl than it does to get the things ruby missed into ruby (no MI in an 'OO language'? what?) - showing off use args was meant as a soundbite version of that, really :)
There's nowt wrong with shoving methods into other people's classes. Take a look at a Smalltalk image some time, all those message protocols in Object (and other places) that look like *packagename contain methods put there by 'someone else'. Smalltalk doesn't do MI either. It was where Larry got Roles (called Traits in Smalltalk and only implemented by default in Squeak I think) from though. Frankly, when I'm programming in Perl, Perl doesn't do MI either.

Same goes for for method_missing; it's been used to create some very handy interfaces (the Perlish practice of installing the generated method into the the package so you don't go through the lookup/generate phase multiple times doesn't seem to have taken root in Ruby yet though). If method missing lets me write 'User.find_by_login('bob')' instead of 'User.find(:first, :conditions => {:name => 'bob'})' then I'm all for it.

But you're right about the way the state of the Perl 5 art as moved on. The chief thing keeping me here is the Typo maintainer hat I'm wearing. I'm not leaving that project until the code's in a state I'm not embarrassed by. Plus, there's all sorts of interesting problems to solve. The great thing about CPAN is, you don't have to reinvent the wheel. But, as we all know, reinventing wheels is fun and instructive. It seems like it's more fun and instructive to do it in a language that doesn't already have a particular wheel.

Do I get extra points for keeping that metaphor, ahem, rolling for as long as I did?
There's nowt wrong with shoving methods into other people's classes. Take a look at a Smalltalk image some time ...

Saying that Smalltalk does such and such is in no way an argument that such and such is a good thing to do - such and such could be the thing that Smalltalk got wrong.
Yes, but when you look at what the capability is used to implement (and, because message selectors get sorted into protocols in Smalltalk it's not all that hard to find out what behaviour's being added and what it's doing), you start to realise that it's a good thing. Static methods manipulating objects as if they were data structures is a much worse code smell than sticking a method on Object (or wherever).

Matt's making the case for Moose, a replacement for the Perl object system that could not have been implemented if Perl didn't have such an open runtime structure. Larry's deliberately leaving open classes in Perl 6; you can't declare that a class is closed, you can only declare that you promise not to monkey with any classes (you don't have to make the declaration straight away of course, you can leave it 'til after you've finished your monkey business.)

With so many of these things it's not the capability itself that's bad, it's the of the bad uses people put it to. Similar arguments can be made for banning guns, dvd recorders, microphones (just listen to a random sampling of podcasts), computers, cars... Before you accept any of those arguments, you have to turn it round and look at the good things those same technologies have enabled (the microphone's still looking like a really bad idea. Hell, it's the enabling techology of the music industry, which Must Be Stopped).

[this is good]
I enjoyed your post. It wasn't too long ago that I was a big fan of technology-as-religion. What can I say? I'm easily swept up by the latest shiny thing. C++, then Perl, then Python, then Ruby, then ...

A couple of years ago, something snapped. I'm not sure what it was. Maybe it was the flood of Rails fans invading the regular Ruby channels. I thought that Rails had some good ideas, but all the rabid love for it was taking the spotlight away from a lot of other great Ruby projects. Now, when I mention Ruby in casual conversation, there is always somebody who only associates it with the Ruby on Rails project. And when I dismiss Rails in casual conversation with a group of Ruby hackers, there is always somebody who reacts as if I had spoken heresy.

Then the clouds opened, a warm enlightening glow suffused my being, and I realized in a sudden burst of enlightenment about Ruby:

It's just a tool to write programs. And so were all the languages that came before. So are all the languages that will come later.

Actually, the real words in that momentary satori were a little stronger than what I put, but I opted for self-censoring on this public forum.

Since then, I haven't been able to get emotionally invested in any language at all. I use and enjoy several languages, including Ruby and Perl. The only favorite I have right now is Python, and only in the sense that it's my favorite language to teach with. Even that is only because I haven't figured out how to communicate other languages to novices in a clear way.

Thanks again for posting your thoughts.
well said Matt. Both about pragmatism, and the uselessness of religious wars. More power to your chainsaw.

Post a comment

Already a Vox member? Sign in

mst

About Me

mst
United Kingdom

Neighborhood

Explore friends, family, friends & family, or entire neighborhood.

Archives