Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Guido Von Rossum on Python 260

deran9ed writes ""People can get quite emotional about Python, in a way they rarely get about software," says van Rossum, who is now director of Python Labs at Digital Creations. In this question and answer interview, he explains why Python deserves such loyalty, when it is better to use Python than Perl, and why increasing numbers of business applications developers will be using Python for years to come. THe full article is on SearchEnterpriseLinux"
This discussion has been archived. No new comments can be posted.

Guido Von Rossum on Python

Comments Filter:

  • > > Python is used pretty much across the board, much more across the board than Perl.
    > Who is he kidding?

    I think you've taken this up wrong. I think he
    meant that Python is more suitable for a wider
    variety of applications than Perl, which sometimes
    shows its origins as a string processing language.

  • Edna [sourceforge.net]is a streaming MP3 server that allows network access of mp3 files over HTTP. I also found another useful article on the O'Reilly network about analyzing sound files in python [oreillynet.com]
  • You wouldn't normally find me evangelising about this or that language.. but since I started using Python ('bout 18 months ago) I've barely used anything else.. it's a truly impressive acheivement, I believe, and a superbly pragmatic one at that. The sheer speed with which you can get an algorithm down in Python is, IMO, it's greatest strength. Add in to that all the object oriented features that you'd generally use day-to-day in C++, great ease of embedding and extending, powerful, *native* data structures and 90% cross-platform compatibility, clear syntax.. it's just *such* a productive language. I used to be a serious C++ guy but these day's I only go near that if I really have to.. for high performance apps were you *really* have to squeeze that last bit of performance (and, honestly, how many of those are there these days with clocks so cheap) I just migrate the critical bits to C/C++ and use a Python main line to drive 'em.. (see SWIG [swig.org] for a cool way to wrap existing code). I ain't gonna get into the Perl argument.. personally it just looks to me like the Perlophiles are just arguing against to protect their intellectual investment. IMHO, Perl is nothing like a full or proper language. Python can certainly claim to be.
  • X is "killer app" for Y, means the following:
    X attracts people to Y, because no other system can provide X.

    In your example, professional color features (Pantone, CMYK, etc.) is the "killer app" features for Photoshop.

    You're right, cool program can not be "killer app" for a language just becaus it's cool. Of course, we could imagine it's not possible to write some progam X in any language other than Y... That would make the program X "killer app" for Y. But that's just speculation, Zope is not such a program.

    However, Zope is not just a program. It's rather a framework, allowing you to ad your own code to the system. So, theoretically it could be the "killer app" for Python.

    ...But that's not. There's no compelling advantages over 2-tier architectures like apache+mod_perl+HTML::Mason from one hand and 3-tier J2EE applications from the other hand. Yeah, yeah, I know, some things are better in Zope. But that's not a "killer app" by any means.

  • Perl == Good
    Pyhon == Good

    If you Python and Perl people don't quit yer fighting, I'm gonna force you all to use nothing but Visual Basic!

    If you don't stop it right now, I'm turning this bus around and we're all going back to Microsoft!


  • Personally I think Python and Perl are the same toolkit with trivial differences in syntax, and wish language designers would take a leaf out of Mark-Jason Dominus's book [perl.com] and go easy on the theology.

    But, FYI, Perl has a coupla thousand killer apps, most of which are available on CPAN [cpan.org].

    Industry Standards include:

    The Beatles never flamed the Stones. The Stones never dissed the Beatles. And at no time did either party rip on Bob Dylan or badmouth Marvin Gaye. Language designers should celebrate their brethren. Particularly when the similarities so overwhelmingly outnumber the differences.

    Perl is worse than Python because people wanted it worse. Larry Wall, 14 Oct 1998 [www.amk.ca]

    Frankly, I'd rather not try to compete with Perl in the areas where Perl is best -- it's a battle that's impossible to win, and I don't think it is a good idea to strive for the number of obscure options and shortcuts that Perl has acquired through the years. Guido van Rossum, 7 Jul 1992 [www.amk.ca]

    When I originally designed Perl 5's OO, I thought about a lot of this stuff, and chose the explicit object model of Python as being the least confusing. So far I haven't seen a good reason to change my mind on that. Larry Wall, 27 Feb 1997 on perl5-porters [www.amk.ca]

    If Perl weren't around, I'd probably be using Python right now. Tom Christiansen in comp.lang.perl, 2 Jun 1995 [www.amk.ca]

    Python is an excellent language for learning object orientation. (It also happens to be my favorite OO scripting language.) Sriram Srinivasan, Advanced Perl Programming [www.amk.ca]

  • I know Perl. Perl has its quirks. I heard about Python and read up on it. I liked it for the most part but hated the enforced spacing rules. Reminds me of COBOL. Then I picked up the pick-axe book for Ruby and found the ultimate scripting language. Why use Python instead of Ruby?
  • Which is ACTUALLY the Anglicized version of vanRossum.

    That is, if we want to pick nits.

    KFG
  • You didn't even need to say that you won't consider python as your language, it is obvious from your lack of open-mindedness. When I first used it I thought that it would a difficult transition. Within two days I liked python's methods of doing things much much better. Python codee is very very clean and makes working with other people a breeze. It is elegant and the more you know, the more precise it can get. Try reading the official tutorials, they don't take too long and you can learn python in anywhere from 2 days to a week. It took me about 4 days of alot of reading. You should try it before you bash it.
  • It's pining for the fjords.
  • Mathematical proofs are only sometimes clean and elegant, and they're virtually never comprehensible by someone who isn't a mathematician in the same field (unless you're talking about very basic proofs). Mathematical proofs are one of the most obscure pieces of language that you'll find on earth, not one of the clearest, as long as you're talking about people who aren't completely fluent.

    Anyhow, I don't use python for two reasons:
    1. Perl can do anything that python can with about as much ease (minus the facts that they each have a few minor strengths and weaknesses that the other is better or worse at)

    2. The general arguments in favor of python come in the form of either
    (a)I'm too stupid to understand perl so python is better
    (b)I just like python better because it's so regular

    Well, I like perl so much because it's irregular. As larry wall once said, "Since English is a mess, it maps well onto the problem space, which is also a mess, which we call reality. "Similarly, Perl was designed to be a mess (though in the nicest of possible ways)."

    I always find it kind of funny when people talk about coding in natural language, since perl is in many ways quite like a natural language. For one thing, it's gone through a sort of huffman-coding: the stuff you use a lot is short and easy to use. Also, the same character or groups of characters can mean different things in different contexts. This is another piece of efficiency as in general it means that you can use the shorter stuff more often, and have to remember fewer symbols.

    The great part about perl is that it is a language in a very real sense. It is quite irregular, but quite usefully irregular. And the best part is that it has no hangups about being irregular when it would be useful to do so. That's why, I think, so many people find perl to be so fun. It was designed to make the easy stuff easy and the hard stuff possible, not to make Guido Van Rossum happy if he looks at your code.

    And that, I think, is the reason that I'll do my best to never use python - I don't like people telling me how to do things. One of the fundamentals of python is that it enforces Guido's coding style as much as possible. That's just not a friendly environment. Who wants to trust an interpreter which doesn't trust them?
  • But you can just do
    foreach (2,4,6,8) { print }
    with perl. That doesn't seem weird to me.
  • Pearl [uni-hannover.de] is a language.

  • True, true, true. Ok, so it's the pathetic excuse for lambdas IN ADDITION TO reference counting that keeps Python firmly in the world of joke languages. But it's so close! It's frustrating in the extreme to have to deal with a language that's ALMOST the right thing. Why can't more people get on the LISP bus? Are they just so ignorant (please don't answer)?

    Peace,
    (jfb)
  • """
    for(0..10) {
    print unless($_%2);
    }
    """

    Is this example supposed to *dispute* Perl's reputation for unreadability, or is this a joke?

    -DA
  • You just helpt him poove his case.

    I've written a LOT of perl in the past but I switched to python because of the strange artefacts like $_.
  • Detail: modding by powers of 2 is implementable as a bitwise AND, which is damn near close to the most efficient thing that you can do on your computer.
  • Have to agree here.. *readability* which, IMHO, is one of the most important traits of any system of notation (which a programming language most definitely is) is one of Pythons greatest strength.. principally because so many of the concepts and structures are suitably similar to the language the most of us probably know.. C++.
  • Sure, "von" just means "from" or "of", but when you hear "William of Orange" or "Nicholas of Russia", do you think of grocers and farmers or of lords and kings?

    Those who view the area as "theirs" tend to reserve its nominal use to themselves.

    Didn't this arise as a minor issue with regard to Valery Giscard d'Estaing a few years back?

  • The german "von" does indicate some sort of Aristocracy. This is the same in English; the bad "Guy" in Robin Hood is "of Gisbourne", which would be taken to mean he rules the place rather than just lives there.

  • by costas ( 38724 ) on Friday March 16, 2001 @01:07AM (#360052) Homepage
    Yeah, I used to make fun of that too. I'll tell you a little (true) anecdote: I first heard of Python here on /. and its reliance on whitespace for code structure. I laughed and thought that was *such* a stupid idea.

    I found it so funny in fact, that I went back to a couple of colleagues and started using Python as the punchline to an in-house joke: you see at the time we were looking for an embeddable scripting language. Python became a threat: "you'd better not do that, or I am gonna embed Python in the server".

    Then, I started running into Python on the net, first because of Zope (of course) then on other cool little projects. I started to get curious, and downloaded the language and ActiveState's win32 extensions. I picked a small in-house project to test it on and I was pleasantly surprised: I went from making fun of it to piping serialized Python objects over HTTP (from NT to Unix and back no less) in --literally-- 3 days.

    I dunno what your measure of a good language is, but that ease of use and versatility sold me. And, BTW, Python is now my company's embedded language of choice.
  • While these languages are interesting, they do not have the same advantages as Python. Some examples would be a clean readable language, a cohesive standard library, a simple syntax, and a strong OO heritage pulling from background such as smalltalk. Ruby and Lisp do interesting things of their own, but are not languages I would consider in the same breath.

    And which of these examples gives Python the advantage over Ruby? I think, your examples are exactly the description of Ruby virtues.

    Well, of course, I still prefer Perl to those two; but at least Ruby has something that Perl doesn't (-123.abs or mixins, for example). Well, Python also has a unique feature - significant white spaces, but I'd rather live without it ;)

  • I like perl and I do not know python very well. Like everyone, I've heard python proponents advocate their language, and I've been largely unimpressed by their advocacy. Their advocay generally takes one of the following forms:

    1. "PERL SUCKS!!!"

    I see this one often. Lots of people seem to hate perl for reasons of varying validity.

    2. "Python is better than perl"

    Like it or not, this is just a toned-down version of #1. Python is better than perl ... because perl sucks. So this really isn't a way to advocate python as much as it is a way to bash perl.

    3. "Python is elegant"

    I heard Larry Wall speak at the Atlanta Linux Showcase last year, and he identified "Programmers care about elegance" as one of many myths about programmers. (This is where the anti-perl crowd screams, "It's fitting that that bastard Wall would say something so brain-dead lame!!!") I care about how useful and powerful a langauge is, not how elegant it is. We all know how far elegance took the ivory-tower language known as LISP. If python becomes popular, I believe it will be so because it is useful, not because it is elegant.

    4. "Python is object-oriented"

    My response to this is: so what? OO programming, while good for many things, is overhyped. OO languages are a dime a dozen.

    5. "Python is truly object-oriented"

    You'll often see this statement coupled with other statements like, "Perl's object-orientedness was a hack," "Perl's object-orientedness was added later, while python's was included from the beginning," etc. In other words, "perl sucks."

    In the article, Guido was generally fair but couldn't help having his argument tainted by #1 and #2 (above). When it comes down to it, I don't want to use python partially because I don't want to be associated with the vitrol which pervades its proponents. It's just a programming language.
  • I've been using Python in my current work environment to thest my COM+ objects. I use it in preference of VB, so as not to scar myself permanently.

    Besides the religious beliefs in better computing practice, Python is simply just faster, and easier to get going. (Now if only I can sell it to the rest of the crowd...)
  • Anyone know if you can write music apps in python? digital audio? Just curious...
  • by F2F ( 11474 )
    for those of you who really care, his name is Guido Van Rossum CmdrTaco wouldn't like being called 'CmdrBurrito' in the media now, would he?
  • I'm not a Python proponent (Ruby actually), but how about: "Python has thread support. Perl doesn't". Yes, there are *experimental* threads at the moment in Perl, but even the docs say they shouldn't be used in production due to problems and the possibility that the API could change. Of course, I would use Ruby for this. :) Dan
  • Python has an advantage in that it changes the way you think about programming in a language, suddenly whitespace is important. Its the little things, that make you rethink what you already know about languages. I'd like to start over and learn Python as my first language. This one was designed, not evolved from the past.
  • by f3e2 ( 235629 ) on Friday March 16, 2001 @05:22AM (#360062)

    Learning Python is not hard (remember how long it took you to learn Perl?) -- you can do it in an evening by reading any one of these free (and Free) online books:

    • Dive Into Python [diveintopython.org] - written for the Slashdot crowd, it assumes you know one real language (like Perl, Java, or C++) and takes you from there. Steps through real code to teach you the language basics (and not-so-basics), and makes frequent comparisons to the language(s) you already know.
    • How To Think Like A Computer Scientist (Python version) [ibiblio.org] - better for those with less programming experience. Not as detailed, but gentler.
    • Learning To Program [crosswinds.net] - for those with no programming experience whatsoever who want to learn Python as their first programming language.

    Once you've read any or those, you'll want to dig into some real code, so head over to the Python Knowledge Base [faqts.com] for tons of real code examples, and Vaults of Parnassus [vex.net] for tons of free third-party modules and libraries.

    -M

  • by Domini ( 103836 )
    The licensing is frightening off a number of people, but I think that you may see that Python will move toward a GPL license soon.

    I have no hard evidence of this, but a number of things point toward this.
  • This is from Smalltalk, which predates Eiffel by a long long time. I think Smalltalk like we know it today is from the period of 1976-78 or so, distilled more formally around 1980. I believe in Smalltalk it looks like 5 timesRepeat: [do this], the for loop looks like 1 to: 10 do: [ :i | block] which seems similar to Ruby as well. I think some of the idea of simple closures instead of functions as objects came from Logo. I.e., you don't pass functions around, you pass closures -- Smalltalk has no concept of functions, only methods, so this was the solution. Logo did it this way just because it was most intuitive.
  • How do you come to this conclusion? A BSD license seems nearly certain to me, which is more or less what Python has always had except for some minor (though not insignificant) provisions that Guido's employer added (Center for National Research Initiatives...?) It seems like it's only a question of managing some politics at this point, which seems fairly certain to work out.
  • The Zope site is terrible - trying to find documentation is a nightmare, and trying to find the solutions to what would appear simple problems, like 'how do i use a single, global images folder?' are nowhere to be found in the official docs.

    The 'search' facility is brain dead, and it looks to me like nothing has actually been done to the Zope project in the year or so i have been following it, short of bugfixes for the security holes in the product.

    Most of the 'Zope Products' indexed on the website are hopelessly out of date and don't work with the current version of Zope.

    I have evaluated Zope in the past, and am building a site with it at the moment as an experiment, but I don't think it's a 'Killer App' by any means.

    Maybe when it gets a WYSIWYG editor bolted on instead of the TEXTAREA-based editor, and a support site that isn't a total abortion - if theres anything that would put a potential Zope user off, its the Zope site, then they might have something.
  • Anglicized? Not really...

    'von' is the German version of the Dutch 'van' prefix (or vice-versa). I think in Germany a 'von' prefix indicates nobility (e.g. Werner von Braun).

    The Anglicized version is just to leave out the spaces and say 'Vanderbilt' instead of 'van der Bilt'.

    Regards,
    Xenna

    (Who should be recognized as an expert on this trivial subject, having 'van der' in front of his *real* name.)
  • There are a ton of languages that are better than Python in every way a language can be. It's a shame, really -- so many good ideas, so little actual success. Python just made the right compromises, and managed to stay in existance for those first painful years of seemingly pointless development. Dylan was a research effort, and like many research efforts the implementors didn't really have the will to make it succede.

    Now that Python exists, it may be hard for even those with will -- Ruby and Rebol, for example -- to succede. There was a niche for Python to fill, something that Perl and Tcl didn't quite cover. Tcl is gone, is there enough of a gap in what Perl and Python achieve that there's room enough for another language? I'm not sure. No new language is going to supplant an old language -- at least, not until it has gained a significant following on its own.

  • Snack: http://www.speech.kth.se/snack/ [speech.kth.se]

    Here's a blurb:
    """
    The Snack Sound Toolkit is designed to be used with a scripting language such as Tcl/Tk or Python. With Snack you can create create powerful multi-platform audio applications. Snack adds commands for basic sound handling, e.g. sound card and disk I/O. Snack also has primitives for sound visualization, e.g. waveforms and spectrograms. It was developed mainly to handle digital recordings of speech, but is just as useful for general audio. Snack has also successfully been applied to other one-dimensional signals.
    The combination of Snack and a scripting language makes it possible to create sound tools and applications with a minimum of effort. This is due to the rapid development nature of scripting languages. As a bonus you get an application that is cross-platform from start. It is also easy to integrate Snack based applications with existing sound analysis software.
    """
  • What people are missing in this forum is that Python is probably the most extensible language out there

    Is there something available for Python like the Inline:: modules for Perl? These are modules which make it possible to stick C, C++ or Python right in the middle of Perl code. What would be really cool is if there is a way to hook up Python with any of the thousands of Perl modules which exist out there. One of the nicest thing about Perl is CPAN [cpan.org], a huge online repository of Perl modules for doing just about everything. It would be cool if a Python script can access, say, Perl's Net::AIM module (which provides a nice class interface to AOL Instant Messenger protocol).

    Python and Perl are both really nice languages. Anyone who's never used them should give them a try. For certain tasks, it's amazing how much faster you can do things in comparison to, say, C++ or Java or VB. (But every language has its place; I don't believe the "one language fits all" claims that people sometimes make).

    Python vs Perl is largely down to personal preference, and what code/modules are currently available that you can build on top of.

  • I agree its a pretty cr*p article, especially, when you consider how articulate Guido is on almost any subject.

    It reads like he was interviewed over the phone while he was trying to shave.

  • by kfg ( 145172 ) on Friday March 16, 2001 @01:30AM (#360087)
    Actually, the Stones dissed the Beatles shamelessly and nearly incesantly. It was, in fact, part of their 'image.'

    When a reporter went up to Jagger and told him the Beatles had broken up and asked for his reaction he replied, " Great, that means that now WE'RE #1!"

    Little did he suspect that 30 years later the Stones would still be touring, and that the Beatles would STILL be outselling them.

    Kinda like loosing an election to a dead guy.

    KFG

  • by AirSupply ( 210301 ) on Friday March 16, 2001 @01:31AM (#360088)
    I've been Zoping for a couple of weeks now, and I'm getting the hang of it slowly. I think it's a damn handy content management system, the kind of which most web developers seem to re-invent every time they do a project, only they don't do it so well as Zope. Having more or less completed a teeth-cutting project on it, I'm of the opinion that it's the best available choice in its class. Maybe I just don't know about the better alternatives — I'm interested in hearing about options. Even so, I'd be game to undertake a small-but-serious project in Zope now, such as an Intranet or simple user-manageable website.

    On the other hand, I have issues with Zope. The documentation is incomplete, and the help system has big smokin' holes in it. There's a Zope documentation project, but I have a problem with systems like this where the code is the spec, and the documentation is being written from that — my own particular anal retentiveness factor, I suppose. Zope doesn't behave quite the way I intuited in the getting-to-know you phase of our relationship, and I've had to readjust my think for a number of Zopisms as I go. Also, the naming conventions (plural) suggest to me a certain cobbled-together-ness — an impression which is carried further by the spotty documentation, etc.

    If you want to know about my personal bias in languages, I think Perl is truly amazing in the sense that any language which is so butt-ugly in terms of its syntax and structure (inheriting from C, AWK, and shell scripts???) can be so mind-bogglingly useful and easy to use in practice. On the other hand, all the Perl hackers I've worked with produced utterly vile code. Mind you, they produced pretty damn awful C too. I'd prefer to be working in Python if I had to work with them.

    And of course I do work with them, but the powers that be won't let us use Python on the basis that it's not a skill you see on resumes as standard yet. Thank God for The Corporate Mentality, no?

  • This looks a bit like SuperCollider (an object-oriented DSP-processing language on the Macintosh); at least the idea of all types having methods does.

    I think SC is derived from/inspired by some other OO language. Which language did constructs like '5.times {do this}' come from: Smalltalk? Eiffel?
  • by hobuddy ( 253368 ) on Friday March 16, 2001 @01:40AM (#360094)
    "Perl is worse than Python because people
    wanted it worse." - Larry Wall, 14 Oct 1998
  • Actually, one thing that annoys me about perl is the fact that it's almost impossible for an editor to syntactically highlight it perfectly. Although this is hardly ever a problem unless you're intentionally being obfuscated....
    In my Copious Free Time, I'm writing a parser for MIF ([Adobe Frame]Maker Interchange Format) in Perl. An earlier version of the module included these lines:
    #}}}}
    #^^^^ this makes cperl-mode happy
    ...and I don't think I was intentionally being obfuscated.

    These comments followed the string describing the grammar, which contained Perl code for the semantic actions, and which was fed to a method in a parser-generator module. (I tried including a few lines of the code in my post, but Slash gave me the error message: "Lameness filter encountered. Post aborted. Reason: Junk character post." Harrumph.)
    --

  • I am not familiar with Inline::, but... AFAIK, there is "perlpy", a Python module for hooking up to Perl. Jython pretty much is Python in Java, so you can subclass/extend/whatever Java from Python and vice versa. ActiveState's win32com extensions to Python allow full win32/MFC scripting from Python. Tcl is definitily hookable, as there is Python/TK which basically uses Tcl in the middle. I've seen MATLAB modules as well.

    For compiled languages, anything that's hookable to C, it's easily hookable to Python. SWIG (swig.org) is of course most people's generator of choice (it does Perl as well, to be fair) but there is also a C++ API (CXX), several Fortran APIs and I dunno what else...
  • Oops. I guess my Ruby really is shady, but at least I spotted it. The name of the message I meant is actually step, not upto. The latter takes only one argument. Substitute as required. Thanks.
  • Ahhggg. This brings back horrible memories of huge FORTRAN that would be flattened by one *SPACE* out of wack. It's a pain. A real pain.

    The trick is to use a decent editor which has good syntax highlighting. Then, at the point where your error is, everything will turn red (or green or ...). This also applies to C++ and Perl and other languages which don't rely on whitespace - it becomes much easier to spot the odd unescaped quote.

    Actually, one thing that annoys me about perl is the fact that it's almost impossible for an editor to syntactically highlight it perfectly. Although this is hardly ever a problem unless you're intentionally being obfuscated (e.g. print qq]hello, world\n];, or s/([^ ])([abc])/local $_ = $2;y!abc!ABC!;$1.$_/ge;, or ${rand > 0.5 ? "b" : "a"}++;).

  • you've written 10000 lines of perl and you didn't think of this?
    You've got a good point, but a a clearer example might be this:
    foreach $i (2,4,6,8,10) { print $i }
    or maybe this:
    print for 2,4,6,8,10
  • People can get quite emotional about Python, in a way they rarely get about software.

    Whatever.

    People (read: geeks like us) get quite emotional about software in general, and about languages and operating systems in particular. I work in an office where Perl is the dominant language, and the Perl-heads here are quite passionate about Perl. I'm mainly a C programmer myself, and I can get quite passionate about C. (This becomes especially amusing in my office, because I'm implementing a library for C that provides the functionality of Perl, so we have wonderful lunchtime arguments about that, too.) I've seen people get quite overheated about PHP, Python, C++, Eiffel, ML, Haskell, Prolog, Scheme, Forth, assembly language, and pretty much every other language I've encountered, including COBOL and RPG. (Hard to believe? Pick a fight with my mother.)

    It's just the nature of the beast. To use and like a language, you have to get deeply into it, and once you see its full possibilities, it's irritating to have to debate them with someone who doesn't know the language as well. The assertion that people get more passionate about Python than other languages is just either pure BS, or else it's marketeering by Guido.

    I've used Python, and while I agree it's cleaner than Perl, it also has some annoying features, too. Just like every other language. Frankly, I think Icon is a better text-handling language than either Python or Perl, but that's just my personal needs and prejudices speaking.

    What I don't understand -- and this could be equally well aimed at C++ and Java as Perl and Python -- is why people find a language they like and insist that everyone else must use it. It's generally acknowledged that the peculiarly American habit of insisting that everyone speak English is asinine; I wonder why the same conclusion hasn't been reached about programming language advocacy. All non-trivial languages have strengths and weaknesses, and there really isn't much to recommend one over the other except personal preference and practical requirements, i.e., what you already know and the nature of the task at hand.

    Diversity is good. This applies no less to tools than it does to people.

    --

  • The PalmOS version is cool... is there a BSD version?... I didn't see it on the versions page.

    Assuming you mean FreeBSD, just log in as root, and execute "cd /usr/ports/lang/python ; make ; make install".

    If you don't mean FreeBSD, well: the CPython interpreter is fairly portable, IIRC, and should build under most unixes with little trouble.

  • And of course I do work with them, but the powers that be won't let us use Python on the basis that it's not a skill you see on resumes as standard yet. Thank God for The Corporate Mentality, no?

    You know, sometime things that don't make sense to you actually do make sense. While it would be nice for us if management let us pick whatever tools and languages we want, the fact of the matter it that they are going to have to have people maintain this system long after we leave. It would be a very bad thing for them if a developer created a successful product in Python, and then left. Trying to find a replacement would be very hard, and even when they do, how would they even be able to test his actual skill in Python (with the resident Python expert gone). After hiring someone, and he says the project need a rewrite, how could they tell if he's snoballing or not? In this case, I agree with the powers that be. Sometime the best tool for the job doesn't include technological factors.

  • I have seen a plethora of projects successfully that used Perl, and exactly zero that used Python.

    Here's three for you, and chances aren't bad that you've already come across any or all of them:

    • maps.yahoo.com [yahoo.com], a map finding search system written in python
    • mailman [list.org], a mailing list software package written in python
    • RedHat's installer (can't find a URL -- try here [earthweb.com]?), an installation package written in python

    So. Now you've seen three major projects written in Python, and chances are this isn't the first time you've seen one or all of them. Like Linux, Apache, Sendmail, and yes Perl, if you use the internet at all then you probably interact with Python all the time without necessarily realizing it. It's a nice, clean, scalable lanaguage who's one main drawback -- it's slow -- is handled nicely by the fact that it's so easy to integrate it with C. As a result, it gets easy to maintain a large, complex project in Python while optimizing bottlenecks with pure C modules.

    Perl can pull some of the same tricks of course, but it's much messier. I like Perl, I mainly use Perl, and I'm not knocking it. But I really can't see the point in arguing the matter: Python is a much cleaner language that is far better suited for large scale projects. If you haven't come across it yet, maybe you just haven't done anything big enough yet.



  • Python ( http://python.org/ [python.org] )
    + Qt ( http://www.thekompany.com/projects/pykde/ [thekompany.com] )
    + Firebird ( http://firebird.sourceforge.net/ [sourceforge.net] )
    + gvib ( http://www.zope.org/Members/RETierney/gvibDA [zope.org] )
    =
    A delicious cross-platform substitute for my obese friend Swing.

    ---
  • I've written a LOT of perl in the past but I switched to python because of the strange artefacts like $_.

    An alternative option is to put "use English;" at the top of your script. Then you can call the $! $? $_ $% $, $; variables by their more readable names: $OS_ERROR $CHILD_ERROR $ARG $FORMAT_PAGE_NUMBER $OUTPUT_FIELD_SEPARATOR $SUBSCRIPT_SEPARATOR etc.. You can tell they're "magic" variables, cos in Perl the convention is that upper-case variables are ones which mean something special to the interpreter.

    open HANDLE, "hello.txt" or die "cannot open hello.txt: $OS_ERROR".

  • You'll often see this statement coupled with other statements like, "Perl's object-orientedness was a hack," "Perl's object-orientedness was added later, while python's was included from the beginning," etc. In other words, "perl sucks."

    Perl's object-oriented mechanism does suck. It's too verbose (you have to write $self->{'fieldname'} = 1; where fieldname = 1; would be more appropriate), and it's slow, because there's a hash lookup for every local field reference. It wouldn't be hard to build a better syntax into the language and handle object fields at compile time, and I hope this gets done in Perl 6.

    Perl is slowly moving down the path of C. C started out without function prototypes, without a serious type model, and without objects. Over time, it acquired all three. However, Perl doesn't have to become as static as C/C++ to get it right. Look at Smalltalk, which has about the minimal amount of declaration machinery required for an OOP language. That's where Perl ought to be headed, but with Perl-like syntax.

  • The main reason I don't feel like continuing on in Perl is because I once seriously shot myself in the foot due to Perl's lack of easy to use and easy to understand complex data structures. Python has classes

    Were you using perl v 4?? (released in about 1992) Modern perl has classes! man perltoot.

    use Net::FTP;
    my $ftp = Net::FTP->new('ftp.server.com', Debug => 0);
    $ftp->login('anonymous', 'e@mail.address');
    $ftp->get('file.txt');
    etc.

    And error checking as well. The following is probably wrong Perl:
    $variable = 1; print $varaible; But it isn't an error.

    I take it you never put "#!/usr/bin/perl -w" at the top of your perl scripts? Look at man perl, and search for "-w" to see quite how many times you're told to enable warnings like this. Also put "use strict" at the beginning of your scripts.

    BTW, if you do "-w", the error you get is this: Name "main::varaible" used only once: possible typo at -e line 1.

  • .... not Python, where OOP has not gone too far from that of Perl.

    That's because Perl's OO used Python's as a model, so of course they're similar.

  • by Scrymarch ( 124063 ) on Thursday March 15, 2001 @10:03PM (#360148)
    I don't know much about Python... but is it very cross-platform? Is there a reason you'd use Python over Java if you wanted to run your application in a few different environments?

    The standard Python implementation is interpreted, it's as cross-platform as Perl or Java or whatever. There's also a pure Java implementation of Python, Jython [jython.org], which I've found very useful as a scripting tool in a Java environment, as you get full access to Java classes from Python.

    Python is a scripting language, so I use it in preference to Java where a script is called for, eg - rapid development environments.

  • I am not gonna argue that Python has more features or tools than Perl. God no... and Python IS sorely missing a CPAN-like archive (no, the Vaults won't do).

    The main difference (besides subjective likes/dislikes, of course) between the two, is that Python is a descendant of general-purpose languages (albeit, mostly academic ones), while Perl is a descendant of specialized languages (shell scripting, AWK).

    As a result Python tends to be easier for begginers to understand. That's not a bad thing, and it's not trivial either...
  • If you honestly think that Python's signficant whitespace is a serious problem, then my advice to you is to get a real text editor.

    Honestly, Emacs's Python mode is so straightforward that it's almost comical. I missed the semi-colons and braces for approximately five seconds. Vim will also do all the "hard" work of indenting for you. I suppose if you are still editting in ed Python might be problematic, but that's not Python's fault.

  • by dkwright ( 316655 ) on Thursday March 15, 2001 @10:04PM (#360152)
    What I got from the article:

    Python is a cleaner language, thus better for larger projects and teamwork.

    Granted, if true, that's a worthwhile thing. But's that's precious little to say in the way of discussing a language, and it's quite vague. C'mon, how about some more discussion of features of the language. How about some real comparison, with say, strengths and weaknesses of Perl. My knowledge of Python (almost zero) has increased not one bit after this article.

    Basically, the article amounts to: Hey, I wrote Python and I like it. It's better than things I didn't write.

    Is this an interview or a press release?
  • by slashkitty ( 21637 ) on Thursday March 15, 2001 @10:04PM (#360161) Homepage
    Ahhggg. This brings back horrible memories of huge FORTRAN that would be flattened by one *SPACE* out of wack. It's a pain. A real pain. It's the reason I won't even look at Python as a language for me.

    Don't get get me wrong, attention to detail in programming is a good idea. Formatting your programs is very important. Spaces should not be. They are the void on the page. Various editors treat spaces, that is, it's harder to manage in some. It's just a shame that they put this 'feature' in a language.

  • I have looked at zope on and off but I gotta admit I am having trouble taking the plunge. I took to PHP like fish to water and really like it a lot but PHP has some onnoyances that I'd like to get rid of.

    What does Zope offer to me? DTML looks overly verbose and too hard to read and besides one of the reasons I want to ditch PHP is so that I won't be mixing code and HTML in the same page. I like the built in user management and the hierchical system but is it worth learning a new language? how about performance?

    Please tell me what makes zope so good that I'd want to take the plunge.
  • I don't know much about Python... but is it very cross-platform?

    Yes. It even has bytecode, that (IIRC) can be run on any platform that has the correct Python interpreter.

    As for GUI-toolkits, there are several to choose from, and they are supported on several platforms, but probably not as many as Java AWT/JFC.

    Is there a reason you'd use Python over Java if you wanted to run your application in a few different environments?

    Yes, you would be using Python instead of Java. That's a plus.. ;)

  • I don't know python and I might like to learn it. Before I do though..

    What I like best about perl is CPAN. Perl can find and load a CPAN module for you and CPAN is full of well documented well tested code which saves me days and days of work.

    Does python have anything resembling CPAN?
  • I don't like whitespace. Especially if your code is over a screen long and has multilevel ifs and whiles and such. As you get to the bottom of your code you never really know what you are closing. I also don't like braces for the same reason. What I do like is the new PHP
    if:
    else:
    endif;

    blocks PHP now supports a endoperator for every structure including foreach, switch, while etc..
    super cool.
  • I've used both languages in a professional capacity, and I'd definitely use Python (that's C-Python, either Python/Tkinter or wxPython) for building GUIs instead of Java. Since both of these languages have excellent XML support, you could use Python for the client and Java for the server, no sweat. You *could* implement both sides in Python, but your SQL support in Python is relatively limited compared to Java. I'm also guessing that Java would be at least marginally faster for handling complicated server-side logic, even compared to "compiled" Python.

    On that note, it would be rather interesting to see Java and Python go head to head in a bunch of code benchmarks, no? :)

    ObJectBridge [sourceforge.net] (GPL'd Java ODMG) needs volunteers.

  • I'm learning Python now. It's a much cleaner language. Consider the following Perl:

    for($i = 0; $i < 10; $i += 2) {
    print $i;
    }

    And the same in Python:

    for i in range(0,10,2):
    print i

    How about this in perl:
    print foreach 1..10;

    or just this:
    print 1..10;
    (admittedly that doesn't generalize well)

    I'll overlook the fact that you didn't know about the suffix statement notation (putting the foreach after the action), which few people use because it *is* confusing. But you didn't even use the range operator, choosing the most noisy syntax possible instead.

    $variable = 1;
    print $varaible;

    use strict. that's what it's there for. You are simply not qualified enough in perl to make the comparisons you are making.

    --
  • .. it's so portable, it will even run under perl - Inline::Python ;-)

    .. if your a masochist. ;-P

  • by scrytch ( 9198 ) <chuck@myrealbox.com> on Friday March 16, 2001 @10:39AM (#360180)
    > The trick is to use a decent editor which has good syntax highlighting

    And install it on every last machine you will ever find yourself editing code from, in every environment you could possibly use, making sure you got your bases covered for editors on Solaris, BSD, Linux, MacOS, Windows, and textboxes in browsers. Have you ever edited a script in ed? I have (termcap was way too messed)

    Or you could just use ruby which is much less noisy than perl but not whitespace-dependent.
    --
  • by Anonymous Coward
    I advise people not to use Python for the following reasons: 1) Python has had license issues. Guido does not want to relinquish final control over Python, and he wants to get paid for what other language implementors do for free. 2) Python is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Python team. 3) New versions break old programs. I do NOT want my customers to have to have 2 or 3 versions of Python installed. 4) There are better alternatives. Lisp or Ruby.
  • by Chester K ( 145560 ) on Thursday March 15, 2001 @10:13PM (#360184) Homepage
    ...and just as newsworthy....

    Larry Wall thinks Perl is pretty cool.
  • > Yeah, it's a real challenge to find a platform that runs either vi or emacs

    Like most macs. Or any browser (hey hey, like Zope).

    > If you want to criticize Python at least find a *real* problem with the language and don't just spread FUD about whitespace

    In Python, whitespace is part of the language. By the way, FUD stands for Fear, Uncertaintity, and Doubt. I am merely flaming, I lack the marketing experience for FUD.
    --
  • 2) Python is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Python team.
    While there may no standards body stamping an official document, this statement also applies to Perl, TCL, and many other popular scripting languages in its class, as well as Java.

    I have to differ with you brining Java into this comment. While there is no external standard body for Java, Java is not "defined by it's implementation". The Java Language spec has been found to differ from the behavious of javac many times, and it was javac, not the JLS that changed. Jikes uses the JLS, not javac as it's reference. Javac is only a reference implementation, in that it mostly conforms to the JLS.

  • by jobber-d ( 225767 ) on Thursday March 15, 2001 @10:21PM (#360195)
    If you're looking for a more technical summary of Python, you can always read Eric Raymonds thoughts on it. you can find it here. http://noframes.linuxjournal.com/lj-issues/issue73 /3882.html
  • This makes no sense to me. Whitespace should be significant, but this code shouldn't break because you took the if out. Consider the following:

    if (a>1)
    {
    System.out.println("x");
    }

    then

    // if (a>1)
    {
    System.out.println("x");
    }

    Neither f the above break. Just because I am declaring a new block for no reason, doesn't imply to me that the compiler should break. In fact, I use this feature of C style languages all the time to block off the scope of local variables, thus making the code easier to read, like thus:

    // switch a and b
    {
    int tmp=a;
    b=a;
    a=tmp;
    }

    I don't want the tmp varable scoped past this switch, so I limit it's scope. I also use the comment at the top of the block to make the whole thing look prettier.
  • Linus has the copyright on the Linux kernel code... he can relicense at will. The next version could be completely closed and proprietary. The only thing he can't do is relicense and take away all the old versions that he's already GPL'ed.

    People coding under bsd licenses generally just want their code to be used, even if the people who use it want to keep their changes secret. They will still have their original code, after all.

    I do not find in orthodox Christianity one redeeming feature.

  • It took me years to give it a real try. When I started my current project which is a C base but needed some easy way for the customer to extend via scripting, python looked like a good choice.

    It turns out it's super easy to integrate into a C or C++ base and nearly instantly gives you a very solid scripting language. Restricted execution allows you to limit the power of the scripts, perhaps only allowing access to a few of your own custom objects and none of the system calls. This allows us to trust scripts from relatively untrusted users. All in all it's been a dream to use.

    I was a little weary of having to learn a new language. Having to have C, C++, Java, VB, perl, javascript & shell under your belt seems excessive. I wish we could settle down and use a few LESS languages, but whaddya gonna do?

    Once I jumped in though, i found it really easy to learn and nice to work with. Most modern languages seems to use so many of the same concepts, it's hardly like picking up a new one (I felt the same way about java). So it was really painless.

    I would suggest anyone who's on the fence to give it a try because really it's only a couple of days before you've got a pretty good command of it

    Sleeper

  • I must admit that I too have not found Zope to be as good as I would have hoped. The documentation seems to have improved considerably since I last seriously worked with it (about a year ago) -- at that time the documentation was poor, incomplete, and often inaccurate. That's a huge problem for something like Zope, which is a piece of infrastructure. It's fine if AbiWord, for instance, doesn't have good documentation -- a little experimentation will expose everything you need to know -- but that doesn't work with something like Zope. That said, the documentation seems to have improved considerably.

    However, I still don't like Zope much, even though I really want to like Zope. It doesn't have the things I so love about Python -- simplicity, consistency, and a small set of orthogonal features which interact well together. DTML and Zope in general seem to have some sort of funny dynamic scoping to them, and the mapping from URL to object database to the python object model isn't intuitive to me. When you do something new in Zope, there's a very good chance it won't work the first time. That's not true of Python, in my experience.

    For these reasons, I've been looking more closely at Webware [sourceforge.net], which seems to have a much less ambitious goal, and thus much more chance of success.

    People have been talking about how Zope will be a killer application for a while now. Maybe it will happen, I very possibly may be converted myself, but I don't think it will necessarily happen. It would be very easy for Digital Creations to lose sight of the goal by incrementally adding features they need without rethinking what they've already done. Down that path leads Perl, and I know I sure don't want to go there.

  • by deran9ed ( 300694 ) on Thursday March 15, 2001 @10:25PM (#360205) Homepage

    First off sorry for the typo on submission of the article... Tom Christiansen wrote a nifty little comparison [nasa.gov] between Perl vs. Python. I've used Python quite a few times and don't know Perl well enough to even consider myself a programmer. However many times I've had to modify plenty of Perl scripts in order to use certain things I found useful, and one reason I would use Python over Perl is its ease of scripting. Perl can sometimes be confusing as heck.

    According to Jon Udell here are his findings on Perl vs. Python

    Perl Is Bigger, But Python Is Growing Faster.

    Python Is More Deeply Object-Oriented.

    Perl Is more Powerful And More Mature In Some Ways.

    Perl Lacks A Killer App, Zope Is Python's Killer App.

    Python Is Designed To Be A Good First Language For A Beginning Programmer, Whereas Perl Is Most Useful To Programmers Familiar With C, Sed Or Awk, And UNIX Command Idioms.

    His complete write up is here [byte.com]. (warning the article is a bit long... 4 pages)

    And finally Python Humor [python.org]

  • by mlinksva ( 1755 ) on Thursday March 15, 2001 @10:34PM (#360212) Homepage Journal
    http://www.oreillynet.com/pub/a/python/2001/02/22/ pythonnews.html [oreillynet.com] says
    John Udell once described Digital Creations' Zope as Python's killer app, the application that was going to have everyone scrambling to learn Python. It hasn't proved to be much of a killer though. Web designers looking for solutions to their documentation management problems routinely dismiss it as overkill, developers as underkill, or too hobbling.
    I haven't taken much more than a cursory look at Zope (several times over the last couple years), though that's about the impression I got: too much complication for too little gain.
  • Well, what I like about Python is that it is both simple, but also explicit. So, for instance, when you want to factor your program into modules, you just put the respective function definitions in the various files and import them. When you import a file, all the definitions in that file are available. There's no real way to hide things (though, by convention, you shouldn't access variables that start with _), there's nothing you need to declare at the beginning of the module, so there's no overhead to factoring correctly. Creating classes is also similarly simple, encouraging good factoring.

    I also like the fact that you can look at a small bit of Python code out of context and figure a lot out about it. There are seldom hidden side effects (not necessarily by language design, but mostly by accepted convention and style). You can trace all the functions -- there are a handfull of top-level builtin functions, and everything else is modules or methods. Because Python encourages being explicit about modules (e.g., using string.join, where join comes from the string module), it's easy to figure out where everything is defined.

    Those are a couple of the things that I think make Python easy to read and easy to maintain.

    But most of all, I like Python because I can do what I want to consistently and efficiently. There aren't any surprises. I feel like Perl has an emphasis on being a language that can do eclectic things. But I don't want my language to do eclectic things, I want to do eclectic things with my language. A language should be a reliable and predictable way to express my intention. If I understand the language fairly completely (and it doesn't have horrible deficiencies, like Tcl for instance), I can do what I want. I could never understand Perl enough to work with it without surprises. Without ever hacking on Python internals, I feel like I understand the language pretty completely.

  • Python isn't formally defined, but it isn't defined by its implementation. There are multiple implementations that seem to keep in sync fairly well. The default implementation (CPython) is also widely available, and it's easy to make portable programs based on it. Also, enhancements to the language are taken quite seriously. The PEP process (writing formal descriptions of all proposed changes) keeps the advancement of the language both more conservative and formal. Standardization is mostly for cases when proprietary implementors want to make their implementations interoperate (e.g., ANSI C, Common Lisp, JavaScript/ECMAScript, etc). Standardization has little to offer Python.

    As far as new versions breaking old programs, I haven't seen the problem. Python v2 adds a number of things, but hasn't really broken anything. There are plans to deprecate old features, but these are mostly in cases where old features were found to encourage or enable bad programming practices or the behavior is unintuitive, and where it's not hard to fix the program. Even so, there are plans to put in warning features and ways to run the interpreter in backwards-compatible modes. These should come to fruition before serious backwards-incompatible changes are made.

  • Too bad the real world always does not allow such a luxury. Tell me you never scrolled up to see what the hell you were closing.
  • Ahhggg. This brings back horrible memories of huge C/Perl that would be flattened by one *semi-colon* out of wack. It's a pain. A real pain

    Seriously modern text editors take the pain out of it. The python IDE takes care of it. But fair enough it is a pain when you want to debug some of your code example

    if a > 1 :
    print "do something
    print "do ome more stuff"

    print rest of program

    if you want to just skip the condition and the do somethign code is very long then you have to replace it when you would've wanted to just

    #if a > 1 :
    print "do something
    print "do ome more stuff"

    print rest of program

    you have to

    #if a > 1 :
    if 2 > 1 :
    print "do something
    print "do ome more stuff"

    print rest of program

    which might just trip you up
    .oO0Oo.
  • Python is used pretty much across the board, much more across the board than Perl.
    Who is he kidding? In my years as a professional programmer of financial applications, data servers, ecommerce frameworks, embedded systems, and web sites, I have seen a plethora of projects successfully that used Perl, and exactly zero that used Python. Python ain't exactly the ubiquitous standard the Python community thinks it is.

    There are a lot of application developers using Python in Web development. Even more using Perl, to be sure.

    The other examples given--glue applications, database applications--have been successfully served by Perl for a long, long time. Honestly, who hasn't written a simple protocol server in Perl before? Who hasn't written basic databases in Perl?

    I think Guido might be eating a little too much of his own dog food. Python may be a rising star (who remembers Objective C?), but Perl is still king.

  • "Python would be used for higher level control of an application, and Java would be used for implementing the lower level that needs to run relatively efficiently."

    I never thought I'd see the day when Java was mentioned in the same sentence as "lower level" and "efficient."

    *shudder*
  • by k8to ( 9046 ) on Thursday March 15, 2001 @11:16PM (#360248) Homepage
    1) Python has had license issues.

    Python is transitioning from a bsd-like license to a bsd-like license. Those who wish to get their knickers in a twist over the in-between phase are grasping at straws.

    Guido does not want to relinquish final control over Python, and he wants to get paid for what other language implementors do for free.

    Linus does not want to relinquish final control over Linux. What's your point? Guido is the BDFL (Benevolent Dictator for Life) but the license does not prevent one from making alternate versions, and in fact this has been done more than once.

    As for Guido wanting to get paid for doing Python work, sure.. why not? As for getting paid for what other people contribute, please explain yourself in some level of detail?

    2) Python is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Python team.

    While there may no standards body stamping an official document, this statement also applies to Perl, TCL, and many other popular scripting languages in its class, as well as Java. In practical reality, there are mulitple implementations of Python which are in fact compatible, and have been multiple independent implementations for some time. I wouldn't get too worried about this "one implementation problem".

    3) New versions break old programs. I do NOT want my customers to have to have 2 or 3 versions of Python installed.

    The python 1.x -> 2.0 transition was painless for all those I have spoken with. I have not had any of my code hiccup or cough at all except perhaps to tell me that some packages have been deprecated over the years, though they still work.

    If you compare this to the K&R -> ANSI C transition, or the TCL 7 -> 8 transition, or some of the severl perl transitions, it's a walk in the park.

    4) There are better alternatives. Lisp or Ruby.

    While these languages are interesting, they do not have the same advantages as Python. Some examples would be a clean readable language, a cohesive standard library, a simple syntax, and a strong OO heritage pulling from background such as smalltalk. Ruby and Lisp do interesting things of their own, but are not languages I would consider in the same breath. Ruby, FWIW, suffers from the same above problems as Python.

  • There's a class [oberlin.edu] at Oberlin College this semester on writing music apps in python.
  • by Steeltoe ( 98226 ) on Thursday March 15, 2001 @11:24PM (#360259) Homepage
    I'm currently learning Ruby [rubycentral.com], and MAN is that a beautiful OO-language. My only nit-pick about it so far is that it is not constrained enough, contains a few non-intuitive wrinkles and ambiguities, and don't really treat code as data (as Lisp do). However, I'm certain that it can either be extended (in runtime) to become more constrained (types, const, real protected object methods and variables, private/protected inheritance etc), or its going to develop a standard set of- or arbitrary concepts of constraints.


    For RAD Ruby is a clear-cut winner. You have many high level concepts available in the language or the accompanying library (which is almost the same, since it's true OO). The most important and visible: each. No more for (i=sz; --i >= 0; ). Its also got lamdas, closures and eval. If there are some concepts missing in the language, it's usually possible to extend the language and reuse that extension again and again. At no cost of readabilty as in Forth. Oh, and did I mention everything is an object?


    Whatever you can do in Python, Perl or Smalltalk, you can do in Ruby (as a language at least). The accompanying libraries are pretty sweet too. Try it, you'll like it.


    - Steeltoe

  • by costas ( 38724 ) on Thursday March 15, 2001 @11:48PM (#360261) Homepage
    ...but it's not there yet.

    I have respect for Perl (hell, I have respect for any general-purpose language than can beat egrep in text searches), but Python is my weapon of choice.

    What people are missing in this forum is that Python is probably the most extensible language out there: there are at least 4 different interpreter implementations for Python (and I don't mean OSes): there's C-Python, there's Jython (in Java), there is Stackless Python and there will be a Python.NET. That's versatile guys, much more so than any other 4GL language out there.

    Also, Python is hacker-friendly: armed with a couple of tools and a C compiler anybody can embed the interpreter in their own app or extend Python with existing C, C++, Fortran, Java, or even Perl code. Trust me, it's much easier than you think.

    Python is easier for begginers to pick up: if you have a diverse group of people with different skills, you can use Python as a lingua franca. No reason to explain the legacy behind $_ or other such awkiness :-)

    Most importantly though, a choice of language is a personal one: I liken Python code to a mathematical proof: it's clean, it's elegant, and if it's written by someone else a reader can easily pick up its deficiencies. Perl tends to be more like poetry: it can be beautiful (like that great DeCSS hack) but its beauty is subjective, and much like poetry a lot of people may never 'get it'.

    At any rate, if you are a Perlista and you're here flaming away because of the whitespace thing, go to python.org and try the language out. My bet is that you will be happy to have done so.
  • by Spy Hunter ( 317220 ) on Thursday March 15, 2001 @11:53PM (#360265) Journal
    From Python Humor:

    Python vs. Perl according to Yoda
    Subject: Python versus Perl: A humorous look
    From: funkster@midwinter.com
    To: guido@cnri.reston.va.us
    Date: 10 Jul 1999 01:45:07 -0700

    This has been percolating in the back of my mind for a while. It's
    a scene from _The Empire Strikes Back_ reinterpreted to serve a
    valuable moral lesson for aspiring programmers.

    --
    EXTERIOR: DAGOBAH -- DAY
    With Yoda strapped to his back, Luke climbs up one of the
    many thick vines that grow in the swamp until he reaches the
    Dagobah statistics lab. Panting heavily, he continues his
    exercises -- grepping, installing new packages, logging in as
    root, and writing replacements for two-year-old shell scripts
    in Python.

    YODA: Code! Yes. A programmer's strength flows from code maintainability.
    But beware of Perl. Terse syntax... more than one way to do it...
    default variables. The dark side of code maintainability are they.
    Easily they flow, quick to join you when code you write. If once
    you start down the dark path, forever will it dominate your destiny,
    consume you it will.

    LUKE: Is Perl better than Python?

    YODA: No... no... no. Quicker, easier, more seductive.

    LUKE: But how will I know why Python is better than Perl?

    YODA: You will know. When your code you try to read six months from
    now.
    --

    larry


    [me@localhost]$ prolog
    | ?- god.
    ! Existence error in god/0
  • I advise people not to use Python for the following reasons: 1) Python has had license issues. Guido does not want to relinquish final control over Python, and he wants to get paid for what other language implementors do for free. 2) Python is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Python team. 3) New versions break old programs. I do NOT want my customers to have to have 2 or 3 versions of Python installed. 4) There are better alternatives. Lisp or Ruby.

    Ahem...lets look at this statement this way.

    I advise people not to use Linux for the following reasons: 1) Linux has had license issues. Linus does not want to relinquish final control over Linux, and he wants to get paid for what other language implementors do for free. 2) Linux is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Linux kernel team. 3) New versions break old programs. I do NOT want my customers to have to have 2 or 3 versions of Linux kernels installed. 4) There are better alternatives. MacOS or Windows.

    Yeah, its not a *perfect* fit, but pretty damn close.

  • Dylan is more elegant than even Python, but was designed to be efficiently compiled. This is from an interview with Guido in the linux journal (http://www2.linuxjournal.com/lj-issues/issue68/37 09.html):

    Phil: It seems like Python is starting to be taken really seriously in web development and so on. Is Python being taken seriously in academia? I guess I mean relative to Perl, because Perl isn't, as far as I can see.

    Guido: I would say Python is being taken a lot more seriously. There are language designers who don't approve of certain short cuts, or the fact that Python doesn't have static typing, or the fact that there are other languages out there that are as good as Python is, and again borrow all the good features from those languages.

    Phil: What languages?

    Guido: Some people think, for instance, that Dylan--which I think has a very academic flavor--is everything Python is plus so much more.

    Phil: Dylan? I've never heard of it.

    Guido: Well, that's exactly Dylan's problem. I don't know, but I think it started out as a LISP variant, with sort of an alternative syntax. The syntax was deliberately unLISPish in order not to scare off everyone who is not already brainwashed with LISP, because LISP has one of the biggest image problems of any programming
    language in the world.

  • by kevin805 ( 84623 ) on Friday March 16, 2001 @12:08AM (#360273) Homepage
    I've written a pretty good amount of absolutely hideous Perl code (maybe 10000 lines total -- hey, I'm still a student), and maybe even once a clean, reusable program. But the latter are the exception. Perl lends itself to stream of consciousness programming, which is great when you want to write a quick script to do something, but doesn't lend itself to later revision.

    I'm learning Python now. It's a much cleaner language. Consider the following Perl:

    for($i = 0; $i < 10; $i += 2) {
    print $i;
    }

    And the same in Python:

    for i in range(0,10,2):
    print i

    It's just easier to read. The main reason I don't feel like continuing on in Perl is because I once seriously shot myself in the foot due to Perl's lack of easy to use and easy to understand complex data structures. Python has classes, which are just like JavaScript (really just hashes), but the syntax makes them usable.

    And error checking as well. The following is probably wrong Perl:

    $variable = 1;
    print $varaible;

    But it isn't an error. The following causes an error in Python:

    variable = 1
    print varaible

    If I wanted an undefined value, I can, of course, create one:

    variable = None
    print variable
  • I have seen a plethora of projects successfully that used Perl, and exactly zero that used Python.

    Yahoo, Google, and eGroups all use Python extensively.

    So in your future ignorant flames, you can now say: Besides the biggest portal, the best search engine, and the most popular e-list site, I know of zero sites that use Python.

  • Quite agreed about weak lambda forms; but the garbage collection scheme is rather an embarassment. Reference counting doesn't work, for cyclic data structures, and these can arise in Python programs.
  • You are correct as far as Dutch is concerned, however, 'von' in a German name usually indicates noble ancestry.
  • Heh. That's pretty neat, and I would definitely agree that Python looks cleaner than Perl. I've never used Python, and not written a great deal of Perl either, so my opinion is just that. However, since someone above mentioned my current favorite pet/hobby/braintease language Ruby [ruby-lang.org], I thought I could at least give a Ruby version of the above example. Here goes:
    0.upto(10, 2) { |x| puts x }
    I think this is the "native" way to do this in Ruby, although I haven't been toying with it for very long, so I could be wrong. What happens is (roughly) that the message upto is sent to the object 0, with a code block associated with the call. If you're familiar with Smalltalk, this should be natural. The object 0 receives the message (aka "executes the method"), does the requested iteration, and calls the associated code block for each visited number. Pretty neat, huh? The availability of these very Smalltalk-esque code blocks, but coupled with a more familiar (and sane!) syntax is what attracted me to Ruby. Recommended.
  • The wonderful thing about perl as opposed to other languages is that everyone in the perl community is so open about "more than one way to
    do it." If a beginning programmer reads Programming Perl, 3rd ed. (great book, by the way) all the different ways to do an operation will be listed. "You can do it this way, or this way, or this way. It doesn't matter which one. They all mean the same thing". Nearly all other programming languages also have "more than one way to do it" but are rarely if ever honest and upfront about it. If the programming book they read shows only one way to do it (which many non-perl programming books are notorious for doing), and there's actually two or three different ways to do it, they're going to think the other ways to do it are completely different procedures, and they'll expend a whole lot of unnecessary energy try to figure out that the two or more instructions are the same. Perl's honesty about different ways to do things actually makes it easier to learn than many other languages.
  • you've written 10000 lines of perl and you didn't think of this?

    for(0..10) {
    print unless($_%2);
    }

    You clearly picked contrived examples, and totally failed to back up your argument.

"When the going gets tough, the tough get empirical." -- Jon Carroll

Working...