Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Argument starter - The roots of all evil
Message
De
08/09/2004 23:10:30
 
 
À
08/09/2004 23:00:03
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00938079
Message ID:
00940480
Vues:
32
>>By the way I can't see ever agreeing that DO CASEs coded specifically to execute every CASE statement (faking a FALSE condition on each to make it happen) is EVER READABLE. IF your definition of readable is fewer indentations then you may think you have a winner, but in fact you don't. I bet that 98% of people debugging someone else's program expects that a DO CASE is testing for (more or less) independent conditions where 1 is EXPECTED TO BE TRUE. What you say is fine is totally contrary to the design intention of DO CASE and in my opinion is genuinely a cop-out from doing things properly. Just because DO CASE *can* be used that way does not make it reasonable to do so. Curious that you feel that you can successfully avoid EXIT/LOOP in your own code (and get worried when you see it in others) yet you happily use a construct exactly against it clear design intention! I'd say yours is one example of the definition of "readability" that could use some reconsideration.
>
>I'm not sure whether you're talking about YAG's construct that I first saw in COM-Codebook. There he calls a bunch of functions, and bails out as soon as any of them returns .f.; in metacode it would be
>
llOK=.f.
>do case
>  case not this.Create1stThing()
>  case not this.Create2ndThing()
>  case not this.Create3rdThing()
>  case not this.Create4thThing()
>  case not this.Create5thThing()
>  otherwise
>      llOK=.t.
>endcase
>return llOK
>
>I confess I had problems following this the first time, but then I got to like it - and I think it's a neat idea when implemented this way.
>
>From your tone I assume you saw this idea perverted beyond recognition, which just proves that bad programmers have just as much imagination and are at least as much inventive as the good ones. But that's not what makes them bad.

Dragan,

Yes, you've hit the nail on the head... my first experience with such, a few years back, was a gruesome one.

You have shed a different light on this for me. I still call it 'sexiness' rather than helpfulness and I won't code such a thing myself but I will be less obstinate in my position as regards others' code.
To me the basic construct remains a perversion that I don't think should be used (I don't think less keystrokes justifies perversion) but I have become sensitive to recognizing it now.

cheers


>
>Just as they say about cars: a new car has a thousand problems; an old one has only one.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform