Fully Bracketed Syntax

Christian Tismer tismer at tismer.com
Thu Feb 10 18:35:56 EST 2000


"Eaglestone, Robert [NGC:B918:EXCH]" wrote:
> 
> Hello all,
> 
> In general, it seems to me that all good programmers
> indent their code.  However, mandating it as part of
> the form of a language sounds ... strange.

This can be a failure of the language or or your ears.

> However, I don't like the BEGIN...END bracketing done
> by Pascaline languages; neither do I love the {...}
> of C and its descendants.

When you write Pascal, Modula, Oberon or Delphi (what
I did for years), you are used to it and will probably
like it. When you write C or C++, the braces will
be not that bad after some time.

> Has the creator of Python looked into fully bracketed
> syntax?  That might not be the actual term, so here's
> an example of what I'm thinking about:

I think he is programing since over 20 years but
probably never had time to think about braces.
That's for sure one of the reasons to omit them
for Python :-)

> if ( foo > bar )
>    do_something();
>    do_something_else();
>    done();
> endif

Whowwwww! What a nice concept. Maybe you should
invent a new language? You might think of a very
new name, something like "Visual Basic"?

> This bracketing gets the best [ or worst ] of both
> worlds, with a bit of syntactic sugar added for free.

How do you define "best" in a person independant manner?

> The lead bracket is the keyword itself, and the end
> bracket is tailored for that keyword alone.  Only
> one 'line' is 'wasted' by the end bracket (Python
> doesn't like wasting lines).  And indentation is no
> longer a language issue.

The lead bracket is the keyword itself, and the end
bracked is obvious by indentation and no longer
necessary. If you want to waste one line, use #endif.
This feature was added to Python long time ago and isn't
very well known. Python is so flexible that you even
can choose anything behind the "#".

> I only know of one language which uses this syntax,
> and it's not in common use.  However, lots of us may
> have seen this kind of syntax in college (hey!  is it
> part of ML?).

Bill Gates would kiss you for this :-)

> I guess what I'd like is some clear reasoning about
> bracketing and indenting that warrants such a feature
> of a language.

If you like Python, you will like indentation. Indentation
belongs to Python like Python belongs to Guido.

I-did-not-intend-to-hurt-you-by-indent-
    -but-it's-easier-to-change-you-
        -than-Python's-intended-indentation -ly y'rs - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Düppelstr. 31                :    *Starship* http://starship.python.net
12163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list