On Friday, July 26, 2002, at 07:28 , Janek Schleicher wrote:
preliminary giggle: if coding were a science then it would not be as vulnerable to religious issues so I take no offense at well reasoned counter arguments, even if it tramples all over my dogma.... 8-) [..] > I don't want to offense you, > all I'd like to say is that this programming style > is not so bad that we should explain beginners > not to use it. [..] p0: I think your argument is well formed and well argued. since you expressly point out the problem of > you want also to say something like > if ($string =~ /(\d+)/ and $description =~ /(\w+)/) { > # now $1 contains something very different > } > > Writing like > if (my ($var) = $string =~ /(\d+)/ and $description =~ /(\w+)/) { > # doesnt have this problem > # it's a little bit more sure > } [..] which most folks don't run into until later on when they have slovenly followed the path that I laid out... p1: you are very correct to try and avoid the 'globals' $1, $2, $3..... and to try to use them sparingly. On this we fundamentally agree. So there is always the trade off to be played here with forms like my ($num, $string) = ($1,$2) if ($line =~ /^(\d+)=(\w+)/ ); etc, etc, etc.... p2: but I will religiously stand by the driving thesis: "would you really want to maintain that code?" having come back and 'blanched' at code that was no longer as 'readable' as it had once been.... made comical by the fact that friends of mine who were once 'hot perlers' now have to 'check the docs' to verify some sequence I have whipped out - because they are no longer 'as in it every day'. p3: No good general rule of advice will ever survive implementation. Since it faults the thesis in p2 - as most folks will not have the experience when starting out - to know what they will have forgotten about 'cool tricks' when they too have 'grey beards'. so they really can not answer the core question about 'maintainability' of any given form or style.... Whereas you and I come to the table with our 'experience' to guide us.... some of it well reasoned, some of it merely our continuing knee jerk reaction to things we have seen go 'bad'... p4: those being the basic Rules - beginner's will have to pick and choose how they will build up the experience to know when they are doing it right or merely fighting the fears ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]