top | item 2840731

Tom Pinckney: Why I gave up on Java and switched to Python

83 points| rjim86 | 14 years ago |tompinckney.com | reply

50 comments

order
[+] ilcavero|14 years ago|reply
I'm sure there are many reasons why such switch would make sense, but the ones provided here are just BS.

1)"No more XML config files" XML configs are slowly disappearing

2)"by omitting the type info a python program has fewer opportunities for bugs" this reason was just nonsensical

3)"It's free software and easier to hack on", go check the openJDK

4)"Things in the python world seem to "just work"" that's just a self delusion caused by an emotional reaction not a valid argument

5)"I can still relive the good old scheme days" ok so maybe this one is not BS

[+] mattdeboard|14 years ago|reply
There is a direct and measurable causal relationship between number of LOC and number of bugs. This was discussed at length on Stack Exchange podcast #9 (I believe) when the author of "Making Software" was a guest. This exact topic was discussed at length.

Java is for better or worse more verbose than Python, which means more lines of code which means more opportunity for bugs. It is hardly nonsensical. That opinion is a product of language-centric parochialism with no regard for actual fact.

Ditto for the "just work" line being a "delusion." Like it or not, Python does indeed "just work" in most cases. This isn't unique to Python of course, but I do think that is a fair opinion of the author to hold.

[+] andos|14 years ago|reply
4)"Things in the python world seem to "just work"" that's just a self delusion caused by an emotional reaction not a valid argument

First, there are objective aspects to that perception. For example, Python affords trying stuff immediately through its REPL. When you commit it to “real” code, it just works. Opening an UTF-8 file is just `codecs.open`. Alas, there is Zope/Plone to serve as a counterexample.

Second, emotional reactions do affect how we, human programmers, perform. If I feel nice coding in Python, I am very probably more productive. If I hate XML configuration files, I'll be on my nerves when I write them and might perform poorly.

The relationship between a programmer and code is not (just) a mathematical thing and we really should stop seeing emotion as a cognitive defect and appreciate it as the evolutionary improvement that it indeed is.

(Sorry for ranting. I'm hungry.)

[+] levigross|14 years ago|reply
I agree that number 2 doesn't make any sense. I know that code quality is measured by defects in KLOC (1k lines of code) but this isn't a reason.

P.S Even though within the article the python the he explains what he means (with type bugs) such issues won't be by moving to python.

[+] vegai|14 years ago|reply
"that's just a self delusion caused by an emotional reaction not a valid argument"

It really is not, believe me.

[+] lemming|14 years ago|reply
Easily half of my java was type info. If the number of bugs in a program is proportional to the program length, by omitting the type info a python program has fewer opportunities for bugs.

You're kidding me, right?

[+] kenjackson|14 years ago|reply
I was going to write almost the exact same response. It's like someone saying, "I stopped writing tests. Reduced the LOC by half. And with no tests, we actually find fewer bugs!"
[+] dexen|14 years ago|reply
That's true and he is right; having the programmer juggle types is human compiler at work. The more a human is relied upon, the more bugs result. Let the machine (here: the compiler or interpreter) do the dirty work.

Of course, there are distinct classes of errors that occur only when programmer off-load juggling types to the computer, but that by itself doesn't invalidate his stance -- those errors are less prolific than errors associated with doing all type work by hand.

[+] smackfu|14 years ago|reply
That line alone makes the whole thing a joke.
[+] astral303|14 years ago|reply
If you feel the same way and you are in the Java world, consider also switching to Groovy. It gives you all the dynamic type checking goodness with a smoother learning and adoption curve, since you can start from 100% Java and work your way up into closures, dropping types, simper syntax, etc.

#1 is a bit unfair now, as there are plenty of things in pure Java (Guice, Spring Roo) that don't require ridiculous XML files.

[+] pyre|14 years ago|reply
~1.5 years ago, we did a project in Groovy and found that some things were not quite there, like passing named parameters into a constructor.
[+] null_ptr|14 years ago|reply
My main language is C, and my go-to language for quick programs to get some job done used to be Java. Until I learned Python and realized how nice it is. Now I write all my scripts and tools in Python, it's a superb language. I enjoy C because of its bare-bones simplicity, but I like working in Python just as much.
[+] lusr|14 years ago|reply
So... with a statically type-checked language, most of his errors were null reference errors? Funny, with Python most of my errors were type errors. (And most of my serious problems were with refactoring complex applications as they grew larger. This is why I stick to C#.)
[+] ojosilva|14 years ago|reply
"to get Tomcat to produce good performance under load"

Tomcat is a servlet reference implementation, and is good as a development application server. But for anything serious in production, get JBoss or something. I know the Tomcat team has been working hard on making it more robust, but still!

I think some people/companies and some languages are just meant for each other. Looks like these folks just got into Java through the wrong door. The switch to Python could only make a lot of sense to them. And I'm glad they did.

[+] astine|14 years ago|reply
Article dated to:

"Saturday, August 1, 2009"

[+] karussell|14 years ago|reply
Yeah ... the first thing every guy should do: look at the dates!! Maybe he is now back at the JVM ;)
[+] pointyhat|14 years ago|reply
He should try Go. I'd say it's half way between Java and Python.
[+] sigzero|14 years ago|reply
It has no penetration. Java and Python are both widely used in the industry. Go is not.
[+] voyvf|14 years ago|reply
Or, for that matter, D2.