Aaargh!
Posted by matijs 14/02/2008 at 21h35
I’m upset. I’m so upset that I was originally going to call this entry “Fuck you, Python”. Now, I realize that’s not a very nice thing to say, and actually, Python can’t really help it anyway. Except by not existing1.
Why, why, why must every other new language created these days have significant indenting? You see a new language, like Cobra, you read the overview of features, and you go, cool, great runtime performance, static and dynamic typing, and contracts, too. So you browse on to the hello world example, and boom! the absence of end-of-block tokens hits you in the face like an iron fist.
Now, in Python’s case you can tell from the reasoning2 and the implementation that somebody actually thought this through, but Cobra has the following rationale for using this method of block structuring:
Cobra uses indentation to denote code structure since adept programmers do this anyway in languages that don’t even require it (C#, Java, C++, etc.)
Wow. I’m going to make a language that uses the comma-space token to separate function arguments, since adept programmers put a space after the comma in languages that don’t even require it.
Look, if you use indenting for block structure because you like Python, just say so already.
Oh wait, there’s more:
In Cobra, one INDENT is accomplished by one TAB or four SPACES.
Huh? Because adept programmers indent four characters anyway even in languages that don’t require it? Because adept programmers use one tab per four spaces anyway even in editors that don’t require it?
Sheesh.
I feel much calmer now.
1 See how reasonable I am. I’m not actually calling for the non-existance of Python.
2 I don’t agree with that reasoning either, but at least it’s, you know, reasonable.