I've been reading a large number of (mostly troll initiated) threads lately about the choice of Perl above Java or other languages, as well as merlyn's post on perl2exe - no more secrets, and I've got to thinking ...

What made you learn Perl?

I am a programmer "wannabe", I freely admit it. I never meant to become a programmer, of any sort. I just wanted things to WORK, I just found that I had to use the programming tools available in order to get certain jobs done.

In 1989 I taught myself (out of the manuals & by trial & error) QBasic in order to maintain a stock-control / ordering / sales system developed in house by my boss, who didn't have the time to do it himself. My ONLY object was to get the job done & get on with my other work. If I look at that code now, I shudder.

Since then I have learnt smatterings of Pascal, Turbo Pascal, dBase IV, Clipper, Java, HTML, VBA, VBScript ... all for one Purpose - To Get The Job Done.

The only "language" I've ever really attempted to master for its own sake, is T-SQL, in my capacity as a designer of database queries for our reporting tools here at work. And I've got a Looong way to go before I can consider the subject "mastered". Even so, I'm more interested in WHAT I can do with it, as opposed to how the language is supposed to fit together. Yes, you cannot do the one without the other, but I feel it's a matter of perspective.

Then ... the great Adventure ... I decided I needed to standardise on a script language for future projects, so that I could get more expert than just "getting the job done". In other words, I decided to learn a language just to know it. After casting around, looking here & there, & with a bit of inspiration from AcidHawk (the only perlmonk I know personally), I decided on Perl.

My reasons were simple. Perl is Open Source, Perl is Cross-Platform, Perl is (I've been assured) easy to learn, even if difficult to master. Perl projects generally have a shorter cycle time. Issues such as speed-of-execution, etc never even entered my head ...

So ... What's my point?

Well, I've realised that we have three groups here (that I've observed).
There are the pragmatists, who want to know what will WORK.
There are the theorists, who want everything to be done "correctly".
Oh, yes, and there are the trolls ... ;-)

So we seem to have differing opinions about "best practice".
Firstly, because we all differ in our levels of knowledge in the language, and secondly, because we differ in our outlook on the philosophy of coding.
I came to PerlMonks to learn about Perl ... and have ... in heaps. I've also learnt other things. I never knew people could be so passionate about a language! (And, yes, it's catching! :-) I never realised the difference of approach to how people view code.

The question then remains ... What made YOU learn Perl? Was it an accident of work/project. Was it a conscious, planned decision, if so, what influenced it?

Following from that ... When you code, do you attempt to achieve the objective as efficiently as possible (time-wise, etc). Or do you focus on the elegance (or "correctness") of your code. Both is obviously good, but we're not all merlyn or tilly ...

So Long

Replies are listed 'Best First'.
Re: Why I learn a language.
by Abigail-II (Bishop) on Feb 24, 2003 at 09:44 UTC
    I started with Perl in Januari 1995. I had just finished a project that consisted of creating a website for a division of one of the largest multinationals of the world. All we had was a CD-ROM with images, and a (corrupt) ASCII dump of a database, and 160 hours. I did the job with a bunch of shell and awk programs. It took three hours to run, creating about 500 HTML pages, and about 1000 images.

    Even during the project, I thought there should be a more convenient way. So, sometime after the project was completed, I started to learn Perl. I started with perl4, but within the hour I wanted to do multidimensional arrays. Not knowing how to do it, I looked for a Usenet group. Found comp.lang.perl, waited a few hours before my upstream UUCP nodes were configured to pass me the group. Soon after I started reading the group, I became aware perl4 was history. I got myself perl5.000h, read all the manuals back-to-back, and the rest is history.


Re: Why I learn a language.
by Zaxo (Archbishop) on Feb 24, 2003 at 09:20 UTC

    My original reason for learning Perl was, I think, typical. I'd landed a job doing CGI, and I imitated people who had done that sort of thing before by deciding on Perl for the task. Knowing C/C++ already, the syntax was not too difficult to learn, and my errors led to deeper study. I became fascinated with TIMTOWTDI and dwimmerie, and learned to appreciate the linguistic elegance of well-written Perl. CPAN gave me the leverage to exercise high laziness. Perl has become my primary language for most purposes.

    The richness and depth of fluent perl is a great pleasure, and something I very much want to attain. Perlmonks has helped me a lot towards that goal.

    Correctness is the paramount goal when I write code. I try to check for errors from system calls and respond appropriately. I try to keep my eyes open for corner cases and other error-prone constructs. I find that writing test code is the most useful strategy for getting a job done correctly.

    I do think about code efficiency, but I try to avoid early micro-optimization. I try to write code that gets the job done minimally, doing no more work than necessary. I find that a few minutes thought, followed by writing minimally on the first cut, is sufficient and not too expensive in my time. Further attention to speed and memory requirements is postponed until testing shows where improvement is needed.

    After Compline,

Re: Why I learn a language.
by adrianh (Chancellor) on Feb 24, 2003 at 10:23 UTC
    What made YOU learn Perl? Was it an accident of work/project. Was it a conscious, planned decision, if so, what influenced it?

    I originally learned perl back in 1996. I was writing an e-commerce system (not W3 based) and needed to create a mock server to test the client with (client was C code). From a look at the FAQs and the old pink camel book it looked like I could prototype something quicker in perl than I could in C - so I learnt it :-)

    In the end the server got implemented completely in perl. Stayed perl for several years until it got a rewrite into C (or C++, can't remember) - mainly because the dev team at the time were all C/C++ coders.

    When you code, do you attempt to achieve the objective as efficiently as possible (time-wise, etc). Or do you focus on the elegance (or "correctness") of your code.

    I'm one of those annoying people who think it's a false dichotomy. I aim to write good code in a timely manner. If I can't I'm doing something wrong ;-)

Re: Why I learn a language.
by xmath (Hermit) on Feb 24, 2003 at 14:39 UTC
    First of all, I program for fun! This obviously yields a very different story than when you have to "get the job done".

    The objectives I have when I write vary a lot, but usually include one or more of:

    • Use of some specific language features I want to explore
    • Some abstract "beauty" criteria (which may have nothing to do whatsoever with readability)
    • Occasionally complexity or obfuscation
    • Shortness (especially when golfing, but in regular code I'm also opposed to verbosity)
    • Elegance of the external interface
    • Speed optimization (when I'm in the mood; rather than when it's useful to do so)

    About two months ago I decided that perl was a useful thing to know. I already knew heaps of different languages before i learnt perl (REALbasic, C, C++, Objective C, FORTH, PPC assembly, PostScript, HyperCard, Frontier, AppleScript, INTERCAL, Unlambda, and bits and pieces of other languages like Java, Scheme and Prolog) so I was able to learn perl quickly from the manpages (including perldelta to check on the latest features ofcourse :-)

    While learning perl I got involved in some perl-golf sessions on irc. Soon after that I started doing real stuff (co-authored Attribute::Property, joined perlmonks, wrote Data::XDumper, and wrote this reply to your meditation.

Re: Why I learn a language.
by powerhouse (Friar) on Feb 24, 2003 at 10:18 UTC
    Well, I'm no Perl hacker, but I can write pretty good sites in perl.
    I first started when a customer of mine was wanting to do some pretty unique things on his website. I knew it was possible but did not know HOW to do it.

    I went on a search and found several great sites that had tutorials. I did all of them I could find. Plus I'd download every script I could find and tear them down, and see what the code did, and how it was written. I've since then figured out what was not so good, and tried to keep the best practice(In my mind).

    I loved what I had learned. I built his scripts with ease, using what I had learned. Since then my knowledge has flourished compared to then, and I now build complete sites, that have the ability for our clients to login and be able to make any changes to their site using a "control panel" that I build in Perl and MySQL.

    I LOVE doing it. I really enjoy building websites for people that make their life easier.

    I still have much more to learn. I've been so busy with building these sites that I have not had time to learn the advanced features that Perl has to offer, but when I can, I learn more and more.

    Right now I'm building a website that has a complete Affiliate Manager, where the owner can upload new banners, update prices, PAY his affiliates, and basically do everything that a 65,000 per year Affiliate Manager does ;o)! The users can see all the banners, click the "get link code" LINK and it will build them their code which even has tracking built into it.

    All this is done with, Perl(MySQL too). I don't think there is another language out there that I would prefer to do it with.

    When I am writing code, I try to make NO mistakes. Often I can write 400 lines of code, upload it and test it, and there might be just a few uninitialized values, but no major errors. I love it when I do that. Other times when I'm really tired I make a lot more mistakes. But I don't ever do it for speed, unless I'm charging by the hour. I want to make sure everything I do cannot be exploited. That is my main goal. Plus it has to be readable, so I use Tabs a LOT, I start every if statement on the same line and end it on the same line, if I start another inside of one, there is one extra tab and so forth.

    That is how I do it.

Re: Why I learn a language.
by Heidegger (Hermit) on Feb 24, 2003 at 09:43 UTC
    During the last couple of weeks there have been a lot of discussions on the value of programming languages. When do I learn a new languages? First, it was university that gave language courses. Second, it is the job - you cannot get away from the politics of your office. During the last 7 years I've learned Perl/Java/C++/Delphi. I will hardly learn another programming language. It might be C# if we have to do something with it ar work. I find myself captured by the market flow, there is not much you can do alone in IT business anymore - romantic PC times passed away. As of Perl, it serves my romantic IT side. I have this feeling about this programming language that it brings some freshness into my mind-numbing 9-5 work routine.

      While at your workplace you may not have a choice in the matter, the great thing about the growing poliferation of web-based apps is it doesn't technically matter what language the application is coded in. Given a common set of HTML templates, an app written with Java Servlets could look exactly like, and even interoperate with, a Perl CGI. (Now now, don't attack the choices. It was just an example.)

      I guess what I'm trying to say is the idea of being able to code professionally in the language of your choice is not exactly "romantic"... it's very plausible.

Re: Why I learn a language.
by sfink (Deacon) on Feb 26, 2003 at 04:02 UTC
    When I was growing up my parents used to spell things out when they didn't want me to understand them, like "better put the c-a-n-d-y away before he sees it" or "you got to shave the k-a-n-g-a-r-o-o last time, it's my turn!". When I got older and learned how to read, they had to try harder to keep things away from me, so they spoke in Perl. I obviously was highly motivated to figure out what they were keeping away from me, so I started to pick up the odd phrase here and there.

    Then after things pretty much fell apart and my lawsuit against them was still in appeals, I had even stronger motivation to learn. They still had control over me for a while longer, so they hired (or purchased? I was never sure) a model TXE330 Doberman-class Personal Security Agent to "keep me out of trouble". In practice, that meant two straight months of huddling terrified in a corner of my cell. The judge sure would have taken a very dim view of this, had he survived!

    Anyway, it turns out that sadistic old Doby was programmed in Perl, and I learned a lot by reverse-engineering the code that was briefly visible whenever he bent over to take a leak. I eventually found a bug in his control program (it should have been /\bbreathing\b/, not /breathing/) and managed to write out a simple exploit on his battery refill one morning. He had only chewed off one of my arms at this point, so it was relatively easy.

    I still have flashbacks whenever I use Perl, but I've found it to be enormously valuable ever since my early years. Personally, I think everyone should learn Perl, if only for self-defense.

Re: Why I learn a language.
by castaway (Parson) on Feb 24, 2003 at 12:43 UTC
    I honestly can't remember. I've learned (or semi-learned) a lot of languages just for the fun of learning them. I started when 5.6.0 was out, and 5.6.1 nearly there, I think, so I guess that was about 2000 (correct me someone if I'm wrong).
    My first (and only) Perl book was the Camel (3rd ed.) from which I proceeded to read as much as I needed to get started. I write mostly perl programs for myself (that have nothing whatsoever to do with CGI or the Web, tho usually something to do with internet).

    I went from VB (gave up that when a reinstall of VB deleted my projects I was working on..), to Java (which I still like, but is a bit unwieldy for short-and-simple stuff) to Perl, where I'm still at. It was a conscious decision, I just can't remember who suggested it, or why.
    I'm using it at work now too, so I guess it's helped make me valuable there.. ;)

    Do I attempt to..?
    Since it's mostly in my own time, and written for my own use, I try to make it work in the first instance, and worry about efficience later (if at all neccessary). I'm not interested in elegance or correctness at all (if it works, its correct :) - Though I do indent and consistently bracket etc, I've no idea how anyone can code (and read it later) without doing that :)


Re: Why I learn a language.
by Mr_Person (Hermit) on Feb 24, 2003 at 14:34 UTC

    My freshman year in high school, I convinced one of the teachers to let me take a self taught C course using a book I found at the library. After I went through the book, doing all the programming excercises at the end of each chapter, I had a month or two left before the semester was over, so I decided to check out this "Perl" language I'd heard was popular for web based stuff.

    Got through the part of the Llama book during the class and finished the rest at home, but figured that it wasn't going to be that useful and that I'd have to continue learning C/C++ at some point.

    Then, due to several work related projects, I started using Perl quite a bit and as a result learned a lot about the language. Later I read through the Camel book and began to love TMTOWTDI and DWIM (and yes, began to use strict and warnings).

    I haven't been back to C since, because every time I think that I'll need to learn it, I'm able to do everything in Perl (and probably faster because of CPAN). I do still plan to learn C++ (hopefully this summer so I can place out of CS1 in college), but Perl has worked great for every project I've needed to do.

Re: Why I learn a language.
by l2kashe (Deacon) on Feb 24, 2003 at 13:41 UTC
    Why/how I learned Perl

    I managed to land a job doing phone based tech support at a (in hind site) really really great small ISP. 3 months later I managed to get myself moved into the engineering dept. I had only been dealing with computers for about 6-7 months at this point, but the whole duck to water thing applies

    My first task as an 'enginneer', aside from getting a functional SPARC/Solaris workstation was to build a quasi-dynamic anonymous access FTP server for our customers. I managed to figure out shell scripting with help from some great mentors, and called it done. Then something else needed automating so again, back to the shell. Another admin gave me grief saying Perl was better/faster/more robust than shell scripting, but I wanted to devel for the lowest common denominator.

    So it was our personal battle. He would bang something in Perl, I would do the same in shell. He would always finish first, and his code would always finish first as well. (in hind site again, I think it was mainly due to his experience over mine, but thats a moot point). I decided programming was fun and hunkered down with C. I probably played with C for a few months, got the basics of arrays and lower structures, but was having issues moving beyond, so I decided to give Perl a shot.

    Much to my surprise I loved Perl. In my mind it was a "lazy" implementation of C. None of those stringent syntax requirements, DWIM not DWIS, etc... I fell in love with Perl. Since then I've moved beyond the "Perl is lazy man's C", but its still the first language I reach for on any project.

    /* And the Creator, against his better judgement, wrote man.c */
Re: Why I learn a language.
by FoxtrotUniform (Prior) on Feb 24, 2003 at 16:17 UTC
      What made YOU learn Perl?

    Well, about halfway through my second year at uni, one of my profs mentioned that the software engineering assignment (a CGI backend) we'd just solved in no fewer than six hundred lines of C could be done in twenty lines of Perl, and that Perl was an excellent language for text processing. That little grain of opinion stayed in the back of my mind for a year and a half, when I had to magic up some content for a machine learning project. Two hours and a hundred lines or so of baby Perl later, three formats became one, and gnuplot was making lots of pretty graphs for my paper.

    If that was all Perl was good for, I'd probably be hanging out at right now. But over the last couple of years I've discovered the wonderful, "theoretical" side of Perl that really appeals to me as a computing scientist, not just as a programmer: starting with stuff like map and closures, moving through regex extensions that turn a text-matching tool into a general backtracking system, and going on to stuff like continuations, currying, and the like.

      When you code, do you attempt to achieve the objective as efficiently as possible (time-wise, etc). Or do you focus on the elegance (or "correctness") of your code.

    It Depends(tm).

    If I'm writing up a stats lab, which I mostly just want to get over with, I'll "optimise for programmer efficiency" -- the TA isn't even going to read my code, and I'll never have to touch it again, so I'm not going to be too concerned about keeping a clean namespace and making proper use of continuations. (Some habits are ingrained, though, and I find that even my hackish, off-the-cuff code tends to be fairly well decoupled.)

    If I'm writing code to explore a problem rather than Get Something Done Right Away So I Can Go Play Guitar, I'll spend much more time on it.

    F o x t r o t U n i f o r m
    Found a typo in this node? /msg me
    The hell with paco, vote for Erudil!

Re: Why I learn a language.
by steves (Curate) on Feb 24, 2003 at 18:31 UTC

    Perl came to me a bit accidentally. I started off as a C programmer, ending up doing about 10 years of C and 4 of C++ before really digging into Perl. Along the way -- around the time I was about 6 years into C -- a coworker started going on about Perl. This was around the time of Perl 4. I took a look but wasn't really interested. Most of the work I did required C; for everything else I had a pretty good base of shell/sed/awk type scripts that did just fine. I didn't see much point in learning Perl at that point. Over the next 6-7 years I debugged some Perl but never really dug in. I was then hired into a job where I was presumably going to do a lot of Java. That was another language I had only played with really, but my C++ background gave me a foot in the door. The Java based web back-end code I was supposed to start on didn't exist yet though. In the meantime, my boss started throwing data munging tasks at me. Some of these were already started in Perl so I bit the bullet and finally learned it. After a few months of "just scripting" I started to build packages, dug into the OO side and never looked back. I've remained in the data munging/mapping area and Perl fits here really well. I also end up writing lots of "glue" pieces to hold the rest of the system together. The bulk of the system is Java but we coexist pretty peacefully -- I think each side sees the the other's strengths and weaknesses.

    Interesting observation here: Back around my first look during the Perl 4 era, a few coworkers and I saw things we thought were inconsistent and sometimes just obscure. It wasn't until I read The Camel a few times (never as a straight read, but just hitting sections as needed) that I was enlightened. I think to really understand some of the things that confuse a lot of people, you have to understand some of the language internals. On the surface it's a lot like C or shell, but under the covers you find some Lisp-ish type features most people aren't usually exposed to in their day to day coding lives. There is, IMO, a tendency today towards languages of one ilk -- the C/C++/Java path, for example. Perl diverges in some key areas. That gives it power but (again IMO) it also makes it hard for a lot of people to get their arms around.

    If you've never read this Paul Graham piece about Lisp I think it has some quite good points regarding choice of programming language.

Re: Why I learn a language.
by hsmyers (Canon) on Feb 24, 2003 at 19:03 UTC
    Since at the time I was quite happy with Python, I'd have to say that I learned Perl more or less at gun point. I'd looked at the books on the subject and more or less decided that Perl uses too many characters for my taste---sort of an ASCII APL was my impression. Got a phone call that pretty much said work was available (in Perl), which at least got me started. I was hooked even before I finished the site in question. If Python can be thought of as a pair of Italian hand made shoes, then Perl is a pair of well-broken in penny loafers. And frankly I much prefer the second to the first. They are both great languages, I just find Perl to be far more comfortable and a better fit for the way I think.


    "Never try to teach a pig to wastes your time and it annoys the pig."

      Warning: the following text may contain some ill-contrived generalities. You have been warned. :)

      Interesting that you went from Python to Perl. Most of the 'switcher' stories I hear are the other way around. In fact, I hear Python users talking about their previous life as a Perl coder so often, it makes me wonder if I shouldn't launch an in-depth attempt to learn the language. (Then I realize all their criticisms of Perl seem to be based on an extremely superficial knowledge of the langauge, and decide not to persue it further.)

        I dunno about you but I've been meaning to check out Python for its continuation support and to see whether its closure serialization works better than perls (which plain doesn't).

        Seeking Green geeks in Minnesota

      Another comparison I sometimes use is 'C' to 'C++' if you like 'C' more, than you will probably be happier with Perl than with Python. But then what do I know---after all I have admitted to liking assembler!


      "Never try to teach a pig to wastes your time and it annoys the pig."
Re: Why I learn a language.
by diotalevi (Canon) on Feb 24, 2003 at 17:38 UTC

    I learned perl so I could help the Green Party of Minnesota with its electoral goals. This first started as a basic CGI web application for use in a city council campaign and is now expanding into something that will be used by the entire state and later other state parties. (heh, maybe even the nation and world >:-)

    I see this as my contribution to the world via electoral activism.

    You can see my first attempts at perl here (v0.03). A few months later and some time to learn, here (v0.40a), something much more advanced here (halted dev). The current development version isn't available anywhere but uses Alzabo+CGI::Application+HTML::Template+CGI (for form widget building).

    Seeking Green geeks in Minnesota

Re: Why I learn a language.
by zakzebrowski (Curate) on Feb 24, 2003 at 11:55 UTC
    I learned perl because of school. I fell in love with perl because of work when I needed to code something up quickly... :)

    Pluralitas non est ponenda sine neccesitate - mysql's philosphy
Re: Why I learn a language.
by theorbtwo (Prior) on Feb 24, 2003 at 22:04 UTC

    I learnt perl because I had to get somthing done, and I thought the best way to do it was with perl, if I have to answer in one sentance.

    If I don't, I'd like to tell a bit of a story. During high school, I started a compony with my best friend. We were going to do web hosting. The time came to write the scripts to do little small-account hosting as part of our web site -- that is, We wanted to have easy-to-use web-based forms for the users to work with. I told him that I wasn't good enough a programmer to do it, and he got somebody else. Months later, they had a falling-out over who owned the code. I was called in to maintain it. It was written in perl. I learned the perl I needed to change the things that needed changed. A few months later, we expanded into computer sales, and needed an online store. I looked around, and the best thing to do it with seemed to be written in perl. A few months later, I had it set up how we liked it. But we needed, over time, for it to do more and more, so I learned more and more perl. We needed to do more and more with the hosting scripts, as user requests came in for more features. Eventualy, I found out that the scripts the other guy had written were absolute crap (and I don't use the term lightly). They were full of security bugs -- there was no checking of pathnames, for example. While there was code to verify if the password was correct, and it was called, the results were ignored. We had fun messing with the site of the guy who had written the code orignialy...

    Anyway, now that I think back on it, though I've tried half-heartedly, I havn't learned another language since then, really. When I come across problems, I can almost always better solve them by learning more perl then by learning another language. (I've learned some Pascal, but I've never used it except when forced by the fact that the course I was taking was Pascal-based. I've learned a little Java for the same reason -- though that was really more a recollection of Java I'd learned before.)

    Nowadays, whenever possible, I don't even use other languages when most people would think I'd have to -- I write Excel spreadsheet macros in Perl, by writing only the VB neccesary to call out to a worker function in perl.

    (I really should learn at least C and Java better... but I'm not very good at motivating myself to do so.)

    BTW, as to wanting my code to just work or to be good code, it really depends a lot on who I'm coding for, what the situation is like (if there's time pressure), and what my mood is.

    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re: Why I learn a language.
by thelenm (Vicar) on Feb 24, 2003 at 17:43 UTC
    I made a conscious decision to start using Perl when I started working on my M.S. thesis in natural language processing. All I knew at the time was that "Perl is good for processing text" and "Everyone in college said it was really cool". Somehow I had never taken the time to look into Perl, but I wanted to force myself to overcome my natural laziness. So I sat down, bought the Llama and Camel Books, and after a long period of frustration trying to figure out when to use @ and when to use $, I attained enlightenment. I've been hooked ever since.

    -- Mike


Re: Why I learn a language.
by webfiend (Vicar) on Feb 24, 2003 at 19:12 UTC

    Why do I learn a language now? Because I can, and it's become fun, like learning a new musical instrument or human language. You discover new ways of doing the same old thing.

    Perl started me on that kick, but I didn't learn Perl for that reason. I was working on a Web project, trying to select the best tool for the job. I went quite a long ways with PHP, but started bumping my head into barriers of the language before I felt like I had finished saying what I had to say. You couldn't do this, you could do that only if you followed this torturous syntax. Bleagh. So I started learning Perl because it was in wider use at the time and seemed capable of allowing me to say what I needed to.

    Did that make any sense? Basically, I learned Perl because it got the job done with the least headache.

    Oh, and a little disclaimer: PHP is a dandy language, and has grown a lot since the murky days of early 1998. Don't let my faded memories steer you away from it :-)

    I just realized that I was using the same sig for nearly three years.

Re: Why I learn a language.
by extremely (Priest) on Feb 25, 2003 at 07:21 UTC
    I learned Perl because one of the programmers at our new ISP (back in 1996) told me I might like it better than shell scripts. He said, "I think it will fit the way you think."

    A year later, he was calling me for advice when he was tinkering in Perl. By that time I'd already been dispensing advice (not always good advice...) for months. My first post to CLPM on google helps date me.

    I would have remained a hobbyist if not for the fact that that progammer left the company right about the same time I felt the need to have a major project done for my department (I was Tech Support Manager.) I turned in my massive project document only be told there wasn't any web programmer anymore. So I sucked it down and accepted their offer to give up management to code.

    As to the second question, I waffle from elegance to efficiency. Things that just need to get done, I do in a scrappy manner. Things that are going to get used over and over buy more attention up front. I try to be meta-efficient by not overworking unimportant code.

    The key lesson I've learned is to never give a single thought to how fast something will be. Figure out if it will work at all, first. The time I've seen wasted on over-optimizing code for speed (code that adds barely 1% to the run time in hindsight, at its worst) would amount to more man-hours than I've spent actually programming.

    I, personally, have wasted too much time on more than one project in pursuit of beauty. Over optimizing for purity is as bad as pre-optimizing for speed.

    $you = new YOU;
    honk() if $you->love(perl)

      I, personally, have wasted too much time on more than one project in pursuit of beauty. Over optimizing for purity is as bad as pre-optimizing for speed.

      OMG. I just realized that I sometimes do the same thing.

      Anyway... I choose perl because it is mature, has lots of modules to do what I need (Thanks to CPAN) and is just simply easy to use. When I started, PHP and Python both were missing important features. (Python was missing something like pop - it had push but not pop, or something like that. I'm sure that's fixed by now)

      On the other side of the spectrum, C and C++ just requires way too much work to get simple things done. And I haven't had to program anything that truly required the speed benefit of C.

      It basically comes down to using the right tool for the job... and for my job as an ISP sysadmin, perl is almost always the right tool.

Re: Why I learn a language.
by CharlesClarkson (Curate) on Feb 25, 2003 at 17:49 UTC
    What made you learn Perl?

    Matt Wright made me learn perl.

    I am a real estate investor and I frequented a forum for local investors in Dallas. The dates had been stuck in the year 2000 for more than a year. I wrote the webmaster that I could probably fix it and received no reply.

    About the time I sent the email, I found a perl beginner's email group on Yahoo!. I knew from personal experience that the best way to learn was to teach. So I started answering questions beginners asked. In a few months I had learned perl enough to know I could fix the date problem on my favorite RE website.

    Sometime later I was attending a meeting sponsored by AIREO (the website owners) and I met the webmaster. He sent me a copy of the Matt script they were using and I fixed the problem in a few minutes.

    Like xmath I am a hobbyist programmer. I've never been paid for a programming assignment. Perl wasn't my first programming language (Radio Shack's Color Computer BASIC was), but it is by for the most useful one I use.

    Charles K. Clarkson
    Head Bottle Washer,
    Clarkson Energy Homes, Inc.
    254 968-8328
Re: Why I learn a language.
by feanor_269 (Beadle) on Feb 24, 2003 at 17:16 UTC
    Why did I learn perl? This was back when I was still into mIRC scripting, but had just gotten into FreeBSD... these don't mix well, so I learned perl to do X-Chat scripting. Not the best reason, but glad I did it.

Re: Why I learn a language.
by Steve_p (Priest) on Feb 24, 2003 at 22:11 UTC

    I used Perl occasionally starting in 1998 for various database scripts that I inherited at a client site. Since I was working on a Pro*C project at the time, I was not able to get into it too much. Finally, about two years ago, I needed to dig through data in an 700+Mb report, and compare the data with entries on Oracle. This was when it all started. I still do a lot of database scripting with Oracle, and have automated much of my support work to the point that what took hours, I now have a report ready for my in my mailbox when I come to work in the morning.

    Regarding the bigger question, I have three big reasons why I learn a language.

    1. I like getting paid. Being a consultant, there are several languages I prefer to work with, but I prefer to eat, keep a roof over my head, etc. over sticking to one language. I know there are people making (good) money working with only one language, but I'd rather not take that risk.
    2. I always learn something new when working with a language that I can transfer back to the other languages I use. I have begun to agree with the fact that it takes at least ten years to really learn a skill. This past summer, I was learning Scheme, when the light turned on regarding something I was working on in Java that allowed me to simplify a design significantly and improve performance in the end. Now, working with C# has given me examples of where it is good to use function references in Perl and Python.
    3. I always find the limitations of a language while learning other ones. My recent work in C# has shown me several of the deficiencies in Java. My reference above to function references above was on limitation I found. But, C# is missing anonymous subclasses. Neither C# or Java have anonymous functions, but I can work with anonymous functions in Perl, Python, Scheme, etc. But overall, they all have their beautiful features and warts. After working with several languages, I can do a much better job now with suggesting the correct language for a job than I could five years ago.
Re: Why I learn a language.
by riffraff (Pilgrim) on Feb 24, 2003 at 19:51 UTC
    I first learned perl in 95, say about May or June. We used this office suite for unix called Uniplex (on some sequent machines). This suite handled mail with multiple mailboxes, and even the ability to retrieve mail that hasn't been read yet. People would archive mail or whatever, and after a while there were thousands of messages, and we would run out of disk space, so we would tell the users to clean up their mailboxes. However, there was no bulk way to delete mail. You had to delete each message one by one. So, I learned perl 5.00 something or other so I could write a program to manage the mail, deleting by name, subject, date, whatever.

    Interesting aside, at the time the perl version would not compile for dynix/ptx 4.0.1, which was the version we were using. A couple of things were just a little bit different, a little nonstandard, and there was an extra underscore at the beginning of a macro for file access or something, that the Configure program didn't detect yet. I submitted a patch, but I got a return mail saying it was fixed in the next version that hadn't been released yet. Oh.


      Which really didn't answer the question at all...

      I rarely learn a language because I have to anymore. I now pretty much learn a language just because I want to, because it seems interesting. I'm currently checking out smalltalk (well, squeak) and lisp, sort of.

Re: Why I learn a language.
by pg (Canon) on Feb 24, 2003 at 20:30 UTC
    I donít learn a language because it is Perl, or because it is Java. I learn languages mainly because I want to have more choices. I always look at multiple candidates, and thus get a better chance to pick the right thing for the right project, (or a piece of a project).

    There is no such thing as the best language, but there might be a best choice for a particular project.

Re: Why I learn a language.
by revdiablo (Prior) on Feb 25, 2003 at 09:56 UTC

    I learned Perl about 4 years ago. For some reason I got it in my head that since I was finally getting used to "that Linux thing," I needed to learn a scripting language. My first really useful Perl scripts did fancy renaming of large amounts of files. In fact, I still use [heavily] modified versions of those scripts today. :)

    I guess it's somewhat atypical that I never really got heavily into Perl for CGI, but I already knew and was happy using PHP for that... and even today I still avoid Perl CGI as much as possible. I just like to use it for general purpose programming.

Re: Why I learn a language.
by talexb (Chancellor) on Feb 28, 2003 at 22:32 UTC

    I think my first meeting with Perl was a glancing shot in some high tech magazine -- some guy had an encryption algorithm tatooed on his arm. The algorithim was expressed in Perl. The question below the photo was, could he leave the United States, because that could be construed as exporting munitions?

    Well, that was a long walk (as Johnny Carson would say), but that meant I had pigeon-holed Perl as a language like APL -- very complex, and only brilliant people attempt it.

    After I'd been into Perl for a few years I found the comp.lang.perl.misc newsgroup -- that cured me of the 'only brilliant people' part. And, yes, it is complex, much more complex than the components of C (from where I got to Perl) but that's OK.

    So why use Perl?

    • It lets me get the job done.
    • It allows me lots of different ways to say something.
    • It allows me to be modular.
    • I can format it like C, a language I used for most of my careere, and that's nice.
    • It allows me to be Object Oriented.
    • It runs on many different platforms.
    • The user community is terrific.
    Great question.

    --t. alex
    Life is short: get busy!
Re: Why I learn a language.
by systems (Pilgrim) on Feb 26, 2003 at 00:05 UTC

    I agree with your implied suggestion that the reason(s) behind

    learning a language, changes the way you learn it.

    I tried to describe the different reason that would make someone want to learn a language.

    case (1): The I-have-to

    If for some reason you head to learn a computer language to do a job or task, that I guess would probably try to learn as little as possible to get the job done.

    This thought made me wonder! in that case would not a simple language which rely more on libraries rather then special construct be better.

    I am not sure, some people look for the keyword others look for the function, many beginners make the mistake of calling a function "command"!

    Myself I prefer less keyword and special construct, but I don't fit in that case I just described!

    so conclusion 1: less or more special construct?


    The next cases are people who decided by their own will to learn programming, but have different approaches and reasons


    First, I would like to mention brain hemispheres, a brain is divided into two hemispheres, left and right!

    We have 3 extremes here:

    1. someone who is 100% left hemisphere dominant

    2. someone who is 100% right hemisphere dominant

    3. someone who is perfectly balanced!

    Most people are somewhere in between, a little bit to the left or a little bit to the right.

    I read about that issues of brain hemispheres, where would believe in it or not, it's irrelevant, this theory in my opinion successfully identified two thinking models that usually goes together the purely leftist and the purely rightist, and it suggest that most people mostly belongs to either of those models, this theory can -and I honestly believe- help you understand yourself.


    case(2): The coders

    A good example Linus Trovalds


    Those are a put-up or shut-up, the real deal, the designers,

    they write more code then anyone else.

    they tend to learn from doing and from experience rather then from reading and learning, they do read don't get me wrong, they do read more then the average guy. But not as much as the guys I am gonna mention in case (3).


    they usually know a fewer number of programming languages, but are able to do more with it, they are not the language zealots,  it's the opposite, they just don't care to learn a new language, remember they are the do-errrrs, the coders, they care more for the program quality, then code quality.

    If it works, it is good!


    they won't listen, probably don't accept criticism gracefully, "they did the job who are you to complain", they respect fellow coders and have bad peoples towards the people from case (3).

    case(3): The hackers

    A good example ESR <I personally don't like the guy but he unfortunately fits the theme well!>

    those are people who think about thinking, read about reading, they have a genuine interest in learning how things works, a hacker would make a good analyst as opposed to a designer, they read the most and know the best but most probably they code the least, it doesn't seems there is enough time to do both, as much as they love code, writing code isn't always as much fun, not to them!

    how can I write code when by the time I finished learning this language or framework, I found another more tempting to get hacked!

    they probably know a dozen of programming language and fairly good at one or two, the one or two they love the most, yup, those are your zealots,

    they don't get the respect they deserve, mainly because they seem to lazy, WHERE IS THE CODE!

    they read so many, but didn't make any!


    I failed to determine to which brain hemisphere hacker or coders belong, they both seem to be somewhere in between!

    coders write code to make programs.(simple)

    hackers build programs to see the code.(wicked)

    coders are more interest in building programs.

    hackers are more interest in learning how programs are build.

    but if you can build programs, your certainly know enough about how they can be built.

    and if you know how to build programs, you can certainly make one.

    so what's the point? am not really tryin to make a point, I am just being vocal about what I see!

    Most people are shades of gray they are neither pure hackers or pure coders, they are somewhere in between, the programmer hemispheres!

    So to answer the question: why does one learn a languages?

    well, some people got things to do, arenas to conquer..

    others just do it for their personal pleasure!

    why perl?

    a hacker would say: why not!, even it turns out to be not of my taste, it can be fun to learn and I can learn from it, what not to do in a language.

    a coder would say: well, I don't recall exactly why I picked up perl, but it seems to do what I need and I know it best!

    what is a good language to learn?

    a hacker would say: anything new!

    a coder would say: whatever gets it done! 

    who is the better guy?

    the coder of course.

    well, at least most of the time, try to calculate 64367436278 * 452354 in your head without using a pencil and a paper.

    I would not even bother to try.

    Programming is for a larger part, a mental skill improved with lots of training!

    more code writing == more brain training

    yes coders develop a better brain that can handle better the complex details.

    Again I am not really tryin to make a point or prove a theory, just flushing my thoughts, so excuse me for any contradictions I might have expressed!

    Maybe now that I wrote em down, I can see it better!

Re: Why I learn a language.
by zeno (Friar) on Feb 24, 2003 at 22:11 UTC

    I started learning Perl when I got a job as the head Perl programmer at a startup company! It was the primary tool for developing in the eCommerce package we decided on (InterShop), and we just tore in and thought we'd learn it together. I had programmed in C before and thought that it had some similarities-- but it was the differences that blew me away. I have to say that some of it is pretty unique. I think the real surprise for me was the ability to switch the order of things around:

    #check for money in the account reject_credit_card() if theres_no_money(account);

    As far as elegance, I try to achieve it, but generally I try to get the thing to work first, then work on elegance. Being able to use other people's work from CPAN modules makes this a lot simpler.

    Zeno - Barcelona Perl Mongers
Re: Why I learn a language.
by MadraghRua (Vicar) on Feb 26, 2003 at 21:42 UTC
    I got started through the chromosome 21 sequencing project...

    So my academic background initially involved using vax and unix command line tools to analyse sequence data during my PhD and initial postdoc projects. This was back in the mid 80s up to about 95. In 95 my boss was asked to be part of the Chromosoem 21 sequencing project and he asked me to set something up to allow folk to get at the released sequences, annotate them, etc. We had this mathematician fellow that was our systems admin then and he put me on to the first Schwarz book to learn Perl - I still have the Pink O'Reilly Perl4 book somewhere... From that I learned how to write an annotation engine, write stuff to a bunch of tab seperated files as a database, cgi scripting, unix admin and the whole shebang.

    I've learned a few other languages since then - C because a lot of science apps are written in them and I needed to know how the algorithms worked and why it wouldn't compile on my computer.

    Java - it seemed like a good idea at the time. I was looking for an excuse not to use Tk as a graphics rendering package, thinking Java swing would be nicer. But comunicating Perl and Java was a major pain.

    Visual Basic - work made me do it. Actully it might yet be useful if I can ever get my head aroung the syntax and memorizing the whole Windows COM+ business. Game programming books are more useful to me here than the MS books - they actually do something with worked examples - the MS books are crammed with stuff that shows off a feature but has little reason attached to it, IMO.

    C++ - simple curiosity. Its good when I really need that amount of control but usually I don't need it. Its useful for looking at how people implement neural nets or genetic algorithm libraries - not something I'd think to do in Perl.

    Python - one of my employees came with this and raved about it - apart from BioPython's Martel package, I really can't get into this with any enthusiasm. I just find Python advocates to be OO nazis - they seem unable to accept that OO is not always the way to go. I'm not dogmatic and will use whatever works.

    Concerning coding, I and my group are involved in scientific computing, so efficiency and correctness of implementation of the algorithm, data models and their representation are paramount. Perl really does all this very conveniently. Yes we could have a faster app if it were compiled rather than interpreted but usually its not that big a pain, IME

    yet another biologist hacking perl....

Re: Why I learn a language.
by logan (Curate) on Feb 26, 2003 at 01:43 UTC
    I learned perl by accident. In January of 1997, I chucked my previous career, and went back to school to learn programming. For 6 months, I did little but study C++ and HTML, play Doom, and work out. In April, touched based with a friend who was working for a Silicon Valley startup. He told me that he might have a job for me in August.

    When August came, I sent him a resume, did a phone interview, and was hired at a small startup company. Rich showed me to my cube, pointed me at some perl code used for monitoring servers, and told me to learn it. Armed only with the Camel Book and the knowledge that I knew zero perl, I dug in.

    Over the next few months, I learned how the code worked (connect to a socket, send a query, parse the response, report the result), and both expanded and improved it. Five years later, I've forgotten 90% of the C++, but I'm still doing perl every day.

    "What do I want? I'm an American. I want more."

Re: Why I learn a language.
by nadadogg (Acolyte) on Feb 26, 2003 at 19:42 UTC
    Well, I work for a McDonald's owner/operator with 47 stores. The guy who is over the IT department hired me to keep the office computers going(28 and counting) and write programs/scripts when needed. Recently, we needed to have hundreds of files culled out of thousands, formatted, and put into files easily readable by MS Access. To do so, I used perl, and my boss used access, which is ending up to be a wonderful match. Objectives for my code are initially just to Make It Work, then, after the deadline is met, I will optimize/comment/pretty it up a bit. nadadogg