Sponsored Link •
Bruce Eckel talks with Bill Venners about why he prefers Python's valuing programmer productivity over program performance, Python's you-want-it-you-can-have-it attitude, and Python's zen-like learning curve.
Bruce Eckel wrote the best-selling books Thinking in C++ and Thinking in Java, but for the past several years he's preferred to think in Python. Two years ago, Eckel gave a keynote address at the 9th International Python Conference entitled "Why I love Python." He presented ten reasons he loves programming in Python in "top ten list" style, starting with ten and ending with one.
In this interview, which is being published in installments, I ask Bruce Eckel about each of these ten points.
Bill Venners: In the introduction to your "Why I Love Python" keynote, you gave ten reasons you love Python. Number eight was that Python doesn't value performance over your productivity.
Bruce Eckel: Valuing performance over productivity is an issue with a lot of languages. We all know it is good to avoid premature optimization. It's hard not to optimize prematurely when programming, and perhaps the same thing is true when designing languages. Language designers often say, "I see this is going to make your life harder and productivity lower, but because I know performance is important, I'm going to do it anyway." The Python designers said, "No, programmer productivity is the most important thing. We can worry about performance later." That's really what you should do.
So the Python designers try to make Python as fast as possible, but they don't, for example, make you declare variables and use static type checking. They said, "Latent type checking is really an important feature. We're going to make sure that happens, so the programmer gets the best experience." Maybe latent type checking requires some compromise in performance, but it turns out that for maybe 80% of the programs you write, performance doesn't really matter. And for the other 20%, when performance is really important, it's possible to profile and optimize.
Take Zope, for example. Zope is the enterprise application server I use for my website. Zope is virtually all Python, but includes some C code, because they profiled and optimized Zope so it would run faster. When Zope was put on my machine, I discovered it was noticeably faster than Apache had been. That seemed surprising to me, but my server guy said Apache was designed for correctness and not for speed, so it wasn't that surprising to him. Because Apache was written in C, I figured it ought to be faster. But it turned out Zope was faster.