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

What's so unique about Perl?

by Ido (Hermit)
on Jul 04, 2005 at 12:51 UTC ( #472217=perlmeditation: print w/replies, xml ) Need Help??

Wearing my Israel.pm shirt, having perlmonks as my homepage, and saying "In Perl, it'd take me 3 lines and 2 minutes." on every exercise given for a month in my Java course, makes people really wonder. And frankly, I can understand them. If I hadn't grew up with Perl, I'd probably wonder too. And so they ask, "What's so special/unique/good in that perl (other people, can't even spell Perl;), that makes you so interested in it?". Can you help me with that question? What do you answer?

Replies are listed 'Best First'.
Re: What's so unique about Perl?
by BrowserUk (Pope) on Jul 04, 2005 at 14:30 UTC
    What's so special/unique/good in that perl

    Perl evolved to solve real world problems, not satisfy some overarching theoretical ideal.

    It has bits which are messy and inconvenient, because the world is messy and inconvenient, but mostly what you need to write most everyday programs (the easy ones and the hard ones) is right there in the base language.

    And when you need to do something that's actually difficult, is has the power to do that to, though you might have to look a little harder to find it.

    Just the right mix of the concrete and the abstract to allow you to do what needs to be done, without jumping through the hoops of theoretical or notational purity.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

      Perl evolved to solve real world problems

      I think this is Perl's strength. I remember reading an article about Perl's design by Larry Wall where he talked about adding shortcuts for the things programmers need to do often. I can't find where I read it originally but these two articles both mention the idea-

      "When they first built the University of California at Irvine campus, they just put the buildings in. They did not put any sidewalks, they just planted grass. The next year, they came back and built the sidewalks where the trails were in the grass. Perl is that kind of a language. It is not designed from first principles. Perl is those sidewalks in the grass. Those trails that were there before were the previous computer languages that Perl has borrowed ideas from. And Perl has unashamedly borrowed ideas from many, many different languages. Those paths can go diagonally. We want shortcuts. Sometimes we want to be able to do the orthogonal thing, so Perl generally allows the orthogonal approach also. But it also allows a certain number of shortcuts, and being able to insert those shortcuts is part of that evolutionary thing." -Larry Wall

      --
      Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: What's so unique about Perl?
by cog (Parson) on Jul 04, 2005 at 13:05 UTC
    What's so special/unique/good in that perl (other people, can't even spell Perl;), that makes you so interested in it?

    How about laziness, impatience and hubris?

    Really, it doesn't take much to do whatever you want to do, it doesn't take long and later on you can brag to the world how quick you've done it and how simple it was! :-)

    Also, the community! Ah... the community...

      Really, it doesn't take much to do whatever you want to do

      No, I can't agree with that. There are many things that Perl can do only with great effort. Just because you can do something in Perl, doesn't mean that your task was "quick" and "simple".

      And besides, should everything in programming be quick and simple? Where would the challenge be?

        And besides, should everything in programming be quick and simple?

        Not everything, but expressing your algorithm/solution should.

        Where would the challenge be?

        In finding the better algorithm/solution.

        ihb

        See perltoc if you don't know which perldoc to read!

Re: What's so unique about Perl?
by brian_d_foy (Abbot) on Jul 04, 2005 at 18:30 UTC

    What makes perl so special is that it's not unique. It unabashedly steals good ideas anywhere it can find them.

    --
    brian d foy <brian@stonehenge.com>
Re: What's so unique about Perl?
by tmoertel (Chaplain) on Jul 04, 2005 at 19:29 UTC

    Not much about Perl is unique; what it can do, so can other languages. Nevertheless, Perl stands out because its expressiveness and particular blend of features give it an attractive cost model. Simply put, Perl lets programmers do more work with less effort.

    After using a language for a few jobs, programmers form an intuitive model of the language's costs; some things are pricey; others, inexpensive. While programmers rarely talk about these models explicitly, they do as a community come to an understanding of languages' relative costs.

    The Perl community, for example, says that Perl "makes easy things easy and hard things possible." This is a crude yet fair statement of Perl's cost model. For most trivial and small problems, Perl imposes the lowest costs that I know of. Because there are more small problems than large ones, more trivial problems than small, Perl often offers the lowest-cost solutions to common problems. Since programmers solve large problems by breaking them into small problems, Perl also has a respectably low cost for larger problems.

    Further, the Perl language has been tuned for common problem domains such as text processing and web programming, which represent a large portion of many modern projects. Testing, something most serious projects invest in, is another domain where a little Perl goes a long way. In other areas Perl's cost model is not so well tuned but still better than most. For example, functional programming in Perl costs less than in more popular languages.

    In short, solving common problems is usually less expensive in Perl than in more popular languages. As it turns out, this is a great feature to have in a programming language.  ;-)

    Cheers,
    Tom

      Indeed, one could characterize the entire Perl 6 effort as trying to lower the cost of the hard things without raising the cost of the easy things. If some of those hard things actually get to the point of being easy things, all the better.

      Though there are, in fact, a few easy things that ought to be harder. As pointed out in another note, Perl has unabashedly borrowed good features wherever it found them. With Perl 6 we're also unabashedly "unborrowing" some of the bad features that snuck in with the good.

Re: What's so unique about Perl?
by demerphq (Chancellor) on Jul 04, 2005 at 15:06 UTC

    Regexes and Hashes as a native part of the syntax. Functional programming tools like grep and map. Closures. Closures. Closures. CPAN. CPAN. CPAN. OO when you want it, procedural when you want it. Closures closures closures. Regexes. CPAN.... Inline::C, POD, CPAN... Perlmonks.

    ---
    $world=~s/war/peace/g

      Regexes and Hashes as a native part of the syntax. Functional programming tools like grep and map. Closures. Closures. Closures. CPAN. CPAN. CPAN. OO when you want it, procedural when you want it. Closures closures closures. Regexes. CPAN.... Inline::C, POD, CPAN... Perlmonks.

      Native hashes, grep, map, closures, OO/procedural combos and inline docs are hardly unique to Perl!

      Having them all in one place - maybe :-)

        Maybe I should have mentioned regexes a few more times :-)

        Seriously tho, you are right, having them all in one place wrapped up in a nice bundle is the real advantage. Having said that I think its arguable that Perl's single most important conceptual advance was/is the seamless integration of regex tools into the language. And Perl6 is apparently taking this to the next level (or is it three levels higher? :-)

        I guess its possible that other languages had similar before perl (AWK maybe? SNOBOL?) but Larry did some subtle things to his implementation that really made a difference to its ease of use and general uptake. Its no surprise that "perl compatible regulare expressions" are now standard fare accross the industry.

        For those not aware of what im refering to, think about pattern escaping in regexes, the original libraries by Kernigham (or was it Ritchie, i can never remember) had capturing braces escaped because it was felt that the main use of regexes would be for parsing C code by C programmers for subroutine signatures. According to legend Larry thought that was dumb and switched it, to the benefit of all of us. He also invented the (?:) notation afaik. Whatever. The point is that if Perl is remembered for anything in the history of computer lore a hundred years hence im pretty sure it will be its role for moving regular expression tools from the esoteric to the commonplace.

        ---
        $world=~s/war/peace/g

Re: What's so unique about Perl?
by castaway (Parson) on Jul 04, 2005 at 14:04 UTC
    It makes the simple things easy, and the difficult ones possible, and all with a nice compact syntax.

    C.

Re: What's so unique about Perl?
by Anonymous Monk on Jul 04, 2005 at 18:05 UTC
    Perl isn't simple, or elegant, or theoretically brilliant.

    It's ugly, awkward, and arcane, but it sure gets work done.

    It's easy to write perl code quickly. It's easy to get that fast, 90% solution working in a few minutes.

    Perl is essentially executable pseudo-code; with all the advantages and disadvantages that such a lack of rigour brings.

    Perl makes ad-hoc data structures easy; you can often code up a perl program in the time in takes to map out all the header files for the data structures in C. Writing a perl version that verifies that the pattern and data types of the structures are being maintained, on the other hand, is a lot more work, and a lot of runtime typechecking.

    People like the way that there's more than one way to code Perl. They ignore the resulting implication that there's multiple ways to have to maintain perl.

    Perl is nicest to work with when you don't have to work with other people's code. They probably didn't document it, and it's probably a horrible mess of maps, greps, ternary operators within ternary operators, and an embedded finite state machine that is really only in there because the author wanted a chance to try out all those neat formalisms from university. Worse yet, you'll only be authorized to change a few lines here and there (because it's now "production code"), and you'll wander through a Byzantine maze of your predecessor's making for the rest of your corporate life. But I'm not bitter. Honest.

    Perl is very good for one offs, replacing shell scripts, and other small scale tasks. It only scales well to larger projects when all the developers are willing to put together a lot of extra discipline, care, and gentlemen's agreements before the system can be trusted to work together at all well.

    Perl is quite good for getting simple things done fast. It doesn't scale terribly well, but it usually doesn't need to. It's not the perfect languages for all situations, but it's reasonably good for most tasks, much of the time.

    That's why I say Perl is good.

Re: What's so unique about Perl?
by kiat (Vicar) on Jul 04, 2005 at 14:36 UTC
    It's possible to be productive in perl without knowing a great deal about it and about programming.

    The other reason is CPAN. I can't imagine getting things done without CGI.pm, DBI.pm, FormEncryption.pm and Template.pm, to name but a few.

Re: What's so unique about Perl?
by tlm (Prior) on Jul 04, 2005 at 15:53 UTC

    I could give reasons, but it'd be somewhat dishonest, because I can't give reasons for liking Perl any more than I can give reasons for liking my favorite bourbon (say). For better or worse, I just enjoy programming Perl.

    Maybe you can come up with some simple problem and tell the person: "First solve it with Java, then learn enough Perl to solve it with Perl, and see for yourself."

    the lowliest monk

      Bourbon and Perl - sounds like a dangerous combination!

      BTW, my fav is Wild Turkey

      ...it is better to be approximately right than precisely wrong. - Warren Buffet

Re: What's so unique about Perl?
by Anonymous Monk on Jul 04, 2005 at 16:26 UTC
    It's all the hot Perl chicks.
Re: What's so unique about Perl?
by mikeraz (Friar) on Jul 05, 2005 at 17:57 UTC

    User scalability A rank beginner can start in with perl with something like

    #!/usr/bin/perl @files = `ls`; for (@files) { `cp $_ backupdir`; } # yes, OK, hideous example, beyond hideous # do you recall one of your early Perl efforts that was # just a bunch of system calls?

    using backtick or system calls to do with shell what is still a mystery in Perl. As Perl is learned the syscalls disappear.

    Quickies Whether it's a command line one off or a "tpl" test case creating a small test to check your concept is just brain dead simple.

    Language Scalability Perl is appropriate for a wide range of projects. It's difficult to run into a limitation in Perl that will force you to learn another language to get the problem solved. Thus you'll spend more time improving your core language skill.

    CPAN Wheels pre-invented in almost every imaginable size.

    TIMTOWTDI Personal neural nets differ. Perl allows one to create a code construct that closely matches the mental contruct. This is part of what makes the user scalability possible.

    Well, at least that's what works for me.

    Be Appropriate && Follow Your Curiosity
Re: What's so unique about Perl?
by gsiems (Deacon) on Jul 05, 2005 at 02:57 UTC

    How about:

    • Perl is fun.
    • It makes many of my tasks easy, or at least easier.
    • A littl perl can go a long way.
    • Oh, and perl is fun.
    • CPAN
    • PerlMonks
    • Did I mention that perl is also fun?
Re: What's so unique about Perl?
by TedPride (Priest) on Jul 05, 2005 at 04:45 UTC
    Perl lets you do the most work with the least amount of code.
      Nah, that's APL.

        Maybe he should have qualified that with "without needing a special keyboard" :-)

        /J\

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://472217]
Approved by neniro
Front-paged by rinceWind
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2020-12-05 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (65 votes). Check out past polls.

    Notices?