You Used Perl to Write WHAT?! 307
Esther Schindler writes "Developers spend a lot of time telling managers, 'Let me use the tool that's appropriate for the job' (cue the '...everything looks like a nail' meme here). But rarely do we enumerate when a language is the right one for a particular job, and when it's a very, very wrong choice. James Turner, writing for CIO.com, identifies five tasks for which perl is ideally suited, and four that... well, really, shouldn't you choose something else? This is the first article in a series that will examine what each language is good at, and for which tasks it's just plain dumb. Another article is coming RSN about JavaScript, and yet another for PHP... with more promised, should these first articles do well."
Both sides... (Score:5, Interesting)
Having the right tools is great for current productivity, but it's hell on expenses and new recruits. If you use a different tool for every job, you need to maintain all those tools and a task force that's able to use all of them. Sometimes the 'right tool' is one that fits the company as well as the job.
An Intelligent FrI$T Psot. (Score:2)
Re:An Intelligent FrI$T Psot. (Score:4, Insightful)
Re: (Score:2)
I didn't use it on a site I worked. This site relied on user uploads. However, Django's FileField doesn't allow you to put anything but static strings and date formatting characters in the upload directory, or even offer a method to move files around. The files on the aforementioned site were supposed to be organized by user, so that other scripts could easily zip entire directories / directory trees.
Re: (Score:3, Insightful)
OK, so not all languages are well matched to solving all problems, but keeping it down to a managable number also serves to avoid some major grief in future.
Re:is your company weak? (Score:5, Insightful)
Re:is your company weak? (Score:4, Insightful)
But the problem isn't 'picking up a language', it's picking up 3. If we hire a new recruit, to expect him to learn 3 new languages immediately is ridiculous. So we don't -have- a ton of different languages in use, we have a choice few that cover everything reasonably well. In fact, since I started, we have dropped 1 and almost dropped another. (They're waiting on me to have time to rewrite that last program in another language.)
In addition to not having to have new recruits learn those 2 languages, we also don't have to maintain the software needed for those 2 languages. That saves employee time and computing power both.
And in truth, I tried to suggest adding a new language a few months ago... And after discussion, we decided the benefits didn't outweigh the costs. I was the only one who already knew the language at all, and it wasn't -that- much better than what we had.
If we were a huge company with thousands of employees, it might make sense to have specialists in each of the languages and also use 'the right tool for the job'
Re:is your company weak? (Score:5, Insightful)
Re: (Score:3, Insightful)
Re:is your company weak? (Score:5, Interesting)
HOWEVER, I do remember quite well what threads are, what a semaphore is, what a binary tree is, the difference between a bubble/quick/radix sort, the concept of object oriented design, etc. I wish I could say I remembered UML modeling but honestly, I hated that darned part of CS and never paid attention there anyways
People keep saying this... (Score:5, Insightful)
The problem is not learning the syntax and basic idioms. Agreed, that's pretty quick, particularly if you have a good reference.
The problem (and the time sink) is the *ugly* side of every language. The parts of the standard libraries that sucked, and were reimplemented elsewhere (but you gotta know that...). The functionality where everyone who "lives with" the language grabs X open source library to implement -- not Y! it's a POS! -- but you don't know that yet. The language features that have secret, illogical gotchas for special cases. The bugs in the compiler or interpreter that are easy to avoid -- once you've been burned once. The code that will break cross-platform compatibility for obscure reasons. The code that will make it almost impossible to internationalize later, because you didn't learn how that support worked yet.
Granted, the cost of these things with any reasonable mature language should not be enormous (though it depends how long you go down a wrong path...), and you can allow for it, but it's always a significant risk *especially* if you don't have someone on the team (perhaps the new team who has to maintain your old code) who's already more-or-less expert level.
But either way, you have to allow *something* for that cost, and sometimes it's not worth it just to use the absolute best tool for the job when you have a pretty close fit available.
Re: (Score:3, Insightful)
This is worthy of a mod +5 - Wish I Said It Myself. It bears repeating. Syntax can learned in a few hours, figuring out the quirks can last you a lifetime.
Re: (Score:3, Interesting)
Sadly it is the brain dead of the HR departments and headhunters who do the hiring/selecting... usually. To them, what is on paper trumps experience. Seems that ever more often these wastes of brain pans either submit for interviews or will outright hire a newly graduated Masters student (based entirely on their piece of paper) with fuck all experience and make them managers or 'senior' developers
Re: (Score:2)
Re:is your company weak? (Score:4, Funny)
Besides, complaining about having too much work while browsing Slashdot really is foolish.
Re: (Score:2)
The real issue isn't first personnel, but time.
The need to get stuff done NOW, NOW, NOW doesn't afford the FNG any time to sink into the language and its paradigms.
Lack of time leads to heat and pressure, which produces nasty coal fires more often than diamonds.
Re: (Score:3, Insightful)
If it is a one time throw away script to fix a one time problem then yes the programmer can use what ever he wants.
But if it is a tool then you may need to have other people maintain and work on it.
You can write any program in any language. Yes some are better than others but how well you know the language is also important. Also having multiple vendors for a language is also really useful. If only one vendor supports the language then they have a lot of control over your company. Take Foxpro a
Not following... (Score:3, Informative)
I recently had a throwdown regarding this because one of my coworkers was working on a project, and I flat refused to help him in his chosen language. That language? VB6.
Now I used to program in that...thing...and
Re:Both sides... (Score:5, Insightful)
That's why the "right tool for the job" is sometimes the tool that meets the greatest cross-section of a company's needs rather than a jumble of tools that are ideal at a lot of little tasks.
e.g. While it's fashionable to hate Java these days, you have to admit that it does have a rather massive cross-section of needs it can meet. Thus one of the reasons why it's so popular in large companies. Yet a smaller company might find more value in using Ruby toolkits to do all their work. Ruby may not be ideal for some of the less glamorous back-end tasks, but tools like Rails gain so much on the front end that Ruby meets a greater cross-section of needs than Java would.
Re: (Score:2)
Re: (Score:3, Interesting)
Seriously, you're picking at an example where I say that some small company somewhere might benefit from the faster development time of Ruby over the advantages of Java? Especially when said company probably doesn't need the same level of scalability you're worried about?
Geez. Simmer down, will ya?
Re: (Score:3, Insightful)
Oh, perhaps the kind that provide exclusive or small-reach services? e.g. If I ran a local salon, how many people would reasonably be hitting my site simultaneously? I might not be able to afford to have someone build me a scalable J2EE online-appointment system, but I could probably afford a small Ruby on Rails site. Scalability for my site would be handled by throwing hardware at the problem, as it's a LOT cheaper in this case th
Re:Both sides... (Score:5, Insightful)
I hate the "right tool for the job" cliche. Not because it's necessarily wrong, but because it tends to be used by people who automatically assume that their tool is the right one and wish to stop any serious discussion about other possibilities.
language vs library (Score:5, Insightful)
I wonder if this whole discussion is off the mark. Languages are for the most part trivial. And universal. "It's the libraries, stupid" is sometimes how I feel. If it was easy to link in or call any library function from any language, then half of this discussion would immediately be seen to be irrelevant. So Perl is "the right tool for the job" because it has the ability to apply regular expressions to strings? But, you know, C can do that too thanks to this PCRE library. Hashes? C can do that too via another library. In case anyone has forgotten, Perl itself is written in C. I read that Perl 6 has vastly improved the interface to other languages, especially C libraries.
These day, whenever I write a new program it often feels as if I'm creating yet another language. A simple, superficial, limited language, but nonetheless, a language. Program needs a configuration file? Whip up a suitable format (language) for that. Needs to save data? Barf out this big data structure into a YML file. Want some way to run the interface from a batch process, or otherwise automatically? Start turning the user interface into a language. Want to connect Perl 5 and C? Get acquainted with XS, a "language" the Perl folks felt it necessary to create for that purpose, because Perl 5 wasn't good enough alone. Want to compile a large project written in C? Get familiar with the language of Make, because while C certainly could do it, C isn't so good for that. Is ANT a "language" for building Java projects? Where's the line between language and library?
I suppose where things lead to a new language is when someone wants to implement a new concept and the established ways aren't good enough. Or has a way to eliminate a bad programming practice, but some elements of an existing language must be dropped to do it. For instance, wouldn't be nice to have variable length parameter lists in C, as C's own printf function does? Too bad it's such a pain to do that in C. How about lazy evaluation and currying so we can have infinitely long parameter lists? Oops, guess the C call stack can do recursion, but isn't too well suited to expressing that sort of thing, time to make another language, Haskell. Do we want to pass along a pointer to a structure, or a copy of a structure? Java defaulted to pointers where C did not, but then said Java didn't use pointers. Nice not to have to type in ampersands and asterisks all the time, but still, I find the thinking misleading. Then there's garbage collection. The consensus is that garbage collection is overall a good thing, but that a good programmer can do better than the automatic garbage collector. And so on.
Re:language vs library (Score:4, Interesting)
Languages are for the most part trivial. And universal.
How about lazy evaluation and currying... ...time to make another language, Haskell.... Do we want... a pointer?
Please do forgive me (hee hee hee: Please ==> forgive $ me) if I haven't quite gotten your point, but I cannot square your first and last paragraphs, specifically the parts I've quoted.
Perhaps if you'd written "Imperative languages are for the most part trivial and universal? Perhaps then could easily equate C and Fortran and Perl and sed, and leave Haskell and Lisp out of the mix. Or perhaps if you'd written "OO languages are for the most part trivial and universal? Perhaps then I could equate (more or less easily, don't think it's quite NP) Objective C and Java and C++. (But see below....)
But the bold unqualified "they're all languages, get over it" sort of assertion doesn't parse.
My intro was Fortran, then F77, then Pascal, then C (OMG! Pointers! The Bomb!), and it was evolution, a little more cool, a little more flexibility all along.
Then I learned C++ at work by day and Java for fun at night, and my head hurt, 'cause I liked the imperative style and OO was weirdly different but everyone was swilling kool aid so I stuck it out...
...and every night I'd discover something in Java that was THE BOMB that would solve that day's problem and every next day I'd find that C++ didn't have that feature (does today, AFAIK, but STL was busted then, so everyone rolled their own)... ...but I moved out of real programming before I got my head around OO.
And now I'm learning Haskell, just 'cause I've learned that making my head hurt from time to time is a great way of stretching myself, of getting better at everything....
And I don't understand - at least, I haven't wrapped my head around Monads yet, though I get what they're for. And you know what? No pain.
None. I can feel the approach of enlightenment. SYB and reflect, baby, introspection and lazy evaluation and side-effect free (or reliably and provably constrained side-effect management) via implicit state passing.
Whoa.
I feel like Neo after the roof but just before the hallway - I'm starting to believe.
I've read the "SYB in C++" paper. I get what they're doing. But they admit the gap:
Scrap++ is a great exercise, but how do you get to SYB without those? You don't.
There's a guy out there that /.ers love or hate, no middle ground, so I won't reference him directly, but he's right: Different programming models change how you think of problems, and the right model opens so many doors you didn't even know existed. Doors you couldn't even have described until you knew they were there, but you were unable to find the hallway until you squinted, looked sideways at the world, and watched it shift... ...and were freed from the imperative....
"Hello World" is a cool teaching aid in Fortran and C and even perl (do it 15 different ways, without string literals or character types, preferably with a program one column wide :->)
But Haskell? No. When you learn Haskell, think big. 'Cause its programming model is so way different you have no idea. I'm at the point I almost consider Monads harmful... ...but I'll get the other side of the koan soon.
And when I have a simple repetitive task that I need to automate, I'll stick to bash, 'cause it's clean and readable, and sufficiently fast and sufficiently limited that I have to force myself to be literate, which makes it so much easier 6 months later when I need to tweak $ remember script.
I won't use Haskell for that. No way. But that replacement for scrabble/scribble I've been thinking of? That tool for edit
Re: (Score:3, Interesting)
Turing Machines vs. Lambda Calculus (Score:3, Interesting)
What you're really talking about here is the difference between the Turing machine model of computation and the Lambda Calculus model, and you're absolutely right. Even though the two are provably equivalent (try expressing one of your Haskell programs as a while loop with a stack; it works but it sucks having to write it!), the very mentality that you use when programming in a language like Haskell is so totally radically different from how you program in C that it's useless comparing the two.
In college I
Re: (Score:2)
Re: (Score:2)
How is it hell on expenses if you focus on open source solutions? Also, if you hire people who cannot learn a new technology then you hired the wrong person. Technology will always change. You don't want people who will become dinosaurs in a few short years.
It's "Hard" to learn a few languages? (Score:3, Insightful)
There is a difference between keeping a well stocked and maintained tool-box that covers the basics and being a compulsive tool collector. There's also a difference between keeping a well stocked and maintained tool-box that covers the basics and using a screwdriver for everything. That's the same mentality that tries to use the tip of a hunting knife to turn a precision screw.
Its simple (Score:5, Insightful)
Re: (Score:3, Insightful)
Glue and objects (Score:5, Interesting)
The other really odd experience for me was learing object oriented programming. I had been programming in objects since I was first introduced to them when the first NeXT computer came out. I used java. And C++ and such. I thought I understood objects.
Then one day I learned to program object oriented in Perl. An I learned that while I was fluent in object oriented usage, I really had a pathetic understanding of how they worked and what was actually possible with objects.
Perl objects are sort of like owning a copy of grey's anatomy or "the visible" man. You son't just see that arms connect to torso's from outside but you see all the sinews and bones and blood.
It's actually amazing how so many things we think of as different concepts in object oriented programming and data bases are actually different reflections of the same trick. And that's the trick perl use to make objects.
in perl, an object is any variable that has an attribute that can store a list of package names.
Let's see what you can do with that.
Hmmm.... well that list can be your inheritance heirarchy so each package is what you search for methods. But notice that since it's a mutable list a perl object can do something else that most object oriented languages cannot. A variable can change it's "inheritance" list after the fact. it can change it's own class.
Okay Now this is just a single variable so where to we get attributes of the object? Well, if that variable is say a hash (dictionary) then we can just use the key's as the attribute names. so if were to write self.foo in C++, you would write self->{foo} in perl.
More fun: let's say you call a method() or ask for an attribute on a variable that does not exist. Well, a perl object can just add more packages to it's inheritnace list. Or it cold write the method on the spot and add it too it's own inheritnace. "I'm my own grandpa". I've used this trick many times to create tables. I don't write any of the "get" or "set" methods. instead I just intercept the call to the method "setfoo()" which never existed cause I never wrote it, then I have perl create an attribute called foo: Self->{foo} = "something". then I have perl write a subroutine called "setfoo" and add that subroutine into a package namespace and put that in it's inhereticnace list.. ("like adding methods to a C++ package outside the declaration". (programming tip: obviously this is could lead to problems with typos, so I also provide the variabel with a list of all allowed attribute names--- but of course I can always add to that list later).
Now something more exotic. The hottest thing in Data base programming is the realization that sometimes column centric data bases are better than traditional row-centric data bases structures. In perl an object can change which it is, transparently. For example, if I'm a traditional object with a row organization then all my attributes are stored as self->{foo1}, self->{foo2}, self->{foo3}. and so on, just as you might right self.foo3 in python. But I did not have to do it that way. What if instead of making the self variable a hash (dictionary) I had made the self-variable a simple scalar, say an integer. Well at fist this seems stupid, where did all the instance variables go? Well, I just store them in the class. I make the scalar self-variable's integer just an index. The class keeps the instance variables in arrays--that is column based storage--.. SO for example if self = 4, then the attibute foo for this instance now becomes self->class->foo[4].
The beauty of this is that si
ob (Score:4, Insightful)
Re: (Score:3, Insightful)
Perl6 will be written in Perl (Score:2)
1 Page Version (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
idiots (Score:5, Funny)
Re:idiots (Score:5, Funny)
Re:idiots (Score:5, Funny)
Re:idiots (Score:5, Funny)
Ask not for whom the whoosh whooshes - it whooshes for thee.
Re: (Score:3, Funny)
Re: (Score:3, Funny)
It's not that rare.
Re:idiots (Score:4, Insightful)
Now, perl might not be the best language on the entire planet for web scripting and such, but to suggest that it is actually on the negative side of the graph in being web appropriate is just dumb. And I don't need to be a CIO to understand that.
Comment removed (Score:5, Funny)
Re:idiots (Score:4, Funny)
Re: (Score:3, Funny)
Re: (Score:3, Insightful)
Re: (Score:2)
Ray Tracing (Score:5, Insightful)
But the most profound part of the whole article, and I admonish everyone coding Perl to remember this:
This applies to any language. If you can do it multiple ways, pick the readable one.
Re:Ray Tracing (Score:4, Interesting)
I was a long time perl programmer before I made the switch to python. All my headaches with perl went away, and no new headaches of similar magnitude have surfaced. So for me it has been an net improvement.
KISS, DRY, and various other good engineering/development paradigms are embodied in python's development model.
Perl made it easy to shoot yourself in the foot. Python makes it hard to shoot yourself in the foot -- but you can if you want to. That probably best sums up their differences.
Re: (Score:2, Funny)
But whatever, I have a perl script that converts tabs to spaces, so it all works out.
Re: (Score:3, Informative)
Larry Wall doesn't exactly follow his own advice, there... But I digress.
I'm not really sure a raytracer was such a horrible idea.
If you can isolate those tight loops, there's a good chance you can do just that part in C. High-performance should be possible.
It's the real-time response that would be difficult. I wouldn't have a problem writ
Re: (Score:2)
You made me chuckle.
Re:Ray Tracing (Score:5, Insightful)
In a college computer architecture class, we had to write an emulator for a system designed "by the professor". Basically all tight loops performing really basic operations, and a lot of synchronization. We were given sample microcode and programs to test with, and when we turned it in he ran it with different microcode and programs to guarantee accuracy. Accuracy was required to pass, but your grade was based on performance and clarity.
They only perfect score went to an emulator written in Perl. The built-in hash tables, and some smart programming combined with the ease of parsing the microcode and program data created not only the fastest (some classmates used C, C++, lisp, or Java to write their emulators) emulator, but also the easiest to read of the group.
It's the programmer that creates slow, unreadable code, not the language.
Re: (Score:2)
Re: (Score:3, Interesting)
Yes, that reminds me a bit about a class I used to teach for a former employer. I was teaching old-time
Why two different languages? (Score:2)
If you can isolate those tight loops, there's a good chance you can do just that part in C.
Unless your interpreter can detect inner loops and compile them to native code for you. This is one advantage of using a language that targets the JVM or CLR: the widespread interpreters for these targets are designed to do just that. Why should inner loops and outer loops be written in different languages?
And PHP has been notorious for SQL injections, if undeservedly.
In my opinion, a language is "deservedly" notorious for security holes if many of the code examples in the language's official documentation are subject to these security holes. For example, if a langua
Re:Ray Tracing (Score:4, Insightful)
To the contrary, I think everyone should write a ray-tracer in Perl. Or, more generally, every programmer should take his or her favorite language and use it for something it's spectacularly bad at. Like ray-tracing in Perl.
Part of the reason is to show that yes, you can use just about any language for just about any task. But that doesn't mean you should. Using a language unsuited to a project gets you familiar with the bounds of the language, so you have a pretty good idea before you start whether or not the language is a good fit for a given task. And it can often teach you a lot about the language, because you'll have to explore the little nooks and crannies to figure out how to get it to do what you want.
The other part of the reason is that everyone needs a little humbling. This is especially true for anyone who says, "I used to use {language_x} until I discovered {language_y} and realized that {x} is TEH SUCK!" That usually just means that {y} is more suited to what you're doing now. Go code something non-trivial that {y} is unsuited for, and see if you don't end up cursing your new favorite just as much as you curse your old favorite.
I wrote a BASIC interpreter (Score:4, Interesting)
Why? I dunno, but I did learn a whole lot about Perl.
I think that's the best way to learn things... make up a fake project for yourself (say, a database, or a simple flight simulator)...then implement it. Then revise it.
Re:I wrote a BASIC interpreter (Score:4, Funny)
refund (Score:5, Insightful)
According to the article.. (Score:5, Funny)
Wait...there are ways to use perl in a non-obfuscated fashion!?
Re:According to the article.. (Score:4, Insightful)
Whoosh! (Score:2, Insightful)
My favorite example (Score:5, Interesting)
It's fun to watch people's reaction when they realize that "You wrote a perl script that reads the manual and generates the code?" I just respond something like "Uh, yeah; you got a problem with that?"
Especially fun has been the couple of discussions in which I expressed a great deal of skepticism of various "AI" claims. Then someone brings up the fact that I write perl programs that read English-language docs and generate code from them. They're obviously puzzled by the fact that I do this while looking skeptically at "AI" proposals. It's like they expect me to just shrug and write other impossible things in perl.
Re: (Score:2, Insightful)
Just sounds like text processing to me, which Perl (and most scripting/shell languages) are designed for.
Inline C in Perl (Score:3, Interesting)
Re: (Score:2)
Quick repair tool (Score:3, Interesting)
I'm currently writing a server based application written in c# (mono). The email class of c# was good...but enough flexible for the multipart graphically enriched email I had to send (a report not a spam...Mind you). I couldn't properly configured the MIME Parts (especially "inline"). If I had just c# the only available would have been a commercial library.
So I end up with Perl. perl -MCPAN -e shell . install MIME::Light (if I remind well)
a couple lines after I had a tool ready to send emails (based html pages written by my c# application). The script is fired up by my c# application with several parameters. It works.
Re: (Score:2)
Bollocks (Score:5, Interesting)
Perl was, and is (IMHO) the first and foremost thing you grab when you write web-stuff. CPAN is nothing if not infinite, the web is a text-based thing the perl was designed for, and its speed makes ruby blush. So why ?
Why try to write off perl all the time. Is it because they can't seem to
Re: (Score:3, Insightful)
Probably because the CIO author is highly ignorant of the existence of CPAN and some of the high quality modules it archives and distributes. One particularly high quality module is Template Toolkit [cpan.org]. It is an incredibly powerful templating system. Some would even say it is too powerful (you could write enter programs in the template language). But what I have found is that power was purposely put there because there are instances where you need to do something fancy in the template or view rather than the
Re:Bollocks (Score:4, Informative)
I can think of a combination of three factors to support this assertion:
For all the things PHP does wrong, these are things that it has done right.
When to use Perl? (Score:5, Funny)
Re:When to use Perl? (Score:5, Interesting)
Re: (Score:2, Funny)
Not quite Perl... (Score:2)
Originally it was just a small project to get through a week of stagnated work. It's actually pretty hacked together but is separated into a client/server setup for use of a single backend and multiple frontends.
Eventually I plan to port it to C/C++... but for now it seems to be working fine.
Another useless article (Score:3, Insightful)
What people tend to forget is how extensible a language can be, especially Perl. Blanket statements like "Perl should not be used for the web" is misinformed at best. No one wrote web scripts in Ruby before Rails -- it's all about the framework. Go give the Catalyst framework a try, and tell me again not to use Perl for the web.
As for high performance computing, remember that the perl interpreter does a few things very well, very fast. We ended up rewriting our web crawling infrastructure at $WORK from Nutch and Lucene in Java to a custom distributed Perl architecture against Xapian. Not only is it much more 'pluggable' than the original solution, we ended up getting a huge increase in speed out of the deal, even putting it up against 64-bit Java. It's anecdotal, and mileage will vary, but there are times that Perl is just better at crunching text than anything else.
Too many people write off Perl as a relic of the past. What people fail to see is the new Perl renaissance that is quickly approaching. It's a good time to be a Perl developer, judging by the job market.
4 Signs You're An IT Tool (Score:3, Insightful)
I was expecting the standard litany of anti-perl 'wrong tool for the job' comments in this article, but the 'four things' you're not supposed to do made me laugh:
Check. No discussion necessary, but did it even need to be pointed out? Really, if you're even thinking about doing real-time apps in any interpreted language, you need to have your head examined.
The example provided points out that using a simplistic perl script that calls 'system' to move files around generates a lot of needless sub shells and processes. OK - good point. However, in the example he provides, he replaces the inefficient perl script with an efficient perl script. How does that help make your point? Unless the point is 'try to write good code' - which isn't language specific.
This is just short-sighted and stupid, and the author suggests we use PHP or Ruby on Rails. OK - there are a lot of choices here, and all of them have advantages and disadvantages. But after reading that I should be using PHP, this quote made me spit coffe on my keyboard: "You should especially avoid using perl for traditional CGI-style form processing; this code tends to be hard to read and maintain because the HTML ends up inlined inside the perl code." Clean, elegant and properly designed code can be written in any language. Some languages encourage this, some make it difficult. Ruby encourages, but I'd stake my reputation on the claim that PHP makes it very hard. Perl is neutral on that spectrum.
Check. No discussion necessary, but did it even need to be pointed out? Oh, I used that one already.
Re: (Score:3, Insightful)
Check. No discussion necessary, but did it even need to be pointed out? Really, if you're even thinking about doing real-time apps in any interpreted language, you need to have your head examined.
Yes. It needed to be pointed out. Look at where the article is published: a magazine targeted at _IT managers_. Many of these people don't really understand the basics of what the languages the programmers they employ are. Articles like
Re: (Score:2)
The lack of namespaces and the dizzying array of functions included in the core libraries makes it difficult to write clean code. I didn't say it couldn't be done. In fact, I started the comment by saying that you could write good code in any languag
Re: (Score:2)
No [cpan.org] it [cpan.org] is [cpan.org] not [cpan.org].
Perl has far more tools to support making clean MVC web separation stuff than ruby. The issue is that what represents "good" or "clean" code is domain specific. All the things are showed you are things that are good for the specific problem of document templating for the web. I'd be willing to say that Perl's flexibility lets you code in pretty much any domain cleanly...if you set up your environment to facilitate that.
Re: (Score:2)
Re: (Score:3, Insightful)
The silliest statement ever (Score:2)
Re: (Score:2)
Perl can be written in a way that's fairly C-style whereas that's not the case for bash. Bash is great for simple tasks but for more complicated ones it can be
Perl - Swiss Army Knife (Score:2)
That's the 10,000' view, anyway.
Data visualization in Perl/Tk... (Score:2)
It ran quite well on the hardware of the day, and had the advantage of actually behaving on just about everything in a very mixed-platform campus (Linux, Windows, Solaris, AIX, etc).
Most unusual thing I've used Perl for (Score:2)
Sheesh... (Score:3, Insightful)
First, and more than sufficiently, of all: who the $curse is going to be taking coding language advice from CIO Magazine? If it's a real practicing software developer, they need to turn in their geek card and coder license immediately. And if it's a CIO or other PHB-level entity, for the love of $DIETY, don't let him start dictating software tool choices on the basis of stuff like TFA!
Second, the author of the article sounds like he has only ever dabbled with Perl, sysadmin-tool-like. He betrays a disturbing unawareness of the recent development in frameworks and methodologies in the Perl universe that track most of the major software development trends and tools available in other communities. His advice, positive and negative, seems stuck in basic out-of-the-box Perl 5.6 or something. Most of the time, that's plenty good enough for the ol' sysadmin "Swiss Army Scripting Language" approach, but certainly missed out on a lot of good work. (The reader comments after the article call him out on this pretty well, so I won't rehash.)
Third, a lot of the advice is universal, not Perl-specific. I mean, stuff like "Don't use Perl in an obfuscated fashion" is like "Don't drive a 1973 Dodge Ram pickup truck while drunk." Very true, very sage advice, but the problem is not Perl (or the truck), it's the obfuscation (or the drunkenness). Code readability is a timeless, domainless, endless problem. The only reason Perl gets picked on for readability is basically bad PR.
Frankly, a lot of TFA just sounds like an excuse to fill up a few column-inches the editor needed filled in.
They forgot #6 (Score:3, Funny)
one of my proudest moments... (Score:3, Interesting)
Real World Counter Example (Score:3, Informative)
Specifically, the Zappos site, built with Perl, was rated the fastest retail website in the world [internetretailer.com] for broadband customers for much of 2006. It beat out Amazon, Dell, Best Buy, etc, etc, you name it. It was also the most consistent speed and the fewest errors. Search Internet Retailer for the more numbers. It always places in the top 5.
Also, the claim that one might mix HTML in scripts is a sign that this guy hasn't actually used Perl in the past decade. Everyone switched to powerful templating systems sometime in 98. There are several very nice web development frameworks for Perl these days. Just like almost any other language.
The rest of his criticisms are more valid. I wouldn't try writing graphic intensive applications, or anything with heavy math processing in Perl. And the most common complaint, that it doesn't prevent you from writing messy code, is certainly true. Of course, just because your code looks neat doesn't mean it's good code either
Cheers.
Re: (Score:2, Interesting)
I actually read the f**king article and came away feeling dumber for actually having done so. Funny enough, I did not see one point that you could not use Ruby or Python to make the EXACT SAME CASE.
Data manipulation in place? Cripes, if I'm in an Excel file perhaps I could write VBA to do the same thing and a lot easier at that.
This kind of thing is just inane.
Re: (Score:2)
Perl scripts may not be portable because they use modules that are not installed everywhere. Shell scripts may not be portable because they use executables that are not installed everywhere. I don't see how one improves upon the other, and it's really pretty easy to install things from CPAN.
Re:PHP WTF?! (Score:4, Interesting)
Re: (Score:2)
For reference, I use PHP like a lot of people use Perl. I'm a hardcore assembly/C developer by day, but realistically, we all need to massage data and such, as well as provide web tools to perform certain tasks. I've written moderately-sized web apps in PHP (about 70 different dynamic pages, with the whole system getting about 100k page loads per business day), and find it quite nice as long as you force yourse