Saturday, August 1, 2009

Why I gave up on Java and switched to Python

Top five reasons I switched from Java to Python:

1) No more XML config files. Why does everything involving java inevitably involve some horribly complicated XML config file? I think it's not coincidental that the companies pushing java products have large professional service arms.

2) 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. That is, some sizable fraction of the bugs in my java programs were bugs in the type spec, not the executable code. And that type info lets the compiler check for far fewer bugs than you might think. I find that most of my bugs end up being value dependent (dereferencing a null pointer) vs type dependent (assigning a string to an int variable). Sadly, neither language checks for value errors and so you simply have to run your program.

3) It's free software and easier to hack on. The whole source tree compiles easily. The core interpreter is actually pretty small too. If you post an issue or a comment on the core developers mailing list you get a real discussion with the right people.

4) Things in the python world seem to "just work" more often than things in the java world. We spent weeks tuning garbage collector parameters to get Tomcat to produce good performance under load. Python and mod_wsgi literally just worked under massive load with nothing to tweak.

5) I can still relive the good old scheme days and switch to a functional programming style with closures, partial function evaluation, and continuation passing when that makes something simpler. Even better, Python managed to make this all possible with a really simple syntax.
blog comments powered by Disqus