Sunday, November 19, 2006

Indented Servitude

Only two days into my reinvention of myself as a programmer, and I've already hit on one feature that I remember hating about Python the last time I tried learning it: It insists on using indentation to mark code blocks. For example, when constructing a class:

>>>class Address:
... def __init__(self, Hs, St, Town, Zip):
... self.HsNumber = Hs
... self.Street = St
... self.Town = Town
... self.ZipCode = Zip
(The ellipses [...] mean that Python is waiting for you to type something to continue or end the definition of something, in this case the class 'Address')

Now, understand, I'm not against indentation or neat code; in fact it's good programming practice. But requiring indents when you're constructing a code block, instead of, say, enclosing it in {} like C or begin...end like Pascal...That's just bogus.


Oh well, back to coding...

No comments: