Re: multi-line expressions

Ty Sarna (tsarna@endicor.com)
Fri, 25 Feb 1994 00:09:19 GMT

In article <9402242231.AA04886@lion.eng.sun.com>
rxb@lion.Eng.Sun.COM (Rafael Bracho) writes:
> Although I like the indentation-as-block-identifier idea, and I find
> the resulting code elegant, I've also encountered resistance to that
> feature of Python. Yes, perhaps after trying Python for a while people
> would end up liking indentation, but they may never agree to try Python
> because of that feature ...

It's their loss. I too had a bad reation to that feature when I first
saw it, but it soon grew on me, and I'd hate to see it changed.
I think people dislike it because of the association with fixed-column
syntaxes. If you point out to them that the indentation is flexible,
point out that they should be indenting blocks properly anyway, and show
how it can reduce errors by removing the possibility of code that's
indented one way but actually does something else because of a missing
or incorect block structure, then I think they'll warm to it.

> IMHO, it would be a mistake to turn indentation into the cornerstone
> of the language and hinge its success on it. It's important to listen
> to customers, in this case developers, and concede that perhaps adding
> symbols to bracket blocks is "what the market wants."

I think it's one of Python's nicest features, and after working with it
for a while, C's braces seem as stupid and unneccesarily verbose to me
as Pascal's BEGIN/END seem to a typical C programmer. I also hate to
see a good language compromised just to satisfy people's prejudeces (and
it really is a predudice -- the people who object have almost
universally never tried it).

It's also a nice feature for teaching programming, since it's easier to
explain than blocks, and it also forces one to learn proper indentation.
It's one of the few example of a feature that's both expert and novice
friendly.

> Unlike Chris, however, I vote for curly braces, a la C, instead of
> begin-end keywords, a la Pascal.

If we must change it, I'd have to vote for braces. I'd rather leave a
good thing the way it is, though.

-- 
Ty Sarna                 "As you know, Joel, children have always looked
tsarna@endicor.com        up to cowboys as role models. And vice versa."