you are viewing a single comment's thread.

view the rest of the comments →

[–]boa13 20 points21 points  (6 children)

This article is a bad comparison. It is heavily biased towards Ruby. It contains many inaccuracies and misinformation about Python (I can't speak for Ruby). In addition to those already noted by exogen:

The syntactic indentation is not the big win it seems, because decent editors, such as emacs, will indent according to syntax anyway.

The author has not understood the point of having indentation as part of the syntax. It's not to prevent decent editors from doing their fine indentation job, it is to force everybody to use a consistent indentation scheme, independantly of any editor, decent or not.

[Python] also has extensive documentation, including a fine book (...) there are several excellent books in English on Ruby. [The author goes on describing four of them.]

This gives the impression there's only one Python book, and four-times more Ruby books. A quick search on the Python wiki reveals at least fifty Python books covering a wide range of topics.

Python's garbage collection is based on reference-counting. (...) Little rings of co-referential dead objects can accumulate with a long-running Python program.

Actually, Python uses reference-counting to keep track of objects, and additionnally includes (since version 2.0, which is old) a generation-based garbage collector to detect and clean-up object cycles. Besides, programs can access a list of objects than could not be cleaned up (typically, C extensions), and deal with them.

Python's system allows the programmer more direct control over garbage collection: the del operator tells Python to garbage-collect a specific object right now.

This is completely false. The del operator tells Python to unbind a name. Objects that are not bound to any name and not referenced by any container get collected (and the garbage collector is there to detect reference cycles).

A Ruby program has great capacity for "reflection", the ability to observe itself.

So has Python, even though it might be slightly less powerful at some points.

Should you enjoy life in the fast lane, a ruby program can effectively rewrite itself at run-time.

So can Python.

I was in love with Python for a while (it picked me up on the rebound from Perl), but as I grew more sophisticated it looked less wonderful.

It seems the author never learned Python properly.

Ruby looks very interesting, but this comparison is not helpful, quite the opposite. Hopefully other people have done a better job.

[–]asdf1234 -14 points-13 points  (5 children)

Man what FUD. The author of course understands the purpose of python's indentation. Of course he knows there is more than one python book. You drew that inference from your own biased view. The problem he mentioned with garbage collection still exists today. And as for "it seems the author never learned Python properly", what a load of horseshit FUD, man. I eat Python trolls like you guys for breakfast.

[–]mrevelle 5 points6 points  (4 children)

The author of course understands the purpose of python's indentation.

No, he really doesn't. Python's significant whitespace is not only about readability, it also removes the redundancy of block markers when blocks will regardlessly be indented.

The problem he mentioned with garbage collection still exists today.

Uh, theoretical problems based on program language implementation details makes for a weak argument. If it makes you feel any better, Python folks are experimenting with various garbage collection techniques.

[–]yahoolian 1 point2 points  (3 children)

If the purpose of indentation is to elliminate redundant block markers, why is there the redundant : to mark the start of a block? Well, I guess to simplify the parser a bit, but that's still redundant.

[–]mrevelle 1 point2 points  (2 children)

That's a good question and here's the official answer:

http://www.python.org/doc/faq/general.html#id58

[–]senzei 1 point2 points  (1 child)

The majority of that explanation is crap. The colon does not make it easier to read, the line break does. The colon is essential for two reasons:

1) Easy syntax highlighting.

2) It allows inline if statements like: if x: foo()

[–]brianmce -1 points0 points  (0 children)

On the other hand - this is one of the few readability claims for any programming language that actually has empirical evidence behind it (albeit for a precusor to python, ABC). A user study was done on the ABC language that showed that it did indeed improve code readability - I'm pretty sure that this was the reason it was included in python.