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

New Year's Resolution: learn another language

by Cody Pendant (Prior)
on Jan 07, 2008 at 01:52 UTC ( #660722=perlquestion: print w/replies, xml ) Need Help??
Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:

It's definitely not that I think I know everything there is to know about Perl, but I'm somewhere in the middle of the bell-curve, and I've decided that my skills in general are somewhat stagnant and I should try to learn a new programming language.

Other than Perl I've worked in PHP, JavaScript and XSL mostly. I came to Perl from web coding, so I know HTML and CSS. I have no CS background whatsoever. And I'm not looking to improve my career prospects.

What I wanted to ask the Monks was, which language will teach me some interesting concepts, something different that I don't know from working with Perl?

Or perhaps I mean, teach me a way of thinking that's different from/complementary to the Perl way?

Should I learn a language which gets me closer to the bone of what the computer's really doing and doesn't make things as easy as Perl? Or a language which is all about object orientation from the outset? What are these "closures" I hear about? Perhaps a language which uses significant whitesp-- no, that's crazy talk.

Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...
  • Comment on New Year's Resolution: learn another language

Replies are listed 'Best First'.
Re: New Year's Resolution: learn another language
by starX (Chaplain) on Jan 07, 2008 at 02:25 UTC
    I've got a special place in my heart for C. It's more challenging than the interpreted languages that we use today because it lets you shoot yourself in the foot. The trade off is that it helps you pay closer attention to what's going on in memory, and should you ever decide you want to develop device drivers, you'll be able to do so. Also, you'll be able to write C that interfaces with perl and vice versa, so you'll be able to expand your perl fu at the same time.

    I'll grant that classic C programming isn't as hot an item in the world of IT as it used to be, but it's kind of like learning Latin; you'll almost never use it directly, although the benefits of learning it will manifest themselves in other ways.

    If you are interested in learning C, there's two really good books that will teach you the basics. Kernighan and Ritchie's The C programming Language, and Pointers on C, by Kenneth Reek.

Re: New Year's Resolution: learn another language
by BrowserUk (Pope) on Jan 07, 2008 at 02:13 UTC
      I don't know that it would be that different. He mentioned knowledge of XSL. If he's done XSLT, then he would have been fighting the language pretty hard not to do so in a somewhat functional style.

        Having been forced to use XSLT for a short period some years ago, my initial reaction to your suggesting that it is an FP language was one of complete and utter disbelief. However, I googled and found several people making a similar suggestion.

        I have to say that I find it almost impossible to relate my experience of programming XSLT as anything like my experience of programming in any of several real FP languages. Indeed, I wouldn't wish XSLT upon anyone, not even my worst enemy. I see it has it's uses for performing a limited set of very specific types of transformations upon large volumes of XML encoded data, but as a general purpose programming language (IMO) it is a disaster.

        The analogy that comes to mind is: Given the increasingly powerful processors available in mobile phones, and combining them with the nearly ubiquitous presence of video-capable digital cameras, it would be possible to program them to allow you to type SMS texts by placing the phone on a work surface and using Semaphore. I have absolutely no doubts it could be done, but would anyone really use it?

        (IMO) XSLT is the absolute antithesis of FP. Just look at all the needlessly repetitive verbosity XSLT entails.

        And whilst it supports (after a fashion) high order functions, imagine trying to do the holy grail of FP: Fixed Point Combinators using XSLT?

        Aristotle demonstrated how to do the Y combinator in Perl a while back. Now compare that to the same thing in Q: _Y = \F.(\X.F '(X X)) (\X.F '(X X));

        If the Perl version is an order of magnitude more complex and verbose than the Q version, I can only imagine that the XSLT would be one order more complex and two orders more verbose than the Perl. That's if it is possible to do it at all. And IMO, that totally negates any claim that XSLT is a FP language.

        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: New Year's Resolution: learn another language
by merlyn (Sage) on Jan 07, 2008 at 04:13 UTC
      I love Seaside, but Smalltalk's syntax makes me nauseous... Do you not have a gag reflex going from Perl to Smalltalk? If so, how do you get over it? If not, why not?
Re: New Year's Resolution: learn another language
by perrin (Chancellor) on Jan 07, 2008 at 04:32 UTC
    If you've never done any Java, you should learn it. It is so ubiquitous now that a lot of the most interesting writing about programming is written using Java, and some of the most interesting tools are written in Java. You may well decide you dislike it, but being able to read and understand it will help you a lot when you go to look at the current programming literature. It may also improve your knowledge of OO modeling, since that subject gets a lot more coverage in Java books than in Perl ones.
      My vote would also go for Java.
      I'm not a programmer by any stretch of the imagination and have only just “dabbled” in C, C++, Visual Basic, Prolog and one or two others.
      Being an activist pragmatist regarding learning style I found Java to be very visual in producing an output, one can actually get something up and running very quickly.
      I also found Prolog gives a different perspective from other languages because of its use of procedural semantics and for anyone interested in Natural Language Processing and specifically using Perl it is well worth looking into before getting to grips with the Perl Prolog modules.
Re: New Year's Resolution: learn another language
by graffitici (Novice) on Jan 07, 2008 at 13:24 UTC

    I'm surprised that out of all the languages that were suggested, Lisp hasn't found its place in the list. Although it may not be used very widely in the industry, it's a very important language historically. It probably was the first functional scripting language, and it first implemented garbage collection and dynamic typing, features found in Perl today. I strongly believe that it still is a very valid tool

    Since you don't have a CS background, I should also point out that Scheme (a dialect of Lisp) is taught to freshmen CS majors for their first programming class by many universities (including MIT). Take a look at TeachScheme. Furthermore, there are many online textbooks available to get you started, and a very good IDE (that works under Linux). Here are some links:

      Agreed, although I see Lisp has gotten a second mention since your post. Lisp was my first thought when I read the question. (Well, the first serious one... "Perl 6" came to mind first, but it was a joke answer.) I took the Scheme class based on Structure and Interpretation of Computer Programs in college and I remember it as having been by far the most fun language I've ever dabbled in, although that may have been mostly the novelty of it being so different from anything I'd done before. Unfortunately, the course didn't go into the language deeply enough to actually do anything useful with it, so I never touched the language again after the course was done. (I should go back and play with it some more... I might even still have the book...)

      As others have said, you can't go wrong with C, but I'm not sure whether it's as different as you might be looking for.

      graffitici , thanks for the info. This looks like great CS material to get some background and hope to improve my perl.
      I am still consider newbie on perl but I will also be trying out SQL to interface w/ Perl as well as XML
Re: New Year's Resolution: learn another language
by kyle (Abbot) on Jan 07, 2008 at 05:02 UTC

    As others have mentioned, functional programming is indeed interesting and worth looking into. That having been said, you don't really have to learn another language to do it. You can write Perl in a functional style. If you want to understand closures, you might as well do it in Perl, a language you already know, as learn a whole other language with its own version of print, etc.

    You might look at Prolog for a programming style you really don't see in Perl (at least not until another monk comes along and points us to a CPAN module that lets you write code that way).

      I would also recommend Prolog. Logic programming takes a very different approach to programming problems, and it's helpful to understand how you solve problems in that kind of a framework even if you don't wind up using it for your day job. Problems which are easy to solve using Prolog are generally difficult (or cumbersome at best) to solve using imperative languages.

      And you can start with AI::Prolog, an Prolog interpreter written in Perl. As for books about Prolog, I'd recommend the classic "Art of Prolog".

Re: New Year's Resolution: learn another language
by Erez (Priest) on Jan 07, 2008 at 09:03 UTC

    Read Higher Order Perl.
    It will give you an understanding of both Perl and programming that in many ways is akin to learning a new language.

    Software speaks in tongues of man; I debug, therefore I code.

Re: New Year's Resolution: learn another language
by aquarium (Curate) on Jan 07, 2008 at 03:27 UTC
    ruby on rails?
    how about a spoken language instead?
    the hardest line to type correctly is: stty erase ^H
Re: New Year's Resolution: learn another language
by gamache (Friar) on Jan 07, 2008 at 15:14 UTC
    Learning Lisp will teach you how to use modern dynamic languages (Perl, Python, JavaScript, Ruby etc.) in much more powerful ways. The two general-purpose Lisps people use today are Scheme and Common Lisp. Scheme is a spectacularly small language, easy to learn and extend. Common Lisp is a monstrosity, similar to how a car might look if executives from General Motors, Ford, Toyota, Peugeot, Yugo and Land Rover designed it together over the course of a decade. For a learning language, Scheme has the edge over CL. In any case, Lisp will stretch your head further than perhaps any other single computer language.

    Learning C will teach you how computers work, how awesome dynamic languages are, and why Lisp compilers are usually written in Lisp. C is the best assembly language ever. It's a total pain in the ass for anything sizable, but once you grok C, you have a good sense about where every bit and byte is going in all languages. C++ adds some higher-level features to C, but still requires a lot of hand-holding to get from point A to point B. If you're not planning to use either language extensively and just want to see where it takes you, I'd recommend C. The language features in C++ which are absent from C (object orientation, template programming, generic functions, overloading, etc) are learned more easily from a language with more forgiving syntax.

    Lisp and C have both aged very well, respectively 50 and 35 years old. I'd say there's more to learn at these opposite ends of the spectrum than in between, if you're a code tourist. Most people who write actual software for actual purposes aim for a language somewhere in the middle.

Re: New Year's Resolution: learn another language
by bradcathey (Prior) on Jan 07, 2008 at 12:42 UTC

    Larry himself had some interesting comments last month. Great reading, per usual: Let's go scripting.

    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re: New Year's Resolution: learn another language
by ctilmes (Vicar) on Jan 07, 2008 at 14:50 UTC
    I could second the above recommendation for 'C'. If you program, you should know C..

    Beyond that, my recommendation is SQL.

    Pick one of the Open Source databases, install it and make a web site using your prior knowledge, then hook up the database to it for some favored pet project.

    In particular, I would recommend PostgreSQL, and learning its stored procedure language PL/pgSQL in addition to straight SQL. (Though it now allows embedded Perl programs!)

Re: New Year's Resolution: learn another language
by explorer (Chaplain) on Jan 07, 2008 at 16:26 UTC
    Perl 6, of course.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://660722]
Approved by kyle
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-05-22 09:08 GMT
Find Nodes?
    Voting Booth?