r/programming • • Aug 30 '08

Tour De Babel -- Rant about programming languages (at Amazon)

http://steve.yegge.googlepages.com/tour-de-babel
13 Upvotes

122 comments sorted by

12

u/LordVoldemort Aug 31 '08 edited Aug 31 '08

"They teach Scheme at MIT and Berkeley to new students"

I've heard that scheme is no longer taught in introductory courses at MIT.

12

u/DvorakUser Aug 31 '08

Holy crap, you're right. I had no idea.

Berkeley still does, though (and so does Caltech).

8

u/boa13 Aug 31 '08

Lots of things can change in four years.

4

u/hpr122i Aug 31 '08 edited Aug 31 '08

11

u/[deleted] Sep 02 '08 edited Sep 02 '08

Real engineers use Emacs. You have to be way smart to use it well, and it makes you incredibly powerful if you can master it. Go look over Paul Nordstrom's shoulder while he works sometime, if you don't believe me.

Sure I'll do just that. I'll quickly get up from my desk, buy a aeroplane ticket to another continent, book myself into a hotel, go to Google headquarters and ask politely if I can just look over the shoulder of one of their software engineers.

Why? I just want to confirm if Steve Yegge is right about something.

Who am I? Oh just an arbitrary software engineer looking to expand my skills.

Sure thing, they'll say, ask me to sit down (give me an espresso while a wait). Then a concierge will appear and escort me to Paul's office. He'll greet me politely and ask me to sit down and be quiet.

I'll look over his shoulder and watch him use macros that he built up over his career, shortcuts, settings, etc and I'll be all "like wow" in awe of his amazing skills. We'll exchange pleasantries during his tea break and talk about software, philosophy and life. We'll have a little chuckle about Steve Yegge's blog rants and share war stories. I'll tell him about my experiences building distributed applications and web services for small/medium corporates in a backwater country he's never heard of and he'll be all attentive and understanding and stuff.

During lunch we'll get personal and a bit teery over my son's birth and the time I spend away from my family pleasing the unappeasable.

After words we'll part with sombre faces and, hell, maybe even a hug, I'll travel back and tell all other software engineers I know about my experience and we'll all be warm and fuzzy like we've just watched "Its a wonderful life" with Jimmy Stewart.

Then I'll phone Microsoft and ask them to put me through to Steve Balmer. After some "Singing in the rain" Steve will pick up and ask me what he can do for me. I'll tell him that IDEs are "opium of the masses". He'll quickly put me through to Ray Ozzie, I'll explain the matter to him and we'll forge a plan for MS to phase out all Visual Studio applications from all MS platforms within 6 months (also dumping the .NET framework from all applications in existence probably within the next 18 months).

Then I'll go home and watch my wife watch "Desperate Housewives" while I flip through the latest issue of "Men's Health".

→ More replies (1)

11

u/13ren Aug 30 '08

I like his religious rant on emacs, and then had to retract part in footnote [2]. But he seems to have a fair handle on the issues in general.

Is Ruby as good as he says?

22

u/Leonidas_from_XIV Aug 31 '08

Ruby is in fact good, but as a Python programmer I think he overstates the problems with it. When you learn Ruby or Python you don't need to learn the other one because it gives you too less so that it weights out the experience that you already have in the first language.

That said, I don't see Ruby overtaking Python (it is getting used more and more in various application but also on .NET, the JVM etc.) but on the other hand, both Python and Ruby are overtaking Perl.

All three languages are currently in the overhaul phase, Perl 6, Ruby 2 and Python 3, but as far as Perl 6 remains vapourware and the Ruby 2 development seems to be chaotic (not to mention that 1.8.x releases seem to be not 100% compatible) Python is at least the winner here, by providing Python 3.0 plus an upgrade plan, a converter, one or even more compatibility releases etc.

So basically: use Ruby if you want to try it, use Python if you want to try that too. Best if you use both for some things, you'll find out what fits you best.

Yegge complains about whitespace in Python (which, combined with PEP8 does definitely solve some problems curly-brace languages have), but I have to admit, that I hate writing all the ends in Ruby, so it is a thing that you have to get comfortable with. And in the years since this article was published, the complaining about the whitespace is not as common anymore.

23

u/necrecious Aug 31 '08

His prediction of Ruby eating Python's lunch definitely didn't come true. I think Ruby has lost a little momentum due backlash against Rails and Ruby 2's development.

I like a lot of Python's libraries and the communities around those libraries, but I like Ruby's syntax and idioms better.

4

u/malcontent Aug 31 '08

I think Ruby has lost a little momentum due backlash against Rails and Ruby 2's development.

This "backlash" only exists on places like reddit.

2

u/[deleted] Aug 31 '08

Rails was the best and worst thing to happen to Ruby.

It was definitely the "killer app" that put Ruby on the map. Because it got popular, there are a lot of bad programmers writing a lot of crap in it. This has taken the bloom off the rose and Python has picked up some of the slack. It's not that big of a deal really... I'd rather have Python and Ruby successful than just one or the other.

2

u/Leonidas_from_XIV Aug 31 '08

So do I. If Rails would take over PHP's place, I'd be pleased. If Django would, thats also ok with me.

→ More replies (1)
→ More replies (2)

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

3

u/necrecious Aug 31 '08

That's why both languages are co-existing pretty nicely. There isn't huge hate between the two camps as you might expect.

6

u/drbold Aug 31 '08 edited Aug 31 '08

In my experience, people get over the whitespace-shock pretty quickly. I don't find it odd at all anymore, and coding is very comfortable and natural.

6

u/[deleted] Aug 31 '08

That's the same experience I had with Lisp. At first I was all "I can't get used to these parentheses!!!". After a while I don't even see them, I just see the lists they encompass.

5

u/Leonidas_from_XIV Aug 31 '08

Yes, with a decent editor you start actually liking the parentheses. I prefer the regularity of S-Expressions to the quirky syntax that some other languages use.

2

u/Psy-Kosh Aug 31 '08

Check the footnotes. Yegge said that he doesn't mind the whitespace, but he thinks that python didn't get as popular as it could have because some other programmers didn't like the whitespace thing.

→ More replies (3)

2

u/jamesbritt Sep 01 '08 edited Sep 01 '08

but I have to admit, that I hate writing all the ends in Ruby, so it is a thing that you have to get comfortable with.

In my experience, people get over the "end" shock pretty quickly. I don't find it odd at all anymore, and coding is very comfortable and natural.

1

u/mikkele Aug 31 '08

Whitespace and indent complaints are just stupid. Python merely forces you to do what you ought to do anyway, namely to keep your use of indent space/tab consistent.

8

u/akdas Aug 31 '08

To be fair, there are times when I indenting isn't so easy. Let's say someone posted a snippet of Python code online, but due it not being properly formatted, all continuous blocks of whitespace are rendered as a single space (this happens all the time in blog comments). I want to copy and paste the code, just try it out, and mess around with it a bit, but I can't because the formatting is messed up.

However, for almost all cases, I agree that Python's enforced whitespacing is not something to get worked up over.

→ More replies (25)

5

u/twotime Aug 31 '08

Life is more complicated than that.

Whitespace reqs in python do cause problems at several levels. Basically both humans and a lot of tools are sloppy with whitespace.

mailclients, webbrowsers/wikis may wrap your code.

diff -w is pretty much useless with python.

Cut'n'paste is complicated if different levels of indentation is involved..

etc

The only legit question: do advantages outweigh disadvantages (in most cases at least)?

IMHO the answer is yes, but disadvantages are still there all the same and you cann't just pretend that they don't exist..

→ More replies (1)

16

u/[deleted] Aug 31 '08 edited Aug 31 '08

His assertion that whitespace and "frost" (his term for a perceived coldness in Python culture) make Python inferior to Ruby make it hard to take his other assertions seriously.

In Python you have to enter more "self"s. In Ruby you have to enter more "end"s (rather than having whitespace interpretation figure that out for you). Neither are big deals.

12

u/shifty3 Aug 31 '08 edited Aug 31 '08

One thing about Python that annoys me are the builtin functions like len(), reduce(), map() etc. Why aren't these object methods? len() even calls __ len __(). Is this some legacy stuff?

Ruby is much more consistent in this regard, I especially like the convention of using an exclamation mark to denote destructive methods.

4

u/[deleted] Aug 31 '08 edited Aug 31 '08

At least len is a function

lambda x:len(x)
<function <lambda> at 0xb7d0ebfc>

ever been bitten by this one? I have :

lambda x:print(x)
  File "<stdin>", line 1
    lambda x:print(x)
                 ^
SyntaxError: invalid syntax 

5

u/ubernostrum Aug 31 '08

Meh. All languages have inconsistencies like this. Python's len() doesn't really bother me, personally (I like having a convenient polymorphic built-in for certain common operations), but if you see it as an abomination you don't have to use it (or Python).

1

u/Wavicle Aug 31 '08

but if you see it as an abomination you don't have to use it (or Python).

Ahh, there's the frost he was talking about.

5

u/Leonidas_from_XIV Aug 31 '08

If I'd complain about Ruby's ends and aliased names what would the Ruby community respond? "We'll remove them for you" or "You can just as well use something else"?

9

u/ubernostrum Aug 31 '08 edited Aug 31 '08

Um... OK. "If you don't like it, that's OK" is frost? "If you don't want to use it, you don't have to" is frost?

→ More replies (1)

3

u/mikkele Aug 31 '08

No, you get that with virtually every Open Source community: "If you don't like it, then by all means don't use it, or - even better - here's the source code, so now you fix it. Otherwise STFU".

5

u/[deleted] Aug 31 '08

You get that with every discipline. It's the delineation between business and community. For some reason, some people in computing take that difference as a philosophy. If you come into my house and rant at me about my choice of wallpaper STFU would be a legitimate response. If I was wallpapering your front room in exchange for your money I'll put whatever goddamn wallpaper up you like.

Here's one we have to post every six months or so :

"We don't want our editor to have colour syntax highlighting. We will never add that functionality. We don't feel like entering into a discussion on the merits, demerits or otherwise. It's just not happening. Feel free to add it yourself, you know where the source code is."

7

u/[deleted] Aug 31 '08

All three of those functions are built-ins because they operate on any object that looks like a sequence, including lists, tuples, generators, iterators, strings, and any user-defined object that can be iterated over. If I want to write a list-like object without inheriting from list, should I have to write stub map/reduce/len methods just in case someone wants to use them? Wouldn't it be smarter to implement these very generic functions as something that will work on any list-like object?

9

u/akdas Aug 31 '08

If I want to write a list-like object without inheriting from list, should I have to write stub map/reduce/len methods just in case someone wants to use them?

In Ruby, you don't have to inherit from Array to get a bunch of methods that operate on list-like objects for free by simply includeing the Enumerable module.

Wouldn't it be smarter to implement these very generic functions as something that will work on any list-like object?

Like Ruby's Enumerable.

I like Python, and I understand it has a different philosophy, but examples like this are why I prefer Ruby (once again, it's purely a personal preference).

Now if only Ruby's built-in file manipulation libraries were better.

5

u/ubernostrum Aug 31 '08 edited Aug 31 '08

Well.

From the Python perspective I like the fact that len() is a built-in that delegates to a double-underscore method. I like the fact that a lot of other functionality works that way, too, because it means I don't have to treat a bunch of otherwise-usable public identifiers as reserved because someone might interpret their presence as meaning that I'm implementing some API.

I also like the fact that Python deliberately sets off the names of the "special" methods so you know something different is going on.

And there's a certain sparseness that results from the Python approach which appeals to me; for example, Ruby's Enumerable includes at least four methods which simply consist of "return all the items in the collection which match/don't match some condition". As a Python programmer, I instinctively ask:

  • Why should I need to tie up so many names in my class just to do one thing, when filter() or a list comprehension would do just as well?
  • Why should I have to remember which methods take which arguments (some take regular expressions, some take blocks...) instead of having a unified interface that can behave intelligently?

Similarly, there are at least three methods in Enumerable which basically boil down to "execute this code once for each item"; again, why tie up so many names when I could just use map() or a comprehension? Why have multiple methods instead of a unified interface?

→ More replies (2)

2

u/twotime Aug 31 '08

I agree with you on map/reduce (they utilize a low-level property of objects (iterability)).

But len() is a somewhat different beast: is not it defined as

def len(x): return x.len()

and to support len() a class must define method len()?

So why not require every object to define method len() and get rid of len() builtin?

Is there any benefit to len(x) over x.len()?

(at the very least: x.len() removes an extra level of indirection)

E.g python does not have read() builtin (which just calls read method), instead you simply define a read()method when you need it

→ More replies (1)

9

u/jmhodges Aug 31 '08

I'm going to disagree with Leonidas and say that "[w]hen you learn Ruby or Python you don't need to learn the other one" is a false statement. I came to ruby from python thinking ruby was just another python. I was very, very wrong.

8

u/[deleted] Aug 31 '08

As a former Python programmer, what stuff in Ruby wins you over? I take it it's not just a syntax preference.

12

u/martincmartin Aug 31 '08

As someone who has used both (and also contributed to Groovy), I think the biggest difference is that Ruby has real anonymous functions, that can have an arbitrary number of statements/expressions in them. It makes dealing with any sort of collection much easier. Python's list comprehensions seem timid in comparison: they can only do "collect" and "grep," with single expressions, and the syntax for combining them is different than the rest of the language.

In Ruby, you can write a function which takes a file name and an anonymous function as arguments, then opens the file, passes it to the anon function, then closes the file in a "finally" block. It's much nicer than having to have explicit finally blocks.

6

u/jmhodges Aug 31 '08

mcantelon, that ^ pretty much. It sounds weird, because it is weird when you first run into it. It's a bit different than passing functions around (even anonymous ones in functional languages) because the syntax to do this.. feels different.. cleaner. It's hard to explain, but when you see it and grok it, its a very nice way of seeing a problem in a simpler, easier to understand way.

Oh, and everything is an object and really, really an object and holy christ is it awesome not to have to pass self around everywhere. And modules rock.

I should note that I still like python. Ruby just has some things that are nifty that python doesn't.

5

u/ubernostrum Aug 31 '08 edited Aug 31 '08

Oh, and everything is an object and really, really an object

Just like Python, you mean?

Edit: and... what? I get downmodded for pointing out that the same is true in Python? Show me something in Python that isn't an object, then.

3

u/shen Aug 31 '08

I know that Python uses objects for everything, but the difference here is that Ruby consistently uses object-oriented syntax, while Python doesn't (list comprehensions, blocks instead of loops, a few sticking-out functions like len, for example).

→ More replies (3)
→ More replies (9)
→ More replies (1)

2

u/Tuna-Fish2 Aug 31 '08 edited Aug 31 '08

python 3:

with open("file.txt") as file: doSomething(file)

or locking:

with myLock: doSomething()

http://docs.python.org/dev/3.0/reference/compound_stmts.html#the-with-statement

→ More replies (6)

5

u/mikkele Aug 31 '08

I guess that what he meant was that either language will do nicely for most of the same tasks. Sure, Ruby has some features that Python does not have (and probably vice versa), but personal preferences aside, either language can be used for roughly the same purposes with roughly the same resulting quality and productivity.

So if you want to be a Ruby hacker, be a good Ruby hacker. Ditto for Python. Either way, it does not matter much these days.

1

u/thephotoman Aug 31 '08

That said, once you learn one, the other isn't too hard to learn. They both operate in essentially the same way, even if the syntax is different.

4

u/jmhodges Aug 31 '08

Oh, agreed, other than ruby's emphasis on blocks (plus the subtleties of lambdas vs. procs vs. blocks.. bleh)

8

u/stewdick Aug 31 '08

I personally like Ruby. However, the easiest thing to do is just to give it a shot: http://tryruby.hobix.com/

4

u/thephotoman Aug 31 '08

Forward: I'm a Python guy.

Ruby is awesome, just like he says. It's a bit sluggish (slower than Python, even), and I don't like the end keyword (personal preference there).

2

u/troelskn Aug 31 '08

I like his religious rant on emacs, and then had to retract part in footnote [2]. But he seems to have a fair handle on the issues in general.

Yeah, that was kind of funny. But it doesn't really detract from the point; vi and emacs are equal in being tools-of-choice for hackers.

Oh, and is it just me, or isn't he confusing Japanese with Chinese? To my knowledge, there are only about fifty or so characters in the Japanese alphabet.

3

u/necrecious Aug 31 '08

depending which writing system you are talking about. There is hiragana, katakana, kanji and romaji. Though he probably meant Kanji which has many characters but aren't an alphabet.

2

u/Niten Aug 31 '08 edited Aug 31 '08

Is Ruby as good as he says?

It's a wonderful language, but the library/module support is just not there yet, and the Ruby 1.8 interpreter has seriously crappy performance. I still use Perl for quite a lot; and where I've moved on from Perl, it has typically been to Python, not to Ruby.

4

u/turbov21 Aug 31 '08

In defense of Perl (1, 2, [3, 4]) is what he wants.

6

u/mackstann Aug 31 '08

I think he knew the syntax for list references. He was making a more fundamental point about their awkwardness.

1

u/abw Sep 01 '08

I don't think he did. I'm not convinced that he knows much about Perl past version 4.

Perl's OO is a halfhearted add-on that never caught on with the Perl community.

He clearly doesn't know much about the Perl community either.

That said, the article was enjoyable.

1

u/turbov21 Sep 02 '08

Well, the article was written in '04.

1

u/abw Sep 02 '08

Sure, but not much has changed since then. Perl 5 was already 10 years old in 2004 and OO had been well established in the Perl community since the late 90s. His 2004 opinion of Perl sounds like it's based on his mid-90s experience and he never quite brushed his skills up as far as OO or understanding the difference between () and [].

It's a good article, but just a shame that it contains misinformation about a language because he's 10 years out of date on it.

3

u/jsnx Aug 31 '08

This is what you get from people who reject static types...

2

u/Wavicle Aug 31 '08

Well, they're just like the Smalltalk folks, who waited forever to replace C++, and then Java came along and screwed them royally, and permanently. Oops. Ruby's doing exactly that to Python, right now, today. Practically overnight.

Ummm... [citation needed] or something.

Does anyone have any hard numbers to suggest Ruby is overtaking Python. I don't particularly have an obsessive dedication to one vs. the other but everywhere I look - except webapps - Python is having a huge uptake.

13

u/grimboy Aug 31 '08

Look at the date of the article.

9

u/mikkele Aug 31 '08

It's a prediction. It did not come true.

-4

u/stewdick Aug 31 '08

This is an amazing essay. I have to start reading more of Steve's blogs now. The only thing he seemed to miss is that C++ is tremendously useful when programming games; every game ever is done in C++. Games written in Java suck.

16

u/Wavicle Aug 31 '08

every game ever is done in C++.

That's a bit of an overly general statement.

First not "every game ever" is done in C++. Most of your big production games are, at their core, written in C++. Some will have spots here and there of hand coded assembly, many others, especially on consoles, are still written in straight C. An increasing number are embedding languages such as Lua for handling high level tasks that are cumbersome even in C++.

Games written in Java suck.

So do false dichotomies. But even so, there are some games in Java that I think are fairly well done. The "small web game" market is getting larger all the time and finding increasing popularity particularly among women.

1

u/mikkele Aug 31 '08

No, it is IMO not amazing. It's a rant, and somewhat entertaining. He has some good points, especially about C and C++.

The "interfaces suck" thing about Java is curious. I have no Java experience to speak of, so I don't know why he (or apparently Gosling) thinks that. But maybe it is tied in to the multi-inheritance problem. I have used interfaces in a C# system and found it very useful.

The Lisp section is just stupid as it is really about how amazing Emacs is and not really about Lisp as such.

But his predictions about Ruby versus Python did not exactly turn out the way he saw it, to put it mildly. And the "frost" thing about Python? Well, I have read some of Zed Shaws funny but somewhat incoherent rants about the ROR community. OK, that's not "frosty" - more like an all-out white-hot eruption.

1

u/troelskn Aug 31 '08

The "interfaces suck" thing about Java is curious. I have no Java experience to speak of, so I don't know why he (or apparently Gosling) thinks that. But maybe it is tied in to the multi-inheritance problem. I have used interfaces in a C# system and found it very useful.

I think it's rather tied to the whole static-typing problem.

→ More replies (1)

0

u/[deleted] Aug 31 '08

An oldie but a goodie. Check out the rest of Stevey's Blog Rants

0

u/voyagerfan5761 Sep 01 '08

My only disappointment is that it didn't cover more languages, like PHP, JavaScript, etc. I would love to have read Steve's thoughts on those, too.

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

13

u/rfreytag Aug 31 '08 edited Aug 31 '08

Mailman was written in emacs-lisp. But he did write it the way you read it.

7

u/Tuna-Fish2 Aug 31 '08

specifically, mailman was really a plugin to emacs.

3

u/[deleted] Aug 31 '08

To expand on your point, the mailman was a program that ran in emacs. Much like Gmail is an application that runs in your browser.

So the customer service ladies that were gushing to him about mailman were spending their day working in an emacs window.

3

u/eadmund Sep 01 '08

And if I could find a cute girl who spent her day working in emacs and liked it...well, I wouldn't be spending my free time on reddit, that's for sure!

6

u/vsl Aug 31 '08

The whole rant is fairly shallow, no significant technical advantages of one language over another were discussed

You do know the meaning of the word "rant", right?

5

u/formido Aug 31 '08

Uh, why is this comment modded up when half of it specifically proves its author doesn't know what he's talking about?