|Just another Perl shrine|
|( #3333=superdoc: print w/replies, xml )||Need Help??|
Let's say I want to write a basic application. It reads in an XML file, does some stuff to it, then writes it out to a CSV. Quite a common thing to do, actually. It might look something like:
A total of no more than 225 lines of code I wrote. Now, let's see how much code was provided for me. Not counting the amount of time I save because Perl natively does for me the following:
Already, I've saved about 25% over most other languages, just from choosing Perl!
But, that's not what you care about. XML::Parser was a huge portion of this application. Parsing XML is one of the harder things you can do. Let's say that takes about 1500 lines to do. (It's actually much more than that, but who's counting?)
Now, writing to a CSV sounds easy. But, it's actually really complicated. There're a lot of exceptions that have to be handled just right or you get screwed up. Let's say that's another 500 lines of code. (Again, it's more than that, but who's counting?)
So, we have at most 225 lines we wrote and at least 2000 lines we didn't have to. My math may be off, but that seems to be about 90% I didn't have to write, test, maintain, or do anything with ... except blithely use.
Those numbers hold pretty close, in nearly every application I've ever worked with. You want to deal with XSLT? No problem! Excel? Done. Databases? Nearly every one is supported out of the box. OO getting you down? Pick your poison.
Personally, most of my large apps are down in the 80-85% range, because I like to write large object hierarchies. But, that's just me. A lot of people (especially sysadmins) are in the 95-97%(!) range, leveraging huge amounts of code.
Update: I forgot to even mention the time savings, which are often in the 98-99.9% range. I once had a scripty-doo up and running that correlated information between an Oracle database, a MS-SQL database, and an XML document, outputting the results in Excel ... in less than 15 hours, from scratch. That is impossible in any other language. Period.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In reply to 90% of every Perl app IS written already