Python Is “Executable Pseudocode”
Python’s very high-level nature means there’s less for us to program and manage. The
lack of compile and link steps isn’t really enough to address the development cycle
bottleneck by itself. For instance, a C or C++ interpreter might provide fast turnaround
but would still be almost useless for rapid development: the language is too complex
and low level.
But because Python is also a simple language, coding is dramatically faster, too. For
example, its dynamic typing, built-in objects, and garbage collection eliminate much
of the manual bookkeeping code required in lower-level languages such as C and
C++. Since things such as type declarations, memory management, and common data
structure implementations are conspicuously absent, Python programs are typically a
fraction of the size of their C and C++ equivalents. There’s less to write and read, and
there are fewer interactions among language components, and thus there is less op-
portunity for coding errors.
Because most bookkeeping code is missing, Python programs are easier to understand
and more closely reflect the actual problem they’re intended to address. And Python’s
high-level nature not only allows algorithms to be realized more quickly but also makes
it easier to learn the language.
Python Is OOP Done Right
For OOP to be useful, it must be easy to apply. Python makes OOP a flexible tool by
delivering it in a dynamic language. More importantly, its class mechanism is a sim-
plified subset of C++’s; this simplification is what makes OOP useful in the context of
a rapid-development tool. For instance, when we looked at data structure classes in
this book, we saw that Python’s dynamic typing let us apply a single class to a variety
of object types; we didn’t need to write variants for each supported type. In exchange
for not constraining types, Python code becomes flexible and agile.
In fact, Python’s OOP is so easy to use that there’s really no reason not to apply it in
most parts of an application. Python’s class model has features powerful enough for
Figure 21-2. Incremental development
1550 | Chapter 21: Conclusion: Python and the Development Cycle