Ruby, “Hyper-Enthusiasm”, and Happiness

by Austin Ziegler

Bruce Eckel really doesn’t like Ruby. I don’t know why he doesn’t; I know he’s explained it in the past. Yes, there’s a lot of enthusiasm around Ruby and Ruby on Rails lately: this group blog has certainly been created because of this enthusiasm. But the enthusiasts and the detractors both distract from the larger reality that there’s never going to be a single programming language that is best suited for all projects.

The problem is that some people—this includes some Rubyists—who think that Ruby is in a language war with Python (or Java or...) and that “there can be only one.” Unlike Highlander, this isn’t a zero-sum game. While the Rails crew can be extremely enthusiastic about Rails and Ruby, few of them pretend that Rails is a silver bullet for every problem. Rails is a targeted application framework that takes advantage of—and perhaps even extends—the opinionated and expressive nature of Ruby.

As I work on PDF::Writer, I freely admit that its origin came from the R&OS cPDF library written in gasp! PHP. I’ve taken it far beyond cPDF, and I have looked at Perl’s PDF::API2, Python’s ReportLab, Java’s iText (and the C# port iTextSharp), and will be looking at CL-PDF for Common Lisp (if anyone has other open source libraries that are worth studying, please let me know) as I formulate both the implementation and the API of PDF::Writer and its future companion projects (PDF::Core and PDF::Reader).

I believe that I work smarter in Ruby than in any other language I’ve used so far, and it makes me happy. That doesn’t mean that everyone will work smarter in Ruby or that it will make them happy. I personally don’t want Bruce to use Ruby—why would you use something that doesn’t make you happy? If Ruby didn’t exist, I would be a bitter Python developer. There are things about the Python language (whitespace scoping) and the Python community (there’s only one “right” way to do it) that made me turn away from Python as soon as I saw that there was a viable alternative (modulo libraries, of course, but that also meant that I was able to jump right in and start offering libraries to the community). Would Bruce want me to be part of the Python community if I were bitter about Python’s warts? Somehow, I doubt it.

I think that the strength of the Ruby community is that it (mostly) recognises that it isn’t a zero-sum game. We’ve been around the block, most of us, and don’t think that there’s a single answer. We just know what makes us happy right now.

7 Comments

Mike
2005-12-20 16:54:39
The distinctions between different languages may not be merely matters of taste - this idea seems a (diplomatic) cop-out to me. Granted, each has largely the same capabilities, and each has a handful of unique tools. So which language to use could feasibly rely on the nature of the computing you're trying to do. Still, there are philosophical and procedural strategies that can prevent bugs, reduce the time needed to understand an algorithm, and so forth. These revelations are the reason that this community, who by and large are intimately familiar with a lot of languages, have adopted Ruby and formed a peculiar emotional attachment to it.


I don't know a thing about Python, and I'm convinced by the idea that the aptitudes and prejudices of some programmers make them more effective in Python than they would be in Ruby. But I am suggesting that they conscientiously forget the prejudices and let the aptitudes take the wheel. And of course the same goes for trash talk about whitespace etc - Ruby has nothing to gain from being used for applications that would be built faster in Python. And precisely the same argument is true of operating systems. Forget the prejudice and buy an Intel Mac asap.

Austin Ziegler
2005-12-20 18:40:20
No, it isn’t just a matter of taste. There is a Ruby Way of doing things, just as there’s a Python way and a Java way. Matz, I think, understands this as much or more than either Larry or Guido, because his stated goal is to make Ruby developers happy and more productive by giving us a different way to think.


I know what would make me unhappy, and Bruce apparently understands what would make him unhappy. It means that he won’t use Ruby and I won’t use Python. And we’ll both be happier for it.

Ilya
2005-12-21 01:55:47
Great article, Austin!
Great words - "use language what make you happy", the reason is to be happy, rather programming on specific language. And to be respectful to other languages, and not force other to the only language, if this make other unhappy.
Lion Kimbro
2005-12-21 14:54:20
What's infuriating as a Python programmer, is seeing Ruby programmers convince new people: "Look what you can do with Ruby!..."


...and it's invariably, something that we in Python have been doing for several years.


The one complain Rubitistas have against Python, is that you have to indent your code. And of every complainer, there's been someone who's... ...indenting their code.


Ah well. You can't win them all. I guess Python was just "ahead of it's time," by like a handful of years. I guess you had to catch the tail end of Java, that's all.


If we're going to do a "next Python" or something; Do something really innovative, like automatic interface adaption, or including Semantic Web stuff as a basic language feature, or whatever. Something *new* and *different.*


We Pythonistas are basically just sour grapes. We've had our girl stolen from us, and with no real difference between us and the other guy. He was just at the right place at the right time, I guess.


Looks like I have to learn Ruby now. (sigh.) At least it'll be easy to learn, since there's nothin' different there.

Austin
2005-12-21 15:12:27

What's infuriating as a Python programmer, is seeing Ruby programmers convince new people: "Look what you can do with Ruby!..."

...and it's invariably, something that we in Python have been doing for several years.


That’s neither completely true nor completely fair. There are definitely things that can be done in Ruby that are much easier to do than they are in Python. The same applies in reverse. (It is often incorrectly claimed that Ruby doesn’t have first-class functions. It does. They’re just not as easy to get to as Python’s.)


The one complain Rubitistas have against Python, is that you have to indent your code. And of every complainer, there's been someone who's... ...indenting their code.


Again, I think this is a common misconception. Few people in Ruby have an issue indenting their code, and generally do so. If you look at any of my code, it’s all indented. But I have a common debugging construct that works very well for me:


class Foo
def bar
# code here
puts tracer_statement
# code here
end
end


That construct simply won’t work in Python, because it breaks scope. Sure, I could learn something new, but I have used this particular tracer style for fifteen years, and I would curse Python every time this—or something like it—bit me. Indentation is good; I just don’t happen to think that indentation as scope is good. You may, and that is perfectly fine.


As I said, I don’t personally see that there will be a “winner” between Ruby and Python; I don’t see it as a zero-sum game. Most of the time, I enjoy reading Python code more than I do Perl code because the intent is much clearer. I just couldn’t stand programming in it myself. It wouldn’t make me happy. So why, if I’m mostly doing this stuff as a hobby (I do C++ in my paid job), would I do something that doesn’t make me happy?


If you decide to use Ruby, I hope you come to enjoy it, and enjoy where it is different than Python. There is definitely a different way of thinking about programming when one programs in Ruby or in Python. In Python, list comprehensions are so easy, they are used all the time to the exclusion of other things. In Ruby, closures and internal iterators are used all the time to the exclusion of other things. Neither is right or wrong for all projects.

Keith
2005-12-22 07:59:49
I am continually struck by how inane these language wars can get. When was the last time you passed a construction site and saw a carpenter with only one tool? There is no perfect, one size fits all, programming language, and there are good arguments that there should NOT be. I do paid work in everything from C to Ruby, picking the right language for the job. More than once, I've had to redo a project because the original developer used a language that was inappropriate to the task at hand. So if you want to stay employed, my advice would be to spend the time to learn new languages and where they will help you instead of wasting time whining about how the latest language is not as good as what you've been using.
Paddy3118
2005-12-27 03:41:26
Hmm, just read this after reading "A little anti-anti-hype" by Steve Yegge and this is so refreshing!


A happy New year Rubyists. Good wishes from this Pythoneer :-)