Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Choose the most powerful language

by tilly (Archbishop)
on May 01, 2001 at 08:29 UTC ( #76871=perlmeditation: print w/ replies, xml ) Need Help??

A co-worker threw a very interesting piece of Lisp advocacy at me. It is an interesting paper and I think that people should read it before reading the rest of what I have to say.

Needless to say, I have been thinking about it.

I largely, but not entirely agree. However I think that there is a lesson here for anyone who likes any language that they find makes them uncommonly productive.

For those who don't know, Paul Graham is a highly regarded Lisp hacker. How respected? Well put it this way. He is good enough that Dominus lists one of Paul Graham's books as research for an upcoming book. So it is no surprise that Paul Graham argues for Lisp. What interests me is how he does it.

His basic argument is that when you are running a program on a server, you get a lot of flexibility about what language you use. You can control what is installed. It is (relatively) easy to make changes. So pick the language which you can get the most done with. And then he proceeds to argue that that language is Lisp.

I will accept that for him that language is Lisp. I am willing to accept for the sake of argument that Lisp really is a more productive language in some absolute sense. But I can argue that his argument applies for many languages. And, given a different person, you might come up with a different language. Including Perl.

The key is what you can be productive in. His claim for Lisp is that a great Lisp hacker can program Lisp in a much more efficient way than you can program other languages. This is a wonderful argument for great Lisp hackers. And it is a neat argument for learning Lisp. But if you are not right now a great Lisp hacker, it isn't a good argument to run out right now and convert everything to Lisp.

Now what does Perl have going for it? Well among other things it has a pretty good set of features, it has a large and supportive community to help people get better, and it has CPAN. In other words Perl has a lot of ways to help people who are not already great Perl programmers to be productive, ways to help them become better at Perl, and useful tools to help people who are good at Perl to be productive.

Sure, for Paul Graham, Lisp may be the most productive language to work in. However even he, in describing what companies he was most concerned about competing with, gave Perl and Python respect. And even his Lisp-oriented company wrote a back-office manager largely in Perl.

So choose what is most productive for you now. And go out of your way to learn new ways of thinking so you can choose the best tools as time goes by. That includes learning other languages, including Lisp. (The learning of which will make you better at languages you already know, like Perl.) But if you read Paul's paper, and like it, then make your own mind up about what will be the most productive language for you...

Comment on Choose the most powerful language
Re: Choose the most powerful language
by tinman (Curate) on May 01, 2001 at 08:59 UTC

    tilly, I couldn't agree with you more... I've made a few rants on the topic of Java.. but despite all that I may say against Java, there are instances where it makes most sense (business or implementation wise) to use it.. and I am glad I knew it (well, it got me the job I have, ye know ;o)

    Although I don't admit(1) to understanding all about functional programming..I consider myself fortunate to be introduced to Prolog (and indirectly to Lisp and Scheme) when I was in university... together with a great data structures course (in Modula-2, of all things) I "understood" most of the topics that are covered in the upcoming book you mention... I think I realize what a great insight such programming can actually afford you in real life day to day programming tasks..(but wait, isnt most of 'real life' programming about data structures ? ;o)

    As a point to mention, one of the first problems we had in our Prolog class was to define and traverse a family tree.. with the use of a hash and $_ I was able to show off Perl's capability to do the same in only a few more lines :o)

    Right now, though, I think I've hit a plateau of sorts.. Perl and Java seem to occupy most of my coding hours now (well, granted, I don't seem to have endless student hours to try out other stuff in)... Perhaps relearning Scheme and possibly going with Guile or Haskell ? who knows.. but I think experimenting with different languages is more than half the fun :o) Perl works for me, but I think the more (languages) I try to understand, the more productive I can be, in any language...

    my <$0.02
    Update: (1)"not admitting to" means, I only fiddled around with it for one year... I'd like to think I know a bit about it however, but then, I thought I knew 'a bit' about Perl too ;o) (drop in the ocean is a phrase that is particularly appropriate here)

      tinman, I absolutely agree with you- but you should have put that last sentence in bold and had it bronzed. If you don't understand what I mean, consider this: the person who knows more languages, as adeptly pointed out in the article tilly linked to, will simply have a better understanding of ALL of the languages. This person will not only be a more adept coder, but will better understand the risks and venues involved in choosing a particular language and is better suited to evaluate a projects' situation- especially mission critical weaknesses. Correctly evaluating a project is difficult but the more plans of attack you have available to begin with, the better!

      So, for all you new coders out there who have become religious about Perl, I urge you all to at least peruse an online tutorial to introduce yourselves to other language environments!

      AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
        --
        Hear Hear!!!

        After a brief early stint with Perl I ran off and became a
        C hacker. Now I can say I'm absolutely religious
        about Perl, but would not have fully appreciated it if it
        weren't for my other language experiences.

        Now knowing Perl, C, Java, and a bit of some others like
        Python, I have settled into using Perl when it makes
        sense (i.e., most cases) In some cases C is
        the most efficient or faster to code in (Yes, but depends
        on the problem...) orsometimes Java, etc.

        I think to be a really dynamic coder it's important to at
        least become familiar with the general structure/syntax
        of other languages so you know they may
        (unfortunately) be better than Perl for the given
        situation.

        My daily prayer is usually
        something like this "May the day's tasks best be
        handled by Perl, and save me from the abyss of C
        and any Java* not served in a cup.

        But then again, maybe I'm a little nuts.

        -Felonious
Re: Choose the most powerful language
by AgentM (Curate) on May 01, 2001 at 09:04 UTC
    Wow. I must say you and the article captured my interest. I never gave Lisp a second thought since I just assumed so much about it - especially its difficulty level. For those who were also intrigued enough by Lisp to give it a better look-over, here's a link to the freely available Common Lisp book available in a variety of formats. Thanks again, tilly!
    AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
Re: Choose the most powerful language
by Masem (Monsignor) on May 01, 2001 at 16:20 UTC
    Most people, in language or OS or application wars, keep trying to force the other side to use their goods, and the other side does the same back. We've had it here as well (Perl is Not Java), and for myself, I find the continual battles odd. Whomever you are, you should choose the best tool available for what gets the job done for you, but the only way to determine that is to use all tools that are out there before you make that decision. And many of these zealots have not used the other language at all or sufficiently to be able to make a firm decision one way or the other, many times only basing their decision on the practices of the corporations that distribute these items.

    But tillys last paragraph above sums up my feelings on this issue exactly; you use the best tool for you for the job, when that option is available to you. If programming CGI in perl is best for you, use it; if programming CGI in Lisp is, do that. But you cannot keep your mind closed to those other possibilities because you may run into situations (eg at work) where you are forced to use another alternative. If you have given each possibly it's fair shake, you should at least know a bit about a possibly that you don't prefer, and you won't be slowed down too much in your efforts to use it. But if you are a zealot, you may have never given the other possiblity a chance, and when forced to use it, you will flounder not only the learning of it, but the distaste of it as well.


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
Re: Choose the most powerful language
by mothra (Hermit) on May 01, 2001 at 17:46 UTC
    I'll start by saying that, in general, I've gotten tired of X vs. Y debates (read "religious wars"). BUT, this article is hardly that. I find it a compelling case to perhaps even learn Lisp in the not to distant future (but then again, I'm doing a fair amount of Python on the side right now so Mr. Graham probably wouldn't look too far down on me :).

    One of the excellent points made:

    Most Perl hackers would agree that Perl 5 is more powerful than Perl 4. But once you’ve admitted that, you’ve admitted that one high level language can be more powerful than another.

    How true, and a near epiphany for me, a hacker (in the making...:) who started to believe that all languages were pretty much equal. This simple quote reminds me that all languages really aren't created equal, but one's level of programming knowledge is what may help to choose the best tool for their particular task, and also which tools will often fall short for them. It's also logical to conclude that this quote can extend to far more than just programming languages, and far more than just computers for that matter.

    His point about how startups should seek to do something different -- in terms of what tool they'll develop with to give themselves a better chance to succeed -- also raises a valid point too, IMHO.

    And this:

    We knew that everyone else was writing their software in C ++ or Perl. But we also knew that that didn’t mean anything. If you chose technology that way, you’d be running Windows. When you choose technology, you have ignore what other people are doing, and consider only what will work the best.

    is something I've been practicing for a while. And it's the avoidance of choosing a language based solely on its marketing campaign that is one of the signs of someone who has a clue. :)

    I've been shown a reason to change the way I think.

    I'm a different programmer now than I was before I ate my toast this morning.

      Note that the intrinsic powerfulness of a language is only a partial order. However let me reinforce the point by showing you one way in which Python (which you are learning) is more powerful than Perl.

      Write code to sort an array of arrays in the most natural way that makes sense in each language and gives some sensible result. Now modify your code to take into account that the third entry in each array is an array.

      Why was that easier in Python, and why did the Python answer do a better job of anticipating your future needs? What connection does this have with the usual syntax complaints about Perl?

      There are other things that Perl does better than Python. This is not meant to be Python advocacy. But as you learn languages, I think it is a very valuable exercise to try and notice details like that.

Re: Choose the most powerful language
by hding (Chaplain) on May 01, 2001 at 18:00 UTC

    As someone who has been throwing around the same article as Lisp advocacy, I felt compelled to put in my say. :-) I do basically agree with Tilly's points. I guess I feel there are (at least) two distinct kinds of language advocates: those who rabidly and unconditionally push their own favorite language(s), and those (among whom I like to fancy myself) simply want to make sure that someone has a reasonable understanding of a tool before dismissing it for a task. I have to admit that I get very tired of hearing rampant misconceptions about Lisp (or Perl, or Smalltalk, etc.) - it's slow, it's interpreted, it's only good for AI, etc., and I find that it's puzzling that people are willing to propagate such without bothering to check out for themselves whether or not they are true, and Graham's piece is at least a good pointer to get people to reconsider their preconceptions, and perhaps look into things more deeply.

    One of Graham's point that I found particularly interesting is that people are often loathe even to consider the possibility that tools other than the ones they are accustomed to may sometimes be able to bring more power to bear on problems, while at the same time they are willing to look down on tools that are demonstrably less powerful for the same problems. I wonder how it is that we can become so indoctrinated in certain ways of thinking and working (and I do not always exclude myself here) that we miss the opportunity to discover new and better ways to do things? I find that such experimentation is one of the enjoyable things about this field.

Re: Choose the most powerful language
by Mungbeans (Pilgrim) on May 01, 2001 at 18:32 UTC
    Pragmatically, if I was running a software house, I'd choose the language that I could get the most resource for. Resource being documentation, online sources, and most importantly: skilled developers .

    I don't know the stats but I suspect that lisp/functional programmers are hard to find, and, because they are hard to find, lisp is used less frequently. This is a chicken and egg situation - there's a shortage of lisp projects because there is a shortage of lisp coders (and vice versa).

    I don't grok functional programming yet (I'm working on it - thanks tilly for the book suggestion), but I suspect that functional programming will always be conceptually harder (albeit more productive) than procedural. I don't know the answer, but maybe some clever companies (like Paul Graham's example) will lead the way.

    My 2p.

      I think there is a chicken and egg problem, but not where you believe it is.

      If there are fewer Lisp hackers running around, they are generally more competent and there are fewer jobs chasing them. I don't think that a small company would have problems finding competent Lisp hackers if they wanted to do a project in Lisp.

      However there is less done in Lisp, and the functional programming community has always suffered a lot from fragmentation. A reasonable caricature of the situation is that functional programming languages attract people who are looking for the best language. People who are so picky about their language tend to form strong opinions about what is good in a language, and do not in the end agree about what that best language is. So an already reasonably small group of people is then fragmented to the point where you have to expect to "roll your own" on virtually anything you do.

      Sure, rolling your own is much easier with such a great language and such talented developers. But having to do it is a great cost!

      I have some thoughts on when it is worthwhile to go out and roll your own, and when it is not. Some of those thoughts are likely to be rather controversial, but I will try to put them into a meditation in the next day or two. Suffice it to say that I believe that Paul Graham's choice was much better when he made it than it is now.

      Incidentally for another look at why functional languages have not taken off like wildfire, take a look at the famous essay Worse is Better. Please don't take what is said there as gospel, but think about it. Even a decade later, the author doesn't know whether to believe his own argument.

      I read somewhere that most programming is done in (Visual) Basic. So if you are looking to get the most resources (including programmers), your best bet should be Visual Basic! But is Visual Basic the best language for the job you want it to do? Who knows? It will depend on the job at hand, but from a management perspective, you are almost assured that you wil find someone reasonably adept in maintaining your VB code, many years after the original programmers have left your company. Lisp may be far superior (I don't know enough of it to make any statement in this respect) to VB or any other language, but if you have to look far and wide to find a programmer to rescue your program and are not guaranteed to find h[er|im] within a reasonable span of time, you're toast as will be your company.

      The interesting thing which was written in the article tilly referred to, was that Yahoo seems to have switched from Lisp to C++ now ... 'nuf said.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

        There is no question that a mainstream language is a "safe" choice. No problems finding programmers, and lots of other companies you can point at doing the same thing if things go wrong.

        The point of the original article is that there are times when the risk of going with a non-mainstream language is worth it. One of them is the case of a small startup where the founder (or someone close to the founder) is familiar with the language, and the language is very productive.

        But try that in a larger company, and if anything goes wrong you're in trouble when people start questioning whether your odd choice had anything to do with the problem. Whether or not you chose wisely, you'll be a convenient target after the fact. :-(

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-07-24 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls