Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Perl is a black diamond language?

by amelinda (Friar)
on Nov 29, 2000 at 02:34 UTC ( #43790=perlmeditation: print w/replies, xml ) Need Help??

In another node, merlyn writes:
Perl is intuitive, but not for casual programmers. If you're needing to look up how to get the length of an array, Perl is not for you. Perl is an expert language: very powerful in the hands of experts, but perhaps dangerous to the casual programmer. It's more like a chainsaw than a knife. You must be this tall to program in Perl.
Is this really what people think about perl? That those who don't really know perl ought to just get out of the way and let us1 experts do our job? That you better know all the syntax of Perl before you even try to program in it?

I certainly hope it isn't. I hope that merlyn's just mouthing off because he's replying to princepawn. I hope that he's meaning something more along the lines of "if you've never coded anything before, Perl might be really complicated for you." I hope he's kidding, even if he does mean that, because, if I'd learned Perl first (instead of Pascal), I wouldn't have fled programming for three years. I hope that he's meaning something like "if you have to ask someone else about how you would find the length of an array, because you're unclear on the concept, Perl is not for you." I most certainly hope that he doesn't mean "if you don't already know Perl, Perl is not for you." If I'm totally misreading, please let me know.

Because otherwise I'm in a lot of trouble, since I don't keep the Perl 5 Pocket Ref on my desk just to hold down my papers.2 Anyone else?

1 And by us I mean them folks what are Perl experts and guru types, which is definitely not me.
2 It's a question of syntax more often than anything else, I've done some time as a programmer in other languages too. I keep Programming Perl on there too - thanks for writing it, merlyn.

Replies are listed 'Best First'.
Re: Perl is a black diamond language?
by neshura (Chaplain) on Nov 29, 2000 at 05:38 UTC
    English teachers often teach because they have a passion for the language. English is a difficult language, easy to abuse. You may abuse it the way James Joyce does, or the way a child does. Languages are always in transition and people are always in the process of learning them, and they make mistakes and do ignorant things. Such is the nature of learning a language (and teaching it)!

    But I've never heard an English teacher give up in frustration and tell a student that maybe they would be better off with Esperanto.

    So all (or perhaps only some) things considered, I believe first that Perl is for everyone who wishes to learn it. Second, that no question or questioner should be turned away for questioning the foundations of a language. And third, that having a third point might benefit my argument. Sadly, it is not so.

    e-mail neshura

Re: Perl is a black diamond language?
by davorg (Chancellor) on Nov 29, 2000 at 14:56 UTC

    Some random thoughts on the subject.

    • I used to think that Perl was a bad choice for a first language, but then I read Andrew Johnson's Elements of Programming with Perl and now I'm less convinced.
    • I still think that you appreciate Perl more if you've got a background in some more 'traditional' language. If it's your first language, you won't know how much easier most things are in Perl than, say, C.
    • The problem is not so much that Perl is hard, but that programming is hard. There seems to be a believe that anyone can write CGI programs in Perl because "it's only a scripting language" or "web stuff is easy", but you really shouldn't be thinking or writing CGI stuff without a strong understanding of programming (especially network security issues) otherwise you end up with something like Matt's Script Archive (and if anyone's not sure - that's a bad thing)

    Er... I'm not sure what my conclusion is :)


    "Perl makes the fun jobs fun
    and the boring jobs bearable" - me

Re: Perl is a black diamond language?
by IndyZ (Friar) on Nov 29, 2000 at 02:59 UTC
    I certainly don't think that Perl is too tough for beginners. Before Perl, my only programming experience was in Basic. My experience in Basic taught me about items that are necessary in every language, like structure and flow control. Later experience in Visual Basic taught me to drop my bad goto habit.

    About two years ago, I was able to quite easily make the jump to Perl. Other programmers I have showed Perl to have trouble grasping the concept of not designing a user interface, and moving away from event based programming, but other than that, they find it easy accomplish simple tasks almost immediately.

    Then again, I might be wrong. The people that I hack with think that command lines are intuitive and that point-and-click wastes time. My best advice: Try it. If it works for you, great, and if it doesn't, Python is pretty nice.

    Sorry about all of the copyright symbols. It looks like I have to report another Mozilla bug... In case you only saw this after the edit, Mozilla put in copyright symbols instead of periods (among other things.) The problem is, it lookes fine in Mozilla. Even worse, I spent an hour updating a Slash site before I noticed. It took about two hours to fix.


Re: Perl is a black diamond language?
by clemburg (Curate) on Nov 29, 2000 at 18:25 UTC

    My 2 cents:

    merlyn says:

    • Perl is intuitive, but not for casual programmers. - This is very true I think. Also, it should have been "but not for casual Perl programmers". If you doubt that, compare some random Perl snippets that people post on this site to some Python snippets. Python looks much cleaner. The same holds for PHP. Perl (or Perl programmers) often trade(s) readability for expressivity.
    • If you're needing to look up how to get the length of an array, Perl is not for you. True. To make use of the strength of Perl, you just need to know the common idioms. But that holds for all other languages, too. So it's not a point in favor of or against Perl specifically.
    • Perl is an expert language: very powerful in the hands of experts, but perhaps dangerous to the casual programmer. This is only partly true, I think. Perl gives you the rope to hang yourself, sure. And it does not go out of its way to catch errors you make, like Java does, if you don't ask it to do so. But also, due the large set of built-in operators and all those CPAN modules, Perl makes it very easy to do very complicated tasks, so it is a big help for beginners. Just think of how all those automatic type conversions in Perl will prevent an awful lot of errors in custom-written conversion code, or how the list operators simplify handling of lists. Perl hides an awful lot of complexity very well. If this means that it is intended for experts depends on your viewpoint - if you think you should understand all of your code, then it means yes. If you think that you just need to get the job done, it means no.
    • It's more like a chainsaw than a knife. Funny - somehow these cutting-tool comparisons seem to occur naturally to programmers. In The Practice of Programming, Kernighan and Pike compare C to a razor - "C is a razor sharp tool, with which one can create an elegant and efficient program or a bloody mess.".
    • You must be this tall to program in Perl. No. You just need to be able to take the consequences of your actions. Perl is not a guru language.

    Christian Lemburg
    Brainbench MVP for Perl

Re: Perl is a black diamond language?
by Blue (Hermit) on Nov 29, 2000 at 19:06 UTC
    Here's my take on it. Perl is a very large and flexible language. Any language that boasts TIMTOWTDI as a feature means that there is no 'one true way'. This may make it a hard language for someone without any programming experience. Perhaps a more B&D language is a better choice for a first. Perl as a first language has been discussed here.

    But I think it's fine for a casual programmer up. It is very easy to write Perl code, and probably repeating something merlyn said, it's very easy to write bad Perl code.

    What this means is that you can pick up Perl and start using it immediately. But it's very flexibility means you aren't going to be forced to do things 'right'.

    Personally, based on how I learned, I effectively learned a subset of Perl that didn't include many things people consider good practice - use strict, modules, etc. I didn't omit these because I was a bad programmer, I omitted these because I was unfamiliar with them and I knew (heavy irony) enough Perl to do what I need to. I still wince at the mess my early programs were.

    However, I think that Perl is mature enough to avoid that - there are innumerable resources, web, book, and people, to allow one not to hurt oneself with the chainsaw if one takes the time to check them out. And past that it's just practice, like any language.

    =Blue might be eaten by a grue...

      Right on the money Blue. I've been (ab)using Perl for a very long time compared with most people here, and yet I've managed to touch only a small part of it. Even so, it has been a great replacement for the type of work I used to do in C and/or Fortran (and I made much use of Perl's portability, far more real than that of C or Fortran!). While Perl is wickedly powerful, it also makes complicated string manipulation very much easier than most other languages I've tried.

      Now I'm still using Perl on a daily basis, but the stuff I write now is much cleaner and easier to debug, as well as likely faster to write and execute. I still keep my fingers off the big red buttons for the most part, but reading all I can here and experimenting has definitely improved my results.

      Back to the point of this thread, I think Perl can be used by (and offers benefits to) anyone that could comprehend any other programming language, and the best part is you don't need to move to a grown-ups language when your interest exceeds its capabilities ;-). One doesn't need to be a soldier from Switzerland to make good use of a swiss army knife, especially when all one needs is the bottle opener (hmmm... that sounded much better in my head).

Re: Perl is a black diamond language?
by marius (Hermit) on Nov 29, 2000 at 13:21 UTC
    IMHO I think merlyn is wrong in this case (gads, I never thought I would say that). Granted, I'm no perl guru/expert (yet). I've been tinkering with perl for the past few weeks (ok, i've tinkered before, but always had to put it down for some other rush project on the job/at home) and have never really been formally schooled in any programming language (I took a pascal class once, but I knew more about computers in general than the teacher.. we didn't learn much pascal =]) Armed with the Perl CD Bookshelf, I read through Learning Perl, and am about halfway through "reading" Programming Perl. I think it's pretty easy to pick up, and it "just makes sense"(tm). I fiddled with PHP before picking perl back up, and the languages are disturbingly similar.

    Perl isn't a difficult language to learn, and by all means newbies that have some gumption into doing a little bit of research/work to learn something shouldn't get out of the way.

(d4vis)Re: Perl is a black diamond language?
by d4vis (Chaplain) on Nov 29, 2000 at 23:22 UTC
    My boss came to me yesterday and asked if he knew of a way to 'clean up' the passwd file on our mail server. He basically just wanted a list of all the email accounts. I said 'no problem' and whipped up a quick script to sort alphabetically, pull just the username and Name fields, and ignore the system-level accounts. As an added bonus I gave him a list of all accounts that had bad group ID's or bad comment fields and made it all look purty with format.
    It took me about 20 minutes.

    This is the reason sysadmins like me use Perl. I am almost the platonic form of the "casual programmer". I may never build anything over 50 lines in my entire career, but Perl saves me time and effort every single day.
    Is it dangerous? Maybe, but big deal, I break stuff all the time, and if I break it with the chainsaw I can fix it with duct tape.

    I think Perl just excels as a tool for the casual programmer.

    ~monk d4vis

      I suggest looking at getpwent. This will work even if your code some day has to deal with things like nis...
Re: Perl is a black diamond language?
by japhy (Canon) on Nov 29, 2000 at 20:34 UTC
    It's always been my opinion that to be a good programmer, there is a certain mindset or capacity required. There are people that just won't get it. They don't have the ability to think in the manner required. This has been my experience.

    japhy -- Perl and Regex Hacker
(brainpan) Re: Perl is a black diamond language?
by brainpan (Monk) on Nov 29, 2000 at 14:34 UTC
    I once read a review for a piece of software that began by stating that there was not any "intuitive" way to interact with pixels on a screen, that any interaction with a computer could only feel natural or logical once you understood the methodology that the software's creators were using. I can't recall what that review was of, (I'll update this if I do) but I think that this is along the same lines as what merlyn was saying. Once you figure out the method behind the "line noise with punctuation" madness, then perl does feel natural. If you come to perl and can't stop asking questions like "how do I define a variable as a floating point integer?" you're approaching things from another valid, albeit inapplicable to perl, logical framework. Once you start asking the right questions you're already well on your way to mastering the language.

    Update: The review I mentioned was for Konqueror and may be found here.

    And no, I don't own 27 pairs of sweatpants.
Re: Perl is a black diamond language?
by zigster (Hermit) on Nov 29, 2000 at 15:57 UTC
    Just to add my 4.5 pence, I agree with merlyn however I suspect he overstated the point. Without wanting to place words anyones mouth except my own, here is my opinion.

    Programming is complicated Word its complexity has very little to do with the language you choose to use. The craft of programming is more of an art than a science. Many programmers thing (wrongly imho) that the way to be better programmers it to learn more of a language, I think the way to become a better programmer is to learn more of the craft beneath the language.

    Perl has the potential to be a sloppy language, give me a white noise generator and I will show you a perl code generator. This sloppyness comes form the many and various different shortcuts and helps that make perl the power tool that it is. If you do not have the experience to know when to use these shortcuts and when not to then you will not advance your craft as a programmer. With an understanding that comes with experience you will use perl in more effective ways.

    If your first language is perl you could trivially become a productive programmer, however is it the best way to learn the craft .. imho no it is not.

    -- Zigster

Re: Perl is a black diamond language?
by cadfael (Friar) on Nov 29, 2000 at 20:16 UTC
    This has been one of the more interesting meditations of late. There are points to be made on both sides, but I think I come down a little more on amelinda's side.


    Because I have found Perl to be an extremely adaptable language -- much like a swimming pool. I started in the shallow end, using perl for quick-and-dirty substitutions and string rearrangements. As my experience increased, I found myself venturing out further into the pool, even to the point of being over my head. As my skills evolved, and continue to evolve, I find myself doing things I never considered while I was still wading in the shallow end.

    Perl is a language that can be used by the neophyte and the expert alike, and be of great use to both ends of the continuum.

    "Computeri non cogitant, ergo non sunt"

Re: Perl is a black diamond language?
by chromatic (Archbishop) on Nov 30, 2000 at 10:22 UTC
    Having come out of a Java background to become a somewhat respectable Perl programmer, I find myself disagreeing somewhat with merlyn.

    You must be this tall to get Perl to work for you, rather than wrestling with it (for programs longer than, say, 50 lines).

    I also agree with davorg. Elements is a great introduction both to Perl and programming. And really, most of the battle is figuring out ways to phrase your request that will make sense both to the computer and to you.

Re: Perl is a black diamond language?
by coreolyn (Parson) on Nov 29, 2000 at 21:17 UTC

    Perl has unique flexibility that actually is conducive to learning code. The speed with which a new programmer can see the results of code (even if it's not what they expected) gives the novice a sense of satisfaction and direction for what needs to be corrected. Many languages create the priority for deciphering error messages over learning syntax. Perl will just puke out what ever you put in.

    Small children burn there tounge when learning what 'hot' really means, but they learn the lesson instantly. Perl pours hot coffee into a programmers lap, and teaches not to do that again in a most efficient manner.

    Other languages require the learning of programatic philosophies based upon the unseen expirience of the language developers. Perl hands the keys over for you to figure it out for yourself.

    It depends upon how a novice best learns as to what language is best to learn on. To make perl a 'black art' is great for exposing the 'hubris' of the perl mindset, but behind the curtain it's just plain fun and all perl people know it :)

    coreolyn Duct tape devotee.
    -- That's OO perl, NOT uh-oh perl !-)

      Sorry but I totally disagree.. I think ;-)

      Perl pours hot cofffee into a programmers lap .. it doesnt tho that is the problem it is very flexible and forgiving not of errors in syntax maybe (hmm) but it is certainly forgiving in terms of poor programing method.

      I think the most telling comment you make is that other languages require the learning of programin philosophies .. thats the point (IMveryHO) perl does not you can just code top to bottow with no real requirement about what goes on in between. The language imposes no discipline upon the coder, that discipline has to come from the coder themself.

      I would not say that perl is a black art, I would say that it is a lot harder to code good perl than it is to code good java, for example.



Re: Perl is a black diamond language?
by Maclir (Curate) on Dec 01, 2000 at 08:27 UTC
    Well, I am probably joing this discussion far too late (blame in on somewhat more important things, like our DHCP server getting upset). I have a few points to add, as someone who has been programming for over 25 years - and starting with good old Fortran IV - on punched cards, no less.

    Any programming languange can be a suitable language for a person to learn programming on. The actual syntax and usage of a language is not what is important, but how to translate real world problems into a structured set of "rules" that accurately reflect the business problems, and how to design, build and test software that does the required job, is reliable, maintainable and so forth.

    Be that as it may, Perl is a good introductory programming language, in that it is easy for new programmers to get something working quickly, and early in their learning cycle. Sure, there are many powerful capabilities with Perl, but all that can come later.

    The important thing for programmers to understand very early on is the importance of good design, structured code, variable scope, etc, etc.

    Two thoughts that I believe are relevent here:

    1. Fortran programmers can write fortran programs in any language.
    2. (and in response to Merlyn's Perl is intuitive) The only intuitive interface is a nipple.
Re: Perl is a black diamond language?
by lindex (Friar) on Nov 29, 2000 at 06:15 UTC
    One remark ...
    I do beleave that perl is not the best language for someone to "start" programming with.
    Its just to loose and to flexable ... for a lack of better words, to easy to pick up bad habbits :)

    /****************************/, /*****************************/
      And the language that I presume many of us started out with was fine? I am of course referring to BASIC.

      ALL HAIL BRAK!!!

        Well I started out with C using gcc as my compiler ... but really I started doing client side IRC scripting long before that :)
        Brought to you by that crazy but lovable guy... lindex
Re: Perl is a black diamond language?
by mrmick (Curate) on Nov 29, 2000 at 20:53 UTC
    I'm really enjoying this thread!

    I think that Perl can be for everyone. Why not use it as a first language? Think about it... It's not strongly typed and permits us to do things with much less code. It's also very powerful in many respects and can be used to demonstrate many of the basics in programming.

    Sure, it gives us enough rope with which to hang ourselves but it can also (with 'use Strict;') enforce certain rules. Besides, it's not the language that teaches one to program, it's the teacher. A teacher can be a book, a person, a tutorial, or even (who would have known it!)

    I think that the immediate gratification we get from Perl programs would help beginners to pick up on programming more quickly because they don't have wait to see what the program does.

Re: Perl is a black diamond language?
by royalanjr (Chaplain) on Nov 29, 2000 at 21:39 UTC
    I am certainly no Perl expert; far from it. But does that mean that I should not program Perl because I have to look stuff up more than others might? It most certainly should not. One of these days I will be at the point where my book starts gathering dust. But until then, I flip pages as often as I need to, and am not ashamed.

    Roy Alan

Re: Perl is a black diamond language?
by gaspodethewonderdog (Monk) on Nov 29, 2000 at 20:50 UTC
    Perl can be as easy or difficult a language as you make it. Personally I think Perl is just as good a learning language as C++ or Java or any of the other languages that many colleges and schools teach. It is sort of funny that most colleges don't teach Perl that much, but in my experience having worked in the lab as a sysadmin that Perl held the entire place together. Probably teachers just don't consider Perl quite as sexy as other languages.

    I picked up Perl in a weekend, and my background at the time was c/pascal/shell/assembly. I can certainly say that I hadn't seen anything quite like it, but it isn't like any of the rules that govern code don't apply to Perl. There is not anything mysterious there... just think of Perl as being more expressive than anything else. You can say a lot more in one line of Perl than you can in one line of C. This isn't such a big deal because you can say a lot more in one line of C than you can in one line of assembly. You're just one step up the programming food chain in Perl if you want to look at it that way.

    You should also take what princepawn, merlyn or anyone else (including me) says with at least a grain of salt. Sometimes I think princepawn's questions are a little too bizarre.. he almost *must* know what he is talking about. Merlyn has been programming Perl for so long that it is part of him and I don't know if you can always get the 'layperson' information you need from him.

    Don't fret though, you're in good company and if you really do want to learn Perl this is as good a place as any. Just pick up a good Perl programming book and when you get stumped ask your questions because I'm sure you will get an answer.

    Hope you stick with it!!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://43790]
Approved by root
[Corion]: But people writing such code should document the objects they construct and why it makes sense for an object to be invisible as string while being true in a boolean context
[hippo]: That's equal parts clever and horrendous.
[Eily]: the overload version wouldn't return true with "$x" && !length $x though, I guess
[hippo]: The more I look at this code, the more $x is a plain old scalar and the more this condition will never be true. I'm calling it a bug at this point.
[hippo]: Thanks for your input which has soothed my sanity (a little)
[Corion]: Eily: Sure - if you force both things into stringy things, then you break that magic. But that would also mean that you changed the expression, as now $x = 0.00 will be true instead of false as it were before
[Corion]: Ah no, at least in my feeble experiments that doesn't change the meaning
[Corion]: We sell sanity in small packages ;)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-07-27 13:42 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (413 votes). Check out past polls.