Title: RE: defining 'constants' at run time

Sam Vilain responded on 04 March 2004 11:58
> On Thu, 04 Mar 2004 21:55, Orton, Yves wrote;
>
>   > Well, people who spend a lot of time on the message boards helping
>   > out get a lot of questions like:
>   >    "How can I replace every letter 'o' not preceded by 'f' and not
>   > followed by an 's' without using index, subtr, or a regex."
>   > The useless answers are typically things like
>   >   "Very very carefully"
>   >   "With a piece of camembert and a two foot length of string"
>   > The useful answers are typically like
>   > "Why on earth do you want to do such a silly thing. USE THE
>   > FRIGGIN REGEX ALREADY."
>
> To the programmer who has some real reason not to use the regex
> engine, that you don't know about, none of the above are useful.

Yes, but there are almost no reasons for this. And when someone says this and has a good reason its pretty clear from the post as it includes something like "yeah yeah, i know, use a regex. But the problem here is that the fnorble is fnazzled in regex fnubar and so thats out of the question" and then the respondants are ina much better position to help. Like saying, "well if you recompile the fnubar with gcc 3.1415926535 then youl find this problem goes away and then you _can_ use the regex."


> On the other hand,
>
>  sub doit {pack("C*",(map{($a!=102)&&($_!=115)&&($b==111)&&($b=118);
>  ($q,$a,$b)=($a,$b,$_);$q}unpack("C*",$_[0])),$a,$b)}
>
> would either be entirely what they're after, or speak aloud as an
> adequate answer to why s/([^f])o([^s])/${1}v${2}/g is usually better.

Heh. Cool. ++ to you.

>
> To broad-handedly cast aside the the bearer of a question's approach
> as flawed is incredibly closed minded.  Pretending that you know best
> for their situation is at worst arrogant and at best naive.

Not really, the respondant is a volunteer. Its up to them how to answer. And if they think a posters claim that "i cant use X" is rubbish then its their perogative to say so. And frankly if someone either arrogant or naive wants to help me in a way that doesnt really help I suspect i would say "thanks but actually..." and not "why the hell dont you trust me on this". After all they dont owe me anything, and if they thought they were helping why should I care if its misguided?

And IMO, the vast majority of times when you really look into a claim that "I cant use X" (X=modules is a _great_ example) you find out that in fact they _can_ use the feature. Using the modules example, the number of times ive see "I cant use a module" and the real fact is "my sysadmin wont install anything to sit/lib" which doesnt prevent the user from installing the module locally for themselves.

Anyway, I was just responding ROUS'es somewhat rhetorical question about why people make this kind of comment. The reason IMO is that its because usually such comments are right on the money. The fact that it wasnt here is beside the point.

Yves



Reply via email to