Confessions of a Python fanboy

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Jul 31 10:13:50 CEST 2009


On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote:

> That and the fact that I couldn't stop laughing for long enough to learn
> any more when I read in the Pragmatic Programmer's Guide that "Ruby,
> unlike less flexible languages, lets you alter the value of a constant."
> Yep, as they say "Bug" = "Undocumented feature"!

That's no different from Python's "constant by convention". We don't even 
get a compiler warning!

On the other hand, we don't have to prefix names with @ and @@, and we 
don't have the compiler trying to *guess* whether we're calling a 
function or referring to a variable.

Somebody who knows more Ruby than me should try writing the Zen of Ruby. 
Something like:

Line noise is beautiful.
Simplicity is for the simple.
Complicated just proves we're smart.
Readability only matters to the schmuck who has to maintain our code.
Special cases require breaking the rules.
In the face of ambiguity, try to guess. Go on, what could go wrong?
The more ways to do it, the better.

Although I'm sure Ruby has its good points. I'm not convinced anonymous 
code blocks are one of them though.


-- 
Steven



More information about the Python-list mailing list