Ian Bicking: the old part of his blog

Whywebprogrammingmattersmostcomment000

source
This thing about indentation/whitespace has dogged python forever. Personally, I think it is
a great feature, but for those who won't touch python without curly braces, there is an easy fix:

Just accept an alternate form of blocks, which is:


  xxx ... {
  code          # Note: code here is deliberately randomly indented.
    code
   code
  }


instead of


  xxx ... :
    code
    code
    code







right in the Python compiler. (I can hear all you python zealots scream so loud :)
since it breaks the 'one way to do it', and pushes a stake right through the heart
of the indentation based readability, but hey why not?

I have often thought of whipping out a perl (sorry) preprocessor script that could take
such braces based syntax and turn that to standard indentation based syntax, but it
is best done right within the python compiler and interpretor: maybe allow a
new command-line option that allows for braces based blocks.

/Nara
Comment on Re: Why web programming matters most comment 000
by Nara Narasimhan