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 143446
To read all comments associated with this story, please click here.
Python is . . .
by Cloudy on Sun 16th Jul 2006 06:00 UTC
Cloudy
Member since:
2006-02-15

a mash-up of COBOL and Lisp, with the best parts of either left out.

Too bad the authors of Python hadn't had to write enough COBOL or Fortran to understand what a bad idea using indentation as a syntactic element is.

Reply Score: 2

RE: Python is . . .
by Karma_Police on Sun 16th Jul 2006 10:46 in reply to "Python is . . ."
Karma_Police Member since:
2006-06-19

indentation as a syntactic element is bad? Why? Don't you indent your code anyway to make it readable? So whats the difference having it be a syntactic element or not?

Reply Parent Score: 5

RE[2]: Python is . . .
by Cloudy on Sun 16th Jul 2006 17:55 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: Python is . . .
by netpython on Sun 16th Jul 2006 12:17 in reply to "Python is . . ."
netpython Member since:
2005-07-06

ADA is more robust..

Reply Parent Score: 0

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

:)

Ada is a beautiful language too. I had the opportunity to use it at DEC (there are actually parts of the VMS that are implemented in it).

I also wrote several IS applications with it.

I guess I don't understand some of the comments people are making about language (A) sucks because of this or language (B) makes bad programmers.

All languages have pluses and minuses. It is how you, the developer, uses them that makes an application sink or swim.

Maybe students just are not being taught proper usage of data structures and algorithms anymore? Maybe Analysis and Design have fallen by the wayside? I don't know... in "my day" analyzing the problem and designing a solution was far more important than the language chosen to implement the application, altho' the language selection WAS part of the design.

Personally, I like ALL LANGUAGES. Each one is unique and has character of its own. Young developers should learn to appreciate the nuances of each new language they encounter and how each language can be leveraged in a given situation.

Reply Parent Score: 2

RE[2]: Python is . . .
by CrLf on Sun 16th Jul 2006 13:14 in reply to "Python is . . ."
CrLf Member since:
2006-01-03

"Too bad the authors of Python hadn't had to write enough COBOL or Fortran to understand what a bad idea using indentation as a syntactic element is."

There are many objectionable things in Python, but the indentation seems to be criticized only by people that never used the language.

The indentation rules in Python are exactly those that any half decent programmer already follows in *every* language (and Python doesn't impose any specific indentation style, just *any* indentation style).

Reply Parent Score: 5

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

I think the complaint is more about what happens in large-scale projects when people invariably mess up the indentation guidelines and keep the script from running. I munged up some C code pretty bad the other day, because our policy is to use tabs to indent, but I was working on some code that had 3-space indents (btw --- what kind of uncivilized jackass uses 3-space indentation?).

Reply Parent Score: 3

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

The indentation rules in Python are exactly those that any half decent programmer already follows in *every* language (and Python doesn't impose any specific indentation style, just *any* indentation style).

The rule that statements are terminated by line endings and that multiple statements cannot appear on a single line pretty much blows that claim out of the water.

There are programming idioms, such as manual loop unrolling, which are clearer when multiple statements are allowed on a line.

Also, the tab replacement rule pretty much negates any advantage that using alignment to indicate block nesting gives you because you can't tell when reading the code how the indentation is going to work after tab replacement.

Reply Parent Score: 1

RE: Python is . . .
by eosp on Sun 16th Jul 2006 15:01 in reply to "Python is . . ."
eosp Member since:
2005-07-07

Assuming you're a C/Pascal/Algol/etc programmer, do you use that indentation anyway? Probably. So it's just using something you use anyway and making it required.

Reply Parent Score: 1

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

Except that

a) using end-of-line as end-of-statement means that idioms that put multiple statements on a line for readability are not possible

and

b) the tab substitution rule means that you can't really tell by inspection what the indentation of a program really is.

Reply Parent Score: 1

RE: Python is . . .
by rayiner on Sun 16th Jul 2006 15:31 in reply to "Python is . . ."
rayiner Member since:
2005-07-06

Yeah, Python has the best parts of Lisp left out, but there is enough in there for the language to be enjoyable to use. Plus, programmers don't blanche at the mention of Python, so you actually have the chance to use it sometimes.

Reply Parent Score: 1

RE: Python is . . .
by thompson4822 on Sun 16th Jul 2006 17:10 in reply to "Python is . . ."
thompson4822 Member since:
2006-07-16

It seems to me that the people most put off by the idea of indentation based syntax have always been programmers for whom the word 'refactor' might as well be a reference to an obscure foreign capital. I remember mentioning Python's syntax to a colleague who was completely revulsed. Later I found out that his idea of routines were 100-1000 line tracts of utterly unreadable spaghetti.

Best regards,


Steve

Reply Parent Score: 2

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

Bad guess in this case. I've been a believer in loose coupling, implemenation hiding, and doing one thing per function since before the term 'object oriented' was invented.

My objections to programming languages that try to enforce good practice dates back to Dykstra's observation, in the context of Pascal, that you can "write Fortran in any language".

Readability is a function of programmer discipline, not a feature of a language.

Reply Parent Score: 2

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

?! Pure personal opinion. I "personally" loved FORTRAN and it was one of my favorite languages to implement IS applications in the late 80's and early 90's. It was fast, had a clean layout, simple syntax and on a VAX running VMS could link into and use any graphical library you wanted. You could also implement modern data structures yourself if you needed them.

Reply Parent Score: 1

RE[2]: Python is . . .
by rayiner on Sun 16th Jul 2006 18:26 in reply to "RE: Python is . . ."
rayiner Member since:
2005-07-06

The biggest problem with FORTRAN is that it creates this single-threaded array-centric mindset in the people who use it. It recently fell on me to maintain some data collection software which was obviously written by a FORTRAN programmer outside our company. It's so bad. Dynamic memory allocation? Pshaw. Locking? Never heard of it. Win32 message loop? What's that?

In my (admittedly limited) experience, Java tends to corrupt the mind less than does FORTRAN or C. At least a Java guy will err on the side of too much abstraction, or too much dynamicism, or too much locking or thread-safety, because Java kind of programs you to do that. When it comes time to extend the software later, that's less of a pain to deal with than not enough of these things.

Reply Parent Score: 1

RE: Python is . . .
by mexisme on Mon 17th Jul 2006 10:05 in reply to "Python is . . ."
mexisme Member since:
2006-07-17

The only language I feel has ever successfully used indentation is part of it's syntax is Haskell, mostly because the functional style lends itself to small, bite-sized chunks -- and I'm not going to argue just how "functional" Python is.
Even in Haskell, though, it's a "wrapper" for the more common braces/parentheses (C- or Lisp-style) hierarchy and is internally translated into this style before compilation!

Indentation-only makes decent lambdas / anonymous functions nearly impossible in Python, it appears.

Reply Parent Score: 2