Linked by Eugenia Loli on Sat 15th Jul 2006 22:45 UTC
.NET (dotGNU too) Jeff Cogswell writes: "I'm about to make a confession. Even though I've written several books and articles about C++, I have a secret: C++ isn't my favorite language. I have lots of languages that I use, each one for different purposes. But the language I consider my all-time favorite is Python."
Thread beginning with comment 143577
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Python is . . .
by Cloudy on Sun 16th Jul 2006 17:55 UTC in reply to "RE: Python is . . ."
Cloudy
Member since:
2006-02-15

Because there are situtation in which it's actually clearer to have two statements on one line than to separate them.

The canonical example in C is manual loop unrolling.

Reply Parent Score: 1

RE[3]: Python is . . .
by Tuishimi on Sun 16th Jul 2006 17:58 in reply to "RE[2]: Python is . . ."
Tuishimi Member since:
2005-07-06

Your opinion. I would say just the opposite. In fact I have many many places in code I have written where I have explicitly commented on the fact that my code could have been more syntactically optimized by I chose NOT to for the sake of clarity, for anyone who had to support my code in the future.

Reply Parent Score: 1

RE[4]: Python is . . .
by Cloudy on Sun 16th Jul 2006 18:32 in reply to "RE[3]: Python is . . ."
Cloudy Member since:
2006-02-15

Um, the C loop unrolling example isn't "syntactically optimized". It has exactly the same number of syntactic elements if you place the increment statements and action statements on the same line as it does if you don't.

What it does have is a visual cue that the action and increment statements are tightly coupled. You can't accomplish this in Python.

For this reason, the indentation rules of Python are not merely enforcing good indentation practice, since they add restrictions that prevent some useful practices.

Python indentation is like Pascal's banishing of 'goto' because Wirth didn't understand the situations in which goto made code more readable rather than less.

Reply Parent Score: 1