Ian Bicking: the old part of his blog

Why web programming matters most comment 000

If the shape of your whitespace is your idea of self-expression, you can't really be that much of a "programmer".

Comment on Re: Why Web Programming Matters Most
by arimasp

Comments:

My idea of "self-expression"? Huh, what am I, picasso? The shape of my whitespace is my idea of organization, that's what it is. (And so I guess writing organized code doesn't make me "much of a 'programmer'" according to your comment.)

# Bog

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
# Nara Narasimhan