|
Original |
Translation |
|
27
|
In *The New Hacker's Dictionary*, Eric S. Raymond gives the following definition for "compact":
|
|
|
28
|
Compact *adj.* Of a design, describes the valuable property that it can all be apprehended at once in one's head. This generally means the thing created from the design can be used with greater facility and fewer errors than an equivalent tool that is not compact. Compactness does not imply triviality or lack of power; for example, C is compact and FORTRAN is not, but C is more powerful than FORTRAN. Designs become non-compact through accreting features and cruft that don't merge cleanly into the overall design scheme (thus, some fans of Classic C maintain that ANSI C is no longer compact).
|
|
|
29
|
(From http://www.catb.org/~esr/jargon/html/C/compact.html)
|
|
|
30
|
In this sense of the word, Python is quite compact, because the language has just a few ideas, which are used in lots of places. Take namespaces, for example. Import a module with ``import math``, and you create a new namespace called ``math``. Classes are also namespaces that share many of the properties of modules, and have a few of their own; for example, you can create instances of a class. Instances? They're yet another namespace. Namespaces are currently implemented as Python dictionaries, so they have the same methods as the standard dictionary data type: .keys() returns all the keys, and so forth.
|
|
|
31
|
|
32
|
Simplicity is a virtue that should not be underestimated. It lets you learn the language more quickly, and then rapidly write code -- code that often works the first time you run it.
|
|
|
33
|
|
|
|
34
|
If you're working with Java, Jython (http://www.jython.org/) is definitely worth your attention. Jython is a re-implementation of Python in Java that compiles Python code into Java bytecodes. The resulting environment has very tight, almost seamless, integration with Java. It's trivial to access Java classes from Python, and you can write Python classes that subclass Java classes. Jython can be used for prototyping Java applications in much the same way CPython is used, and it can also be used for test suites for Java code, or embedded in a Java application to add scripting capabilities.
|
|
|
35
|
|
|
|
36
|
Let's say that you've decided upon Python as the best choice for your application. How can you convince your management, or your fellow developers, to use Python? This section lists some common arguments against using Python, and provides some possible rebuttals.
|
|