From: thesz

2008-04-28 01:38 am (UTC)

There is very little class of jobs where perl could be used regularly.



The above oneliner says it all. ;) From: ryani

2008-04-28 03:23 am (UTC)

Actually, I've seen very few programming jobs where you -couldn't- use perl regularly. Sure, it isn't going to make up the core of whatever product you are working on, but every project needs little administrative tools & scripts, not to mention the "I need to figure something out from a logfile RIGHT NOW" problem that perl so excels at.



That said, the team I'm on seems to use python for these purposes. Perl is getting a bit deprecated because python does basically everything we want from perl and doesn't require a language wizard to make it not be write-once. From: thesz

2008-04-28 04:05 am (UTC)

I think your comment is applicable for very small amount of "regular use." ;)



Those tools & scripts are done once and for long time.



And I agree that more regularly structured Tcl and, say, Python are just more convenient to use. And more productive after all.



PS

I once wrote two small Tcl programs to solve our small problem, just two little different algorithms. I tried them, found nothing interesting in results and deleted them. Then my colleague came up and said "Here, my Perl oneliner for that problem! Can you beat it in size?" ;) From: pozorvlak

2008-04-28 08:41 am (UTC)

Au contraire. From: thesz

2008-04-28 09:05 am (UTC)

Good argument. ;)



I change my statement to "For me, there is..." And generalize to "For smart people, for very large values of smart, there is..."



Because I can. ;) From: pozorvlak

2008-04-28 09:37 am (UTC)

very large values of "smart" to exclude, say, I'm sorry, but you have to generalize tolarge values of "smart" to exclude, say, Damian Conway :-) From: thesz

2008-04-28 09:59 am (UTC)

Measurement error. I'll live with that. ;)



BTW, only two of his papers are about Perl. From: pozorvlak

2008-04-28 10:17 am (UTC)





Plenty of other smart people use Perl, but perhaps that's not such a recommendation - plenty of smart people use Fortran :-) But I will say that one of the things that surprised me about London.pm was how many of them knew Haskell. This was in 2004, before the boom had really started. Sure, but he's also written rather a lot of CPAN modules , many of them insanely brilliant. Or possibly brilliantly insane.Plenty of other smart people use Perl, but perhaps that's not such a recommendation - plenty of smart people use Fortran :-) But I will say that one of the things that surprised me about London.pm was how many of them knew Haskell. This was in 2004, before the boom had really started. From: thesz

2008-04-28 11:08 am (UTC)

I started to use Haskell in 1999. ;)



In 1998 I made an implementation of interesting idea (like one proposed recently by John Carmack - using octree for ray-tracing). I implemented it in C, and thought that C would be not a good language to experiment on my idea. So I started to search through lists of programming languages and, on second or third iteration was struck by Haskell elegance.



Now I use Haskell almost everywhere. ;) From: pozorvlak

2008-04-28 11:33 am (UTC)

Then you have a few years on me :-) I first started using Haskell in 2001 or 2002, then hit a problem I couldn't solve in about 2003 and abandoned it for a while. I've tried to pick it up again a couple of times since then.



But still, Haskell was a lot less well-known in 2004 than it is now. I remember that I usually had to preface any discussion of it with "have you heard of Haskell?" From: necaris

2008-04-28 06:13 am (UTC)





True. I don't know about you but I think Python tries harder, somehow, to be a *proper* language ("No! It's not just a scripting language! Look, we have built-in OO!") and consequently I find it rather harder to throw something quick together than I do in Perl.



What ryani If you need a Perl-like language infrequently, Python occupies roughly the same niche but aims at consistency and simplicityTrue. I don't know about you but I think Python tries harder, somehow, to be a *proper* language ("No! It's not just a scripting language! Look, we have built-in OO!") and consequently I find it rather harder to throw something quick together than I do in Perl.Whatsays is what I end up doing too -- if I want to reuse and expand the script, I often rewrite it in Python. But then, if it does the job, why does it need to be more than write-once ;-)? From: (Anonymous)

2008-04-28 09:58 am (UTC)

why does it need to be more than write-once ;-)? This is the biggest problem that imprecates all the "admin" scripts!



Why cant we treat those sidekick scripts as 1st class citizens? you will be surprised to find that the world has suddenly become a better place once you do it. just try it!



Every "script" starts its life as a one liner - does not end as a one liner!

it ends its life as a gigantic ball of turd that will elude even the bravest and smartest on your team.

Then it will die a slow and painful death as it gets rewritten from scratch the right way.



Treat every script as though someone else will have to maintain (someone could be you 24 hours from now)



clean_scripting:

Thats where Python shines



If its a true one liner - don't ever save it to a file - thats been my strategy. Let it die a premature death - right after its born :) From: pozorvlak

2008-04-28 10:19 am (UTC)

Re: why does it need to be more than write-once ;-)? If I need to save it to a file (rather than specifying it as an argument to perl -e), the first thing I do is tidy it up. If I need to save it, then I've already demonstrated that it's too hard to write it in one-liner style! From: necaris

2008-04-28 11:03 am (UTC)

Re: why does it need to be more than write-once ;-)? Well, that's exactly it -- if I'm doing anything complex enough to require Perl over a shell script, and I can be bothered to save it properly, then I'll make sure I can grok it at a glance.



There's some horrendously ugly Python scripts out there as well (I've written a couple!) :-) From: pozorvlak

2008-04-28 10:21 am (UTC)

Re: why does it need to be more than write-once ;-)? BTW, not dissing Python at all. Python's a great language, and I'd very probably be using it if Perl didn't exist (though I might go for Ruby instead). On the other hand, I think Python's less assumption-challenging than Perl, and thus less interesting from a language-design perspective. From: (Anonymous)

2008-04-28 02:35 pm (UTC)

Re: why does it need to be more than write-once ;-)? I was using perl first when i switched to Unix. Back then i thought it was a great language.



I think perl is _still_ a good language BUT it has weaknesses which I think were never addressed. People may laugh but actually I found PHP a lot more practical than Perl (!) soon later for some years. But PHP actually, from a language's point of view, is a horrible language. I stopped writing any php code.



After maybe 2 years of PHP i started playing with ruby. The decision back then was between python and ruby, and the real difference was a talk matz did back then. He emphasized the thinking aspect, inside an OOP "world". (I already knew how beautiful pure OOP can be as I coded in a LPC mud for a few years too).



What shall i say? I am using ruby since 5 years now. I think I know what kind of language would replace ruby _for me_ (a pure prototyped language that is conceptually easier than ruby, but still very powerful, slightly faster and would include features that are rare to see, like behavioural "code snatching" from other live prototype objects, and cell-oriented prototyping, but i stop now before dreaming)



The thing with Ruby is - I love the elegance. If I compare my ruby code to my perl code, I cant stand the perl code anymore. I dont have that problem with python, and I think it is BAD that perl has a "write once, throw away" attitude as far as maintaining source code is concerned.

This is why I recommend python over perl too, also because python seems to have a lot more momentum than perl. (But of course, I would recommend ruby over python even though python is a tad faster.)



I think new people should choose between python or ruby instead of perl and php. PHP is not a serious contender because outside the www it was never successful, but perl was around FOR SO LONG and the cool ideas these days simply arent done in perl. Perl 6? That reminds me of the HURD jokes.





Hurd will be ready next year ........ From: necaris

2008-04-28 03:47 pm (UTC)

Re: why does it need to be more than write-once ;-)? I think new people should choose between python or ruby instead of perl and php



Couldn't agree more -- as general-purpose languages those two have a huge amount going for them. But as you say, Perl and PHP are good languages in their own right and have their place -- be it tight integration into webpage generation or effortless text-processing -- and I hope you're not saying they're not worth learning? From: pozorvlak

2008-04-28 06:51 pm (UTC)

Re: why does it need to be more than write-once ;-)? the cool ideas these days simply arent done in perl.



Are you serious? Have you looked at CPAN recently? From: (Anonymous)

2008-04-28 10:29 pm (UTC)

Re: why does it need to be more than write-once ;-)? "how beautiful pure OOP can be"



Jesus, is that a joke? Pure OOP is horrible. Pure anything is horrible because the world isn't pure anything. Programming is about modeling, and you need to be able to pick a modeling style that suits the problem. Adapting the problem to the modeling style is just back asswards. From: ext_94702

2008-05-25 04:13 pm (UTC)

Re: why does it need to be more than write-once ;-)? See, this is why LiveJournal needs a rating mechanism for comments. Digg/upmod! From: (Anonymous)

2008-04-28 10:37 pm (UTC)

Re: why does it need to be more than write-once ;-)? The cool things these days simply arent done in perl.



Not all cool things are famous or spectacular.



I do all my scientific data reduction in perl, including heavy duty image processing work (well, OK, I use the PDL language extension in CPAN). A few days ago, I was sitting in a panel discussion and, in five minutes of idleness, wrote a little perl script to retrieve, process, and plot all of the published magnetometer data from the Voyager spacecraft -- just by inspecting a few lines of one of the data files. Cool? Very. Famous? nope.



I've written 100,000 line programs in many languages over the years -- C, FORTRAN, Pascal (yuck!), a monstrosity called "Objective C", and Perl. I don't find Perl to be any harder than anything else to scale big -- it just takes discipline to keep from using bad constructs or breaking object boundaries. C is just as bad, but without all the nifty stuff to help out. C++ is an evilness, I don't know how anyone uses it. Ruby and Python are both quite elegant and fast to learn, but they don't seem to be as expressive as Perl in the long run -- like the difference between French and English. (French is a much smaller, tightly regulated language, so you must work harder to express nuance -- English is a huge, brawling bar-fight of a language, so you must work harder to learn it, but there are bits and pieces to help express whatever subtlety you want...)



If I compare my ruby code to my perl code, I cant stand the perl code anymore.

It sounds like you may have simply grown as a programmer between your perl and ruby experiences... it's possible to write sucky code in any language, yes?



