#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    8
    Rep Power
    0

    XML! why python?


    Ok all you python lovers out their. I have posted a similar question in the XML forum but am not getting the answers I am looking for. I am going to be building two different XML web applications. One is a database of machines and port configurations on a large network. The other is a system for writing technical papers with docbooks. I can not decide wether to use perl or python.

    What advatages does python have over perl especialy performance wise?

    Why would you recommend that I use python?

    Thanks a lot.
    _______________________
    Ruach
    SLC, UT
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    14
    I think Python compares pretty favorably with Perl in XML processing speed (not that it's better, but comparable). But what's important is that the toolkits for XML are standard Python libraries and are very well-done. Not to mention there are tons of different paths you can choose for your XML processing. There's SAX, there's DOM, there's SGMLParser, etc. The key is that the code maintenance will be easier because pretty much all other things are equal. Also, it will scale much better into larger apps. That's my take anyway.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    8
    Rep Power
    0
    It seems thought that there is a lot more support for perl then ptyhon? is that not true in the case of XML. Also why would it scale better into larger apps and what makes the code maintenance easier?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    14
    Originally posted by ruach
    It seems thought that there is a lot more support for perl then ptyhon? is that not true in the case of XML. Also why would it scale better into larger apps and what makes the code maintenance easier?
    Well, depends on what you mean by support I guess. Both have very active coding communities which are more than willing to support you. The best way of getting python help is through the comp.lang.python newsgroup.

    The Python language itself scales better than Perl does (in my opinion/experience and from my observation). It's more modular, encourages OO more (which allows for component-izing things rather easily), and it seems that the use of "best practices" in Python is more encouraged by the language than in Perl. Perl is infamous for being "write only" and can be very hard to read. But, I'm not going to start a flame war, you can read plenty of python vs perl arguments anywhere Both will work, I just wanted to say that Python is a great language
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  8. #5
  9. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    I'm a perler so I'll respond to Strike's criticism of Perl (since noone else is).

    The "write-only" jab is a fair enough one. It's very easy to write convoluted, utterly meaningless (to a human reader) code that runs perfectly well in Perl. However, it's not an inherent flaw in the language, because you can also write clean, easy to maintain code if you take a little time to do it. The came thing goes for C, PHP, etc. You can turn it into a mangled mess, or take a little time to do it right.

    The best practice concern runs in a similar vein. You can use strict in Perl and write clean, quality code, or you can bang out a script that's a total mess and balancing on a hair. It's the discipline of the programmer that determines the outcome, it's the great flexibiilty of the language (being abused in this case) that allows it.

    As for the scalability, I have no numbers either, but in my experience, Perl is very scalable, and some major additions in 5.8 only bolster that claim.

    One thing I have to admit that Python probably has over Perl is development time. Creating a readable, quality script in Perl probably takes a little longer than the same script in Python.

    My $0.02
  10. #6
  11. Wacky hack
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2001
    Location
    London, England
    Posts
    513
    Rep Power
    14
    I'd back Ctb up on his points, but I'd still say use Python

    I've been doing a lot more Python coding than Perl recently, and I just find it much easier to keep nice code. Yes, I can make my code just as nice in Perl as I can in Python, but by enforcing certain standards on me, and using a much better object-orientated approach, Python is just a dream to write in.

    The only reason I use Perl now is for CGI scripts, system admin scripts and anything that requires regular expressions, because Perl is just much nicer to use in those situations IMO.

IMN logo majestic logo threadwatch logo seochat tools logo