On Wed, Jun 27, 2001 at 04:52:52PM -0600, Anthony Chavez wrote: > Mark: > > You're a Python hacker, no? I dunno if I'm a "hacker", I've done a little bit with Python, but not a whole lot, enough to be conversant. > What can you say about it? I like it. Well designed, syntactically clean, good OO model. > I have seen it touted as "better than Perl," That's a frequent comparison. I think the reason the two are fequently compared (with some love lost on both sides of the debate) is because they're prolly the top two "scripting" languages on *nix platforms (ignoring Bourne-shell and compliant derivatives). Perl and Python also have a fair amount of crossover, functionality-wise, which makes them both valid choices for a certain domain of problems. I'm one of those people who can appreciate different things for different reasons, so I like both Perl and Python (but for different reasons). I would actually compare Python more closely to Java. Here's a brief snippet from History in the World Of Mark: - In the beginning, I learned Pascal and I thought: "This is nice" - Next, I learned C and I said "this is better" - Shortly thereafter, I learned C++ and I said "this really brings C to another level!" - After 5 years of coding in C++, I discovered all the "quirks" and foibles that make up C++ and learned the true horror of the language. I vowed, henceforth, to use it as little as possible. - I then learned Java and declared: "This is what C++ always should have been" - I then learned the problems with Java. Some of said problems were technical, but most of them were due to Java being owned and controlled by a big mega-corporation, screwing up a nice piece of technology in the way mega-corporations are wont to do. - Shortly thereafter I heard about Python. For many moons I put off learning more about it, not for any technical reason, but because I was so annoyed with the piss-poor Python "advocacy" that I saw on discussion groups. I was particularly put off by the animosity shown toward Perl, a language that I liked (and still like). Advocates can be their own worst enemies betimes. (OS/2 & Mac advocates have done themselves a lot of harm, IMO.) - Eventually, I overcame my annoyance and was determined to evaluate Python on its own merits, and not on the character of its advocates. After looking at it for awhile I said: "This is what Java always should have been"; BSD-type license, supported / developed by a large net-linked community of programmers and users. Nice. The above historical excerpt is far from complete; I learned many other languages and such along the way, but this is the path that led me to Python. > but from what I've read so far it doesn't even have regexps---or did I miss > something? You missed something. Regular expressions are not a built-in feature of Python as they are in Perl (which is something I really like about Perl, BTW), but are provided via a module called 're'. Documentation link here: http://python.org/doc/current/lib/module-re.html There is even a Perl-compliant regular expression module called 'perlre'. (Handy) > Please be as verbose as possible. /me hands you a soapbox. :-) Gracias for the soapbox. ;-) Other than what I've said above, there's a few more high points I'll bring up: - Small Core: Python seems to have followed the good example of C by having a relatively small "core" of language features and providing more features via libraries. This makes it possible to hold all of the important stuff in your head. - Syntactic Clarity: Mentioned before, but worth repeating. Python seems to have a lot less "line noise" than many (dare I say "most") other languages. Careful attention was paid to keeping things clean. - OO is Built-In / Ignorable: Some languages have had OO features "bolted on" to them after the fact, C++ and Perl are two examples. OO stuff was built into Python from the get-go (much like Java). The nice thing though, is that if you want to just do normal procedural programming, you can; the OO stuff doesn't get in your way. (Considerate of them to have designed it that way.) - Nice Functional Language Features: I have a bit of a functional language bone in my body so it's nice to see functions like 'lambda', 'reduce', and 'filter' built into the language and a native list type. - Whitespace As A Block Delimiter: This is the first thing most newcomers to Python see and it usually illicits a viceral, nauseous response. Such was my first response as well but I've come around: getting rid of brackets means you don't have a zillion different bracket-placement coding styles; having a whitespace be part of the coding structure means you can read anybody else's code because there's very few ways for them to obfuscate their code. There are a lot of nice features of Python and they seem to have taken some steps to reduce a lot of common problems and promote clean coding style. That having been said, it is still possible to write ugly Python code. (Take a look at the code to "mailman" some day. Nice Mailing-List daemon, really ugly code, all written in Python.) Bottom Line: Give it a shot, I think you'll like it. A good place to start is the Python website: http://www.python.org Cheers, Mark Whitley mark.k.whitley@gmail.com