Lesson 6: Have Fun
In closing, here’s a less tangible but important aspect of Python programming. A com-
mon remark among new users is that it’s easy to “say what you mean” in Python without
getting bogged down in complex syntax or obscure rules. It’s a programmer-friendly
language. In fact, it’s not too uncommon for Python programs to run on the first
attempt.
As we’ve seen in this book, there are a number of factors behind this distinction—lack
of declarations, no compile steps, simple syntax, useful built-in objects, powerful li-
braries, and so on. Python is specifically designed to optimize speed of development
(an idea we’ll expand on in Chapter 21). For many users, the end result is a remarkably
expressive and responsive language, which can actually be fun to use for real work.
For instance, the calculator programs of this chapter were initially thrown together in
one afternoon, starting from vague, incomplete goals. There was no analysis phase, no
formal design, and no official coding stage. I typed up some ideas and they worked.
Moreover, Python’s interactive nature allowed me to experiment with new ideas and
get immediate feedback. Since its initial development, the calculator has been polished
and expanded much, of course, but the core implementation remains unchanged.
Naturally, such a laid-back programming mode doesn’t work for every project. Some-
times more upfront design is warranted. For more demanding tasks, Python has mod-
ular constructs and fosters systems that can be extended in either Python or C. And a
simple calculator GUI may not be what some would call “serious” software develop-
ment. But maybe that’s part of the point, too.
PyCalc: A Calculator Program/Object | 1481