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 143578
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: Python is . . .
by Tuishimi on Sun 16th Jul 2006 17:58 UTC 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

RE[5]: Python is . . .
by Tuishimi on Sun 16th Jul 2006 18:48 in reply to "RE[4]: Python is . . ."
Tuishimi Member since:
2005-07-06

Ummmmm yes it is. Syntactically optimized means that it arranges the statements in a manner that is optimized in some form. In this case it combines the three elements of looping in one statement line.

You can do many similar things in Python, btw. Often I choose to NOT use those kind of options simply because using other options are clearer to programmers, especially those who might not be used to a language's syntax.

You need to think about stuff like that in a corporate environment when whatever you write could arbitrarily be handed off to ANYONE with any varying degree of experience.

Reply Parent Score: 1

RE[6]: Python is . . .
by Tuishimi on Sun 16th Jul 2006 18:51 in reply to "RE[4]: Python is . . ."
Tuishimi Member since:
2005-07-06

"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."

You have GOT to be kidding me. Please tell me you are kidding me. Code indentation is extremely important to readability. Perhaps I am misunderstanding you. GOTO statements created confusion by providing a somewhat (in appearance anyway) unstructured method of jumping in and out of code segments. Completely different from what we are talking about with code indentation.

Reply Parent Score: 1

RE[5]: Python is . . .
by Espectro on Mon 17th Jul 2006 14:11 in reply to "RE[4]: Python is . . ."
Espectro Member since:
2006-02-01

Like my C teacher said - "You can use GOTO, it's in the language, right? Why not use it? After you write a million lines of code you can use 1 GOTO. Until then, don't think about using it."

Reply Parent Score: 1