Python 'Lets Me See The Forest'

beliavsky@aol.com beliavsky at 127.0.0.1
Fri Jun 4 13:28:51 EDT 2004


klachemin at home.com (Kamilche) wrote:
>Man, I've been banging my head against a C program for a while now.
>I'm embarrassed to admit how long. I really want to use Python, as I
>mentioned in a prior post, but the speed hit is such that I'll
>probably use it only for prototyping.
>
>But boy, development sure is fast in Python! Today, while playing with
>it, I thought of a better way to arrange my data, that makes the
>program more flexible. It's a good enough idea to warrant redoing my
>code (even my C code) to take advantage of it. When I went to write up
>the pseudocode to process the new method, I found myself naturally
>using Python.
>
>C is just so... detail oriented. By the time I set up the data
>structures, do the string manipulation and memory management, I can
>hardly remember what it was I was initially trying to accomplish, much
>less think of a better way to do it! Maybe I'm just getting old... but
>Python just fits my idea of 'mental pseudocode' so well, it's hard to
>resist using it. Dictionaries ARE an underutilized concept in DP, and
>I was using them up the yin yang, even in my C program. Python meshes
>well with my programming style.
>
>--Kamilche

I am no C++ expert, to put it mildly, but couldn't some of your problems
have been solved by using C++ instead of C? C++ has data structures like
vectors, lists, and maps, with many algorithms in the STL to work with them.
Using references to pass arguments, one can avoid low-level pointers in many
cases. C++ strings are easier to use the C char's. There are templated classes
to replicate some of the functionality of Python's Numeric/Numarray or Fortran
90/95 arrays. C is more of a low-level systems language than an application
programming language -- comparing it to Python seems unfair to me, when the
choice of C++ exists. 

For strictly numerical tasks Fortran 95 is in my experience both more readable
than Python (because of variable declarations and the ability to define constants)
AND much faster. You do not have to suffer Python's performance hit to program
in a clean, high-level language.

(I like Python, but there is so much pro-Python propaganda in this newsgroup
that some anti-Python messages may be a healthy corrective.)



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---



More information about the Python-list mailing list