go ahead... be a heretic | |
PerlMonks |
Re: Re: Re: Breaking output lines into N-element chunksby demerphq (Chancellor) |
on Apr 12, 2002 at 13:43 UTC ( [id://158570]=note: print w/replies, xml ) | Need Help?? |
I don't like that syntax, though, so I stick to subs with empty prototypes While I agree with you that the constant syntax is not that nice I believe that in the long run you are probably doing yourself a disservice with not using it. The advantage of using constant is that it clearly announces to a maintainence coder or equiv what is going on. They would need to be fairly experienced to know what the purpose is of such an unusual looking sub, and if they were like me might even remove the prototype on principle. A second point is that by using the module you are implicitly documenting what you are doing. Not just on a literal programming level but also simply on the level that the maintainence coder can then review constant.pm documentation and see that there _are_ quirks with this technique. Now these quirks apply whether you do it by hand or by using contant.pm, the only difference being that if you do all your constants by hand its up to YOU to document these quirks to future programmers. Being a lazy type, especially when it comes to documentation I would use constant.pm for this reason alone...
Yves / DeMerphq
In Section
Seekers of Perl Wisdom
|
|