Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP's With...EndWith equivalent in C# ?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01216132
Message ID:
01218526
Vues:
16
Hi Martin.

>Here you are doing a wrong assumption. To implement with/endwith the compiler HAVE to create a reference (a variable) anyways, so there is no gain at all. That's why I said this is pure syntactic sugar.

Ah, yes... I should give you the reason (mmm, not sure of my english there, "Te tengo que dar la razón") internally a variable will be created, so my point was wrong, I guess too much sugar clouded my judgement <g>

>This is not the same in VFP where the interpreter can (and indeed does) benefit from creating a local reference on the fly and doesn't have to parse all the hierarchy again (and creating a local variable will incur in a -really negligible- resource increase. This does not apply to compile code.

Yes, I understand this difference.

>
>Again this is not a religious issue, but I guess most C# developers wouldn't want an additional keyword in the language just for a very small -and debatable- value.

Pansies. Fox has "thousands" of keywords and I wouldn't mind more <g>

>
>As you mentioned before that some things in your code are just pointing to a structural problem, I also think that a frequent need of shortcutting references like this are uncovering some code smells, like deep chaining (most probably due to high coupling) or bloated methods. I never noticed a real need of shortcutting a reference to a temp variable that was not a sign of refactoring needed.

>
>As always, it is nice to debate with you... <s>
>
>Best regards,

I agree with you, but on the other hand I still think that a with statement is more elegant (sweeter <g>) than repeated use of a variable, but you are right, aesthetics are not enough of a reason for changing the compiler

Thanks Martin
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform