r/programming • • Aug 30 '08

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

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

122 comments sorted by

View all comments

Show parent comment

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.

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.

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)

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.

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

2

u/13ren Aug 31 '08 edited Aug 31 '08

Minor irritation: I've had Python code that looks indented but isn't. This is probably because I have tabstop=2. I think semantics that depend on the invisible is problem-prone! :-) Whitespace in make has a similar issue. However, once I realized what was happening, it hasn't happened again, so I think it's a minor irritation. The same problem also occurs in C-style code, in that when I cut-and-paste code written with different tabstops (and vice-versa), the places where spaces were used instead of tabs are revealed.

The other issue is that you can't inline function definitions etc - which in some cases would be clearer. (I like Haskell's \ for this - tho I've only seen it, not used it)

On ruby: why can't it use C-style } instead of end? Are { and } already used for something else?

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

2

u/13ren Aug 31 '08 edited Aug 31 '08

I know you can do that, but they're not on one line. i.e. due to Python's need for indentation, you can't say this:

def myfunc(): def myfunc2(): pass

erruum, maybe "inline" doesn't strictly mean "on one line". Please take my comment as having the latter meaning :-)

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

3

u/13ren Aug 31 '08 edited Aug 31 '08

curious: why don't they use def for that as well? That would seem more consistent (to me).

Here's code using lambda:

s = 'hello to all da people in da house'
s = s.split()
print map( lambda word: len(word), s )

[5, 2, 3, 2, 6, 2, 2, 5]

Instead of the keyword "lambda", why not have:

print map( def(word): len(word), s)

then you could name it too, if you wanted (I have a feeling this is an old, old controversy that doesn't really matter - I'm just wondering if there is a satisfying reason for it, apart from parser-convenience in distinguishing them).

0

u/[deleted] Aug 31 '08

[deleted] — view deleted comment

→ More replies
→ More replies (5)

2

u/mernen Aug 31 '08

On ruby: why can't it use C-style } instead of end? Are { and } already used for something else?

Just because Matz didn't want it, basically. I guess he did it that way because using } would require an opening brace, making it in the end not really shorter, just distributing weight around. For almost all purposes, Ruby makes block-opening keywords completely optional (the only exception is the block-passing do, but these are also exactly the situation where you are also allowed to use {})

2

u/Leonidas_from_XIV Aug 31 '08

why can't it use C-style } instead of end? Are { and } already used for something else?

Because they are used for blocks and dictionaries/maps. But I suspect they could be used, because Ruby's grammar is (from lexer/parser viewpoint) quite complex.

→ More replies (8)

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)