in reply to "advanced" Perl functions and maintainability

I started to learn to use Perl after learning a bunch of other languages. Probably the biggest influence on the code I often write is C because it was the first language I learned after BASIC and years away from a computer.

When I started writing Perl I went out of my way to make the code as easy to read and understand as I could. Sometimes that meant writing things in a few lines instead of one line. I worked with people who were not familiar with Perl but had worked with a few imperative languages which I figure is probably pretty common so I wrote the as best I thought I could so that they could understand it.

I had people comment on how nice it was to work on that code compared to some of the other code they had seen. I was happy to hear that. One day I was talking with someone who had been coding in Perl for quite a while longer than I had. After talking about this he said "you shouldn't hire a C programmer to maintain Perl code". It stuck with me because it is a really interesting point.

I'm not sure but I think the decision you make depends on what is important to you. You have to ask yourself who the code is really going to be read by.

/Chad

As a side note I've heard AutoCAD is dropping AutoLISP from an upcoming version in favour of VisualBasic scripting. My (very uninformed) suspicion is that it's easier to find VB programmers than LISP programmers even though anyone I have talked to who knows both languages prefers LISP.
  • Comment on Re: "advanced" Perl functions and maintainability

Replies are listed 'Best First'.
Re^2: "advanced" Perl functions and maintainability
by simonm (Vicar) on Dec 11, 2004 at 19:39 UTC
    ... the decision you make depends on what is important to you. You have to ask yourself who the code is really going to be read by.

    Seconded. Consider the future lifecycle of your software/project/company... Are they likely to end up hiring inexperienced developers to work on this in the future, or is this an avenue they need to keep open?

    If that doesn't seem particularly likely, I'd suggest using the "advanced" features -- they'll make your code more succinct, which is a benefit in and of itself.

      while i do agree with the sentiment (one of the reasons i'm asking for added wisdom), if a new guy comes along ... isn't reading and maintaining the code of someone "more senior" that actually works a good way to gain experience?

      i totally admit that if i were doing esoteric tricks a la, say, thedamian ... i'd be worried. but we're talking about map here, not strange perl-OO bag-o-tricks that make your brain throb.