Python's biggest compromises

John Roth newsgroups at jhrothjr.com
Thu Jul 31 11:00:19 EDT 2003


"Anthony_Barker" <anthony_barker at hotmail.com> wrote in message
news:899f842.0307310555.56134f71 at posting.google.com...
> I have been reading a book about the evolution of the Basic
> programming language. The author states that Basic - particularly
> Microsoft's version is full of compromises which crept in along the
> language's 30+ year evolution.
>
> What to you think python largest compromises are?
>
> The three that come to my mind are significant whitespace, dynamic
> typing, and that it is interpreted - not compiled. These three put
> python under fire and cause some large projects to move off python or
> relegate it to prototyping.
>
> Whitespace is an esthetic preference that make Andrew Hunt and David
> Thomas (of Pragmatic Programmer fame) prefer Ruby. Personally, I love
> it - but I can see why some people might not like it (30 years of
> braces).

Since I'm not particularly masochistic, I will respectfully disagree.
Unnecessary braces are one of the reasons I haven't looked at
Ruby.

That said, I've come to the conclusion that the editor should take
care of these things for you. If you prefer a brace free notation,
you should be able to tell your editor to present the program to you
that way. If you prefer braces, then it should be able do that for
you as well. That kind of stylistic thing doesn't belong in the
language.

In fact, if I didn't have to deal with the braces, I think I'd come
around to the view that the text should have them. Explicit is
better than implicit, and there are a few things that the
automatic indentation makes rather difficult in the design area.

> Dynamic typing causes the most fuss. I like Guido's answer to the
> question -
> > "Doesn't dynamic typing cause more errors to creep into the code
> because you catch them later than compile time?".
> > "No, we use Unit Testing in Zope".
>
> That said, obvious Basic compromised by using things such as "Option
> Explicit", thereby allowing both dynamic and more static style
> variables. Yahoo groups moved from python to C due to dynamic typing.

Basic was compromised from day 1. Its designers tried to water
down Fortran to produce something that they could use to teach
programming in an interactive system. The late Ejdsger Dykstra called
Fortran an "infantile disorder". While he was rather outspoken, he had
his reasons. The only reason that Basic exists today is that Bill Gates
has a certain fondness for that interpreter he wrote that got him his
start in the business.

> Non-compiled - obviously there are times when performance matters more
> than other things. Google I believe uses python to prototype (or used)
> and then turns to c++ for heavy lifting.

High performance isn't Python's target. If PyPy ever gets their act
off the ground, then we will have a shot at a good quality JIT
interpreter. Then watch it fly.

> What about immutable strings? I'm not sure I understand Guido's
> preference for them.

Immutable objects make it much easier to do dictionaries. That's
why Python has both lists and tuples. The actual problem with
immutable strings is performance. While you can concatinate
strings with '+', if you've got more than two strings to put together,
it's faster (and clearer) to use the '%' formatting operator. This
isn't real obvious to experianced programmers that are new to the
language, though.

I don't see any of these as compromises. Python has a specific
location on the spectrum that makes it better for certain things than
for others.

John Roth


>
> Anthony
> http://xminc.com/anthony






More information about the Python-list mailing list