Ruby Scares Me More Than Perl
June 9th, 2007 • Ruby
It seems that every time someone writes a Ruby library that uses class methods, symbols and hashes reasonably sensibly they get delusions of grandeur and call the result a Domain Specific Language (or maybe an ‘embedded’ DSL).
— Piers Cawley’s Just A Summary
What scares me most about Ruby is that its seemingly clean syntax can hide very ugly design artifacts, just as Perl’s seemingly ugly syntax makes it easy to cipher code. In reality, I think both languages can be equally unreadable.
Both Ruby and Perl expose their internals. In fact, they expose their internals so much that you can twist them, bend them, and practically create new languages without so much as a grunt; only each accomplishes this differently.
Ruby depends heavily on how its built-in objects behave. Like I said before, the language itself is very minimalistic, it defines a few rules to enhance (or modify) language capabilities1 and leaves the work to someone else. This means that if you override core object classes2 and mess up, your changes will proliferate through other people’s code, and end up biting back.
Maybe all DSLs are equal, but some DSLs–the ones that look exactly like Ruby code–are more equal than others.
From what I understand, the Ruby community likes making new APIs and DSLs, but they love modifying Ruby’s internals in the making. That’s not necessarily a bad thing, if it’s done by very disciplined developers (who should probably read Martin Fowler’s Internal DSL Style); though that’s not true in most cases.
Here’s what scares me most: Everyone’s still hyped about Rails. forgetting that Rails is following Perl’s path of failure. You heard me, Path of Failure.
Now don’t get me wrong, I have deep respect for 37signals, and their brilliant marketing. I believe that Rails’ success has little to do with its technical merits. But I’m not going to get apologetic on this one.
Perl failed on the Web not because it had a tough competitor, but because it was so damn difficult to be up and running in a relatively short time. It took an expert on FTP, CGI and Unix permissions to install programs like MoveableType, not to mention write programs like it. Every single application reinvented the wheel, be it session management, authentication, or simple things like templates. And that’s the path I feel Rails is following.
Ruby scares me more than Perl because its syntax hides the underlying mess, as opposed to simply uglify it. What’s more, Rails’ syntax wraps around the very same mess that Ruby hides. Without rigid documentation, you’re stuck with code that would look like fluid.
Unfortunately, even Ruby and Python (which “feel” simpler, syntactically) both also have very complicated grammars…
— Stevey’s Blog Rants, The Next Big Language
Though things like Markaby make me think twice.
2 Responses (Add Your Comment)
-
Rubysh Jun 28, 2007at 5:41pm
Can’t agree more! Ruby syntax is ugly. There are elegant samples of Ruby codes, like “20.minutes.ago”, etc. But when I read Ruby documentation and tutorials, I can see Ruby codes are so messy.