in reply to Re: Code should be version-aware
in thread Code should be version-aware

I think your missing his point. I'm not certain, but I'm fairly sure that his point was not that everyone should write modules for 5.006 or whatever, but that modules should know what their minimum required perl version is and say so explicitly.

Replies are listed 'Best First'.
Re: Code should be version-aware
by Abigail-II (Bishop) on Aug 12, 2003 at 06:51 UTC
    I was responding to:
    The bigger question is, of course, at what point do you continue to code for older versions, and at what point do you give them up? This is very much analagous to the situation with html and web browsers.

    which to me clearly talks about coding for older versions, and not about putting in a 'use 5.8' of some sorts.

    Abigail

Re: Re: Re: Code should be version-aware
by ajdelore (Pilgrim) on Aug 13, 2003 at 16:58 UTC

    Exactly... As I said in the OP, I wasn't trying to suggest that people need to code for older perl versions. I was just suggesting that, much the same as use strict; has become basically a standard for good coding practice, so should software being version-aware.

    As other monks have pointed out, I suppose I should add the caveat that code should be version-aware when it is using features that will break older versions.

    In addition to a require/use version statement, putting something in the POD will alert users before they download and try to use the script/module/code.

    This is not because I think that people should continue to use perl 5.005, but simply in acknowledgement of the fact that many people do use perl 5.005.

    Authors should certainly use features available in higher versions -- that isn't my point. My point is, just make your code (and POD) reflect this.

    Finally, re: Abigail-II's comments, I think there is an analogy between perl and HTML. There are a lot of people out there downloading CGI scripts and running them on commercial web hosts who are basically clueless end users when it comes to perl. They don't know what version of perl they have, and wouldn't know how to upgrade it if they did.

    Also, you need access to the shell to do it -- not everyone has this, or else they have limited disk quotas that would not handle the installation.

    However, the point I was really trying to make was from a programmer's perspective. HTML authors are always fooling around trying to make sure their fancy new layouts look alright in older browsers. At some point, you just have to write off Netscape<=4 or what have you. Similarly, if you are coding for an unknown user-group (ie a CGI script or something like that), at what point do you say "I don't care if this doesn't work in version X."

    Of course, I wasn't trying to open this can of worms. :)

    </ajdelore>