FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 25, 2002
The Python Pattern

Bruce Eckel shifts gears with an overview of Python as a collective concern, sel

Rick Wayne
Perhaps it hasn't yet conquered the world, but Python proponents believe that it's only a matter of time. Developers typically see a tenfold productivity increase when they switch to Python, Bruce Eckel, president of MindView Inc., told Monday's "Design Patterns In Python" class at the SD West conference in San Jose, "Now that's basically an incredible number," he continued. "You can't even imagine what that would mean, but that's what people see, over and over."
April 2002: The Python Pattern

Perhaps it hasn't yet conquered the world, but Python proponents believe that it's only a matter of time. Developers typically see a tenfold productivity increase when they switch to Python, Bruce Eckel, president of MindView Inc., told Monday's "Design Patterns In Python" class at the SD West conference in San Jose, "Now that's basically an incredible number," he continued. "You can't even imagine what that would mean, but that's what people see, over and over."

Since the class was intended for programmers who already know the language, Eckel was briefly taken aback when an initial audience survey revealed a preponderance of Python newcomers. Switching gears with ease, he liberally salted his talk with motivational examples and comparisons to other languages, bringing the audience up to speed within an hour.

True Community
"I feel like Guido [van Rossum] created the language just for me, to make my life easier," he quipped. And since Eckel is an active participant in the Python community, in a sense, that's true: "One of the nice things about the language is that it's much more of a group process, with Guido as the BDFL (Benevolent Dictator For Life). With the Java community process, well, I feel like there's this big wall, but with Python,I feel like I'm actually part of the process."

Tortoise and the Hare
That process does move at its own pace, however. Eckel cautioned the audience against pigeonholing the language as a "failure" because it hasn't mimicked Java's incredibly rapid adoption rate. "Because it's open source, it's just a completely different model. The developers of Python don't have to rush to put in features; they put in whatever they feel can be done well in the time available. It just keeps on going and going, getting better and better."

Time and again, Eckel returned to one theme: that Python tries as hard as possible to get out of the way; to avoid "using up brain cycles on details like where to put in braces." For instance, the Java idiom for opening a file and reading lines of text requires two or more constructor calls and an explicit loop; "I have to look it up in my own book every time," he claimed (Thinking in Java, Prentice-Hall, June 2000). In Python, however, life's much simpler: Two lines and the file's contents are pulled into a list, ready for further processing.

Making Patterns Click
Having sold the language, Eckel moved on to patterns. First, he covered what design patterns are, where they came from, and whether there might be other logical constructs at an even higher level ("Design Structures—these should help lead you toward a choice of patterns"). He took a refreshingly frank tack to the difficulty of approaching these highly abstract concepts, admitting that sometimes a particular pattern doesn't "click" for him until he reads them over and over. He recommended Design Patterns Explained, by Allan Shalloway and James R. Trott (Addison-Wesley, 2001) for those who can't encompass the field with a single reading through the famous "Gang of Four" book (Design Patterns, Gamma et al, Addison-Wesley, 1995). Then he moved on to sample implementations of representative patterns in the Python language.

"Possibly the greatest value in design patterns," he said, "is that they provide us with a vocabulary: a shorthand that allows us to say 'We need a Bridge here' or 'Iterators would decouple that.'"

TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK