Regular expression code implementation review between Tcl vs Python

Alex Martelli aleaxit at yahoo.com
Tue Nov 11 17:18:39 EST 2003


K_Lee wrote:
   ...
> One aspect I don't understanding about python is that the Python
> language itself is object oriented and all the internal is implement
> as C object.   Why not C++ object?

Using an OO language doesn't necessarily make implementing another
OO language any easier, when the object models are mismatched (and
they almost invariably are).  Look at other opensource OO languages,
such as Ruby, and you'll see they also use C, not C++.

Actually, a small and carefully selected subset of C++ might surely help,
_if_ there was consensus on what that subset should be and net of
the work of hashing that consensus out.  But C++ just isn't very much
in the opensource culture -- C is just much more popular.  Eric Raymond's
book "The Art of Unix Programming" doesn't address the issue directly but
much of what it says about "Unix culture" extends directly to opensource
(as he notes, too).  There are such values as an admiration for simplicity
(cfr. C's principle, as per the Rationale of the C Standard, "provide only
one way to perform an operation", and Python's corresponding "there ought
to be one, and preferably only one, obvious way to do it") which militate in
favour of C (which may not have reached simplicity everywhere but surely
did and does always strive for it) and against C++ (which never gave
language-simplicity a high priority level among its many design goals); even
in subcultures that overtly reject such principles (e.g., Perl's) they may 
still have some subconscious-level effect.

I used to bemoan this back when I was a C++ not-quite-but-close-guru.
3 years later, with little use of C++ in the meantime, I have forgotten more
about C++ than most of it practitioners will ever learn... but C is just 
never forgotten, like how to swim or how to ride a bicycle.  So, I am not
any longer so sure if my "bemoaning" was warranted.


Alex





More information about the Python-list mailing list