"Joe Cheng" <code at joecheng.com> writes:
I'm curious about something... many Artima.com members who have a Java
background and learned Python have come to the conclusion that Java and
Python are highly complimentary languages. They would never consider
filling the place Java has in their toolbox with Python, but recognize there
are many tasks where it really pays to add Python to the mix.
I want to ask you hard-core c.l.p Pythonistas: Do you use Python for
everything? (and I'm counting Python + C extensions as just Python) Or do
you keep another language equally close at hand, and if so, what is it? And
finally, do you foresee a day when Python can be, for all practical intents
and purposes, your only programming language?
In the past I've written C, C++, Java, Lisp, Modula-2, Modula-3,
Pascal, Perl, and Prolog for pay. I've dabbled in a dozen others.
All of these are drifting away as Python takes center stage at home
and at work. I personally haven't written in anything else for over a
year. I also used it through a recent MSCS degree. Of course, I'm
dependent on extensions written in C, C++, and Fortran, plus CORBA,
COM, etc. communication protocols.
Some sysadmin scripts, lots of "glueware" reader/writer adaptors and
automation for COTS apps, lots of code which needs to be portable
across *NIX and Win** platforms. Usually need Numeric and XML, some
SQL, CGI wrappers, etc.
At home I recently wrote a morse code tutor by reimplementing
algorithms (e.g., bit-twiddling to generate pcm) from an OSS package.
Once it worked at all, I changed the algorithm to cache preprocessed
sin approximations (profiling showed I needed the speedup). Then I
enhanced to the functionality of commercial packages. Then added
features (autogenerated QSO's) which I don't think are available
anywhere else. All in a weekend.
How did I get there?
I really liked Modula-3's static and dynamic typing system. Other
static typing systems I've tried pale by comparison. With Python and
good test suites, I don't seem to miss the static typing, and it is
vastly easier to generate working code. I also liked Modula-3's
syntax and namespace system. Python's syntax is cleaner and the
namespaces are simpler-yet-adequately-powerful. (Not too surprising,
given Python's origins)
I used to be a champion for and an instructor for Perl. I still do
code reviews on Perl scripts written by others (shudder). I do not
agree sysadmins will stay with Perl over Python. There is a learning
curve, but the needed functionality is there. We are finding in
complex mixed platform environments, it is easier to install (and
upgrade) Python than Perl. Python is readable by people other than
the original author (important in an era of layoffs and doubling up).
Python is readable by the original author even after being away for
months at a time.
We found we could replace c. 100 LOC of Prolog with a few lines of
python when we needed regex's and other string manipulation. We are
finding we can do Lisp-style programming in Python (lazy evaluation,
mixins, etc.). We find that Python is "a better VB than VB" for
scripting COTS apps via COM. We found python took 1/3 fewer LOC (and
was a lot cleaner) than Java for a geometry task (lots of matrixes and
I've yet to look seriously at C#. My primariy concern is "does it
support open source cross-platform development and implementation"?
As long as it fails that test (e.g., until Mono is fully approved by
Microsoft), I'll stick with a known winner.
harry.g.george at boeing.com
6-6M31 Knowledge Management
Phone: (425) 342-5601