Indentation (was Re: multi-line expressions)

Tony J Ibbs (gaga50@udcf.gla.ac.uk)
Fri, 25 Feb 1994 10:56:08 +0100

I have only just started using Python (it is my first object oriented
language). So far I am finding it a pleasure to use - partly because of the
object orientedness, but partly because (on the whole) it seems well thought
out (I *love* the way the for loop executes over a list). I use both GNU emacs
and the interpreter. I would be upset if we lost the indentation as the means
of indicating the block structure.

Firstly, despite the comments that "any good programmer should indent
properly", that just doesn't happen reliably in the real world. Honestly, it
doesn't. It is thus refreshing to have a language with only one (well, sort of)
correct style - it saves a lot of argument.

Secondly, as a C user, it is very reassuring not to have the "dangling else"
problem (why they put that into C I don't know - it wasn't in BCPL) and other
associated ambiguities. The major drawback with allowing block delimiters is
that we would (be able to) lose this clarity of "what you say is what you mean
and what will be understood".

I also worry that if there were delimiters defined (even as optional), some
people would insist on using them. I mean, C users were quite happy using "{"
and "}" even when most line printers and terminals were not very good at
distinguishing them from "(" and ")".

I'm not so worried about the "initial user reaction". Firstly, when I started
using C I thought it looked horrible (hey, I still do). But that didn't mean I
didn't use it - it was the best tool for the job. Secondly, if Python is mainly
seen as competing with perl, tcl, etc (which I think undervalues it) then it is
not exactly fighting pretty looking things either. And anyway, I don't think
I've seen a computer programming language where there wasn't *something* to
grumble about. (It does worry me a bit that C and C++ programmers seem to think
that other languages should look like theirs - why? It's not a sentiment I've
heard from programmers in other languages. Is it laziness?)

However, I would definitely support the suggestion that the interpreter should
provide a good guess at indentation (in the same way that the Emacs mode does)
- although it's not hard to type a series of tabs, it would be nice to have the
interpreter help just that little bit more...

Sorry for going on at length,
Tibs

(Oh, and by the way I do like the idea for sequences of indefinite length
[dream mode] - defintely elegant)
-------------------------------------------------------------------------------
Tony J Ibbs (Tibs)
Department of Geography and Topographic Science
University of Glasgow Telephone: (+44)41-339-8855 x6649
GLASGOW G12 8QQ Fax: (+44)41-330-4894
Scotland Email: gaga50@udcf.glasgow.ac.uk
or (if that fails): T.Ibbs@vms.glasgow.ac.uk
-------------------------------------------------------------------------------