March 11th, 2003, 10:08 AM
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.
March 11th, 2003, 10:42 AM
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.
March 11th, 2003, 11:37 AM
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?
March 11th, 2003, 02:24 PM
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
March 12th, 2003, 09:08 PM
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.
March 14th, 2003, 06:05 AM
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.