Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent to eval()
Message
De
29/03/2010 15:05:25
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
29/03/2010 04:26:37
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01457734
Message ID:
01457899
Vues:
57
but if you find yourself needing it in normal development work then it almost always implies a weakness in the design.

I guess it depends what "normal development" work is. If you mean standard database apps, I'd tend to agree- though reflection has made sense in some areas (e.g. databinding) and there are apps out there making extensive use of it whose authors are unlikely to relish the thought of rewriting.

TBH I don't think comparison with VFP makes too much sense on this issue. The reasons why you would do it and the way in which it is done are too different.....

True. VFP did make it easy to use table-driven conditional logic with EVAL(), which is not a good reason to try the same in NET. ;-) But it's fairly easy to convert that sort of code to NET, fwiw- you can write quite a simple parser to generate C# (or Java, or Python, or PHP) conditional equivalents that don't need reflection, but can be very large.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform