Confessions of a Python fanboy

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Tue Aug 4 06:01:06 EDT 2009


Steven D'Aprano a écrit :
 > On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote:
 >
 >>> Disadvantages: your code is filled with line noise. It's an arbitrary
 >>> choice between @@ meaning instance attribute and @@ meaning class
 >>> attribute -- there's no logical reason for choosing one over the other,
 >>> so you have to memorise which is which. It's easy to get it wrong.
 >> So far that's something I have no difficulty living with.
 >
 > I don't like arbitrary symbols.

Neither do I - when there are too many at least. But I can certainly 
live with a couple ones. Now the point wasn't about my personal tastes, 
but about the fact that this particular pair of "arbitrary symbols" was 
  IMHO still usable - IOW, I wouldn't dismiss Ruby on this sole point.

 > Most people don't -- that's why "line
 > noise" is unpopular. It's hard to read, hard to write, hard to maintain,
 > and hard to talk about. The more line-noise, the worse the language.

OTHO, too much verbosity is a pain too. Ever programmed in AppleScript ? 
"set the attribute XXX of object YYY of collection ZZZ to SomeValue"... 
Yuck. I bet you prefer "zzz[yyy].xxx = SomeValue" - which uses three 
arbitrary symbols.

(snip)

 > Oh well, one negative out of
 > a whole lot of positives isn't too bad.

Indeed. You could perhaps learn a bit more about Ruby's positives if you 
don't block on what you perceive (rightfully or not) as negative points ?-)

(snip)

 >>>>> Somebody who knows more Ruby than me should try writing the Zen of
 >>>>> Ruby. Something like:
 >>>> (snip childish parody of Python Zen)
 >>>>
 >>>> Steven, is that any useful ?
 >>> It made me feel good.
 >> Why ???
 >>
 >> You don't like Ruby ? Fine, don't use it. Period. I can't see the point
 >> of all these pissing contests.
 >
 > Criticism of a language is a pissing contest?

Not necessarily. But:

 > Yeah, okay, I was a tad dismissive. I un-apologetically jump to strong
 > impressions about languages based on minimal use

Possibly, yes.

 > -- but I'm also willing
 > to change my mind. Ruby certainly looks to me like it has some nice
 > features. Syntax that looks like Perl isn't one of them though.

Not my cup of tea neither FWIW. But Ruby is nowhere near Perl in terms 
of "line noise".

 >
 >>> Just because Smalltalk had a particular (mis?)feature
 >> You can drop the 'mis' part IMHO. The point of code blocks in Smalltalk
 >> is that once you have something as powerful as the message+code blocks
 >> combo, you just don't need any other 'special form' for control flow.
 >
 > Well, maybe, but remember, programming languages are only partly for
 > communication to the compiler. They also have the requirement to
 > communicate with human programmers as well, and that's even more
 > important, because
 >
 > (1) humans spent a lot more time working with code than compilers do;
 >
 > (2) human programmers charge much more money than compilers do;
 >
 > (3) and you can modify the compiler to suit human needs much more easily
 > than you can modify programmers to suit the compiler's needs.
 >
 > So I'd ask, does Smalltalk's message passing model match the way human
 > beings think?

Does all human beings think the same way ? And aren't human beings able 
to learn new ways ?

Smalltalk's only control flow construct might seem a bit weird at first 
when all you've been exposed to so far are more "traditional" special 
constructs, but it's not hard to learn and is way more uniform and 
flexible than having special constructs for each and any possible 
situation.

One could ask if functional programming or OO "matches the way human 
beings think". From experience, some of us just find FP and / or OO just 
obvious, and some won't never get it.

FWIW, there are quite a few features and idioms in Python that I _now_ 
find readable and obvious, but that would have puzzled me ten years ago. 
This reminds me of a shop where the CTO had forbidden using any OO 
feature of the main language used there because "nobody would understand 
it" (needless to say, I only stayed there a couple weeks...).

 >
 >>> doesn't mean that
 >>> other languages should copy it.
 >> Nope. But OTHO, Python is famous for all the features it copied from
 >> other languages !-)
 >
 > Absolutely! There's nothing wrong with copying *good* features :)

Well... at least when they make sense and integrate smoothly into the 
target language.





More information about the Python-list mailing list