Python vs. Io

Paul Prescod paul at prescod.net
Sun Feb 1 16:47:20 EST 2004


Daniel Ehrenberg wrote:
>...
> 
> In the opinion of the creators of Io, a space looked cleaner. Using a
> period looks kinda like you're finishing a sentence and starting a new
> one. Consider the following syntaxes:
> 
> Dog barks //Io
> Dog.barks() #Python
> 
> Regardless of which one is more common, which looks more like
> language?

The space "operator" is used in way too many different ways in language. 
Consider these two grammatical sentences:

The Dog barks. (how IO uses the space)
The Dog Spot. (how Java/C/C++ use the space)

But anyhow I'm not going to argue that IOs choice is wrong, just 
confusing at first.

> You say that "." is more ubiquitous, but "{}" is more ubiquitous than
> ":" by far, yet Python uses the latter and we don't complain. (note
> that in Io, unlike other languages with similar syntax such as Ruby,
> functions are first class objects.)

First, if I had invented Python I would not have bothered to buck the 
trend of using curly braces. Hardly anyone chooses Python because of 
that feature and some are turned off by it. Python makes tons of 
conservative, "traditional" choices and I think that they do have 
something to do with its current level of popularity. Sometimes Python 
even hides pretty radical semantics under "traditional" syntax (e.g. [] 
as sugar for getitem). Ruby takes this even farther. If I were in charge 
of IO I might do that too. e.g. make {} sugar for a last argument that 
is a statement list or something.

Second, I think that the meaning of Python's colon is unuusal but 
self-evident. I personally decided to learn Python because I stumbled 
upon some code that looked exactly pseudo-code and wondered what 
language I was reading. Coming from (e.g.) Java or C++, most of Python's 
surfact syntax is self-evident to the English speaker, even when 
different (e.g. "or" instead of "||").

Language design is like music composition. You must be better than your 
competitors but no so much better (i.e. different) that you just seem 
"weird". Judging the right balance is not easy.

  Paul Prescod






More information about the Python-list mailing list