Your comfort language

Your comfort language


I've been programming in Perl for years - over ten now in fact - and I've written numerous books and articles on Perl and Perl programming. I've also worked with Python and written books and articles on Python programming, including a guide to migrating Perl applications to the Python language. For a while I really saw Python as an alternative to Perl, but after so many years and experience with Perl and what was possible with the language it is difficult to move on from the 'Perl comfort zone'.

That's not to say I haven't tried alternatives; the march of free software has lead to a huge number of alternatives coming on to the market that are adopted, enhanced and extended. Ruby is a good example of a language that has, almost, appeared out of nowhere and captured the imagination of a huge number of people, particularly due to the Ruby on Rails framework.

I spent years working with Rebol, and I tried Ruby years before it became as popular as it is now (both languages featured in my XML Processing with Perl, Python and PHP title, published back at the end of 2001).

I still like all of these languages, and I'm loving Ruby on Rails at the moment, but 99% of the time, if I need to do something, I do it in Perl.

Is this a bad thing? Shouldn't I have moved on from the comfort of 10 years of Perl programming to one of the newer, flashier, alternatives?

Well, Perl isn't a bad language. There's an interesting piece at O'Reilly: How does a programming language stagnate?, which uses Perl as a base for the discussion, largely because of the perceived issues with the 'ever imminent' release of Perl 6.

I don't think Perl has stagnated; the power of Perl is in the fact that it is (a) free software, and (b) that it is extensible. I use modules from CPAN, I write my own, but never, ever, do I feel in any way restricted or limited in what I do. Sure, there are things that could be improved about the language, but nothing that really stops you from doing what you want.

So if there is nothing wrong with Perl (and even if it has stagnated), why should I move on to something that is, by others, perceived as better?

Let's think about some reasons why you might change language:

  1. Support for new features or technology - well, Perl is supported on just about every platform I know, and in terms of features and functionality, there's nothing that cannot be accessed through or from Perl with a suitable module.
  2. Lack of support - this seems unlikely to happen any time soon, given the existing user base.
  3. Lack of development - Perl is still actively maintained, and, as a free software product, I could pick up and fix bugs any time I liked if I needed to.

I know these rules apply to other languages too, and again, one of the key elements about most of the languages making the news at the moment is that the element making the news is just an extension or adaptation of the original core principles.

Perl may be my comfort zone, but it works, it's stable, and I know how to do everything I need to (often in both efficient and inefficient ways) and I see no reason in moving off any time soon, no matter how convincing the argument. Of course, this is in some ways the complete opposite of my thoughts on GNU/Linux.

Of course, if somebody has some convincing arguments one way or another, I'm open to suggestion; I just can't make any guarantees to actually convert!

Category: 

Comments

Alan Berg's picture
Submitted by Alan Berg on

Hey, I like Perl as well. If I need to get a job done quickly there, Perl is. However, for larger code bases I find it difficult to maintain readable code. Java is more verbose and to some less lovable but the responsibilities in a team of coders is easier to divide. I suppose managers feel safer with Java. So how do you remove the readability kink in Perl and leave the rest?

Terry Hancock's picture

Well, I definitely relate to the "comfort language" concept. I think that unless you are a professional programmer, the effort to remember more than two or three key languages is just too much trouble for most people.

Knowing that about myself, I decided Python was a nice place to be. I was able to learn it really fast, and more importantly, I find that I can easily pick up tasks I was working on "a month or two ago" (usually means "9 months to 2-1/2 years" when I actually check the calendar).

I tried to learn Perl a few times, then finally took a course in it at work. I didn't see much of anything I couldn't do more easily and more readably in Python.

I felt like I might've appreciated the course except that Python had spoiled me -- I couldn't help thinking that Perl was actively designed to be obtuse and difficult on things that in Python are easy like breathing.

I actually did learn some nice tricks with Perl on the command line, but the truth is, the overhead in remembering yet another language versus just doing the same thing in Python wasn't worth the difference.

So I'm not really surprised that people can get stuff done in Perl, but I feel it takes a bigger learning commitment than Python (don't know about Ruby).

Likewise, though, I didn't find much in Java or Lisp to draw me.

My only complaint about Python is that the range of libraries is not as great as for Perl or Java.

The bottom line is, though, I'm just not going to spend the time learning those languages. Python's easy for me, so I'm going to stick to it. If I were a professional programmer, I might take a different attitude, but as an amateur, I don't really feel the need.

I'll probably occasionally dabble with alternatives as exploratory play. But Python has replaced C as my most useful tool, and I don't think that's going to change anytime soon (not for me, anyway). I still hold out hope that I'll find something for which C leaps out as the best solution, but I just don't seem to be doing any of that kind of stuff anymore. And I think I'll politely avoid the subjects of Fortran and BASIC, though I wrote quite a bit of those once upon a time, too.

So on the one hand, I don't agree with your choice of language, but I understand your attitude about it very well.

Marza's picture
Submitted by Marza on

A "comfort language" is a great description for Perl. It gives me the feeling I can accomplish things even though there are many people that are superior to me.

I have considered Python, Ruby, PHP and VBscript. Have books on them on my shelf but really haven't made the effort to learn them. Perl does just about anything for my needs and it's safer to use what you know versus what you could know.

There is the fact that I have to use what the others could support. They don't understand the other languages and could hack there way into fixing a Perl script.

Perl replaced shell scripts for me. I used to write for the shells but not anymore. Perl is far more comfortable.

I guess I will have to motivate ( more like kick ) myself into playing with Python and PHP.

Ryan Cartwright's picture

A colleague consistently refers to me as a "Perl guy" even though I regularly code in other languages and have never really espoused the view that Perl is the *only* way to go. I think it's because he has a dislike of/limited patience with Perl and I don't. It used to bug me but on reading this I realised that Perl is my "comfort language".

I find myself turning to Perl before other languages and the times when I've written in other ones are times when I've considered Perl first and eventually settled on the other language. When I have a task to be done, some code to be written, perl is always on my list of languages to write it in. Even when considering scripts for sysadmin work (backup scripts etc.), perl is always considered and often used.

Why Perl - first bit of real-world coding I did I guess and I suppose it stuck. And now I am stuck. Although other languages may be better suited to the task, I can write much quicker in Perl than other languages. This is probably because I am familiar with it but you know what? I like writing in Perl and "comfort" exactly sums up how I feel when I am.

Author information

Martin Brown's picture

Biography

Martin “MC” Brown is a member of the documentation team at MySQL and freelance writer. He has worked with Microsoft as an Subject Matter Expert (SME), is a featured blogger for ComputerWorld, a founding member of AnswerSquad.com, Technical Director of Foodware.net and, and has written books on topics as diverse as Microsoft Certification, iMacs, and free software programming.