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:
01216527
Vues:
16
Hey Guys,

Despite all the reasons already put here, I think that such a construction in C# would cause some major legibility problems. The main reason that leads me to think so is the fact that in C# any line break character present in the source file is normalized into a regular space by the compiler. In VB.NET the statement must be terminated on the same line or explicitly be broken with the "_" (underscore) char.

Having said that, in a perfect world, a simple "with" construction in C# would be like that:
TextBox field = new TextBox();
with (field)
{
    .Text = "foo";
}
But my immagination keeps trying to convince me that things like the following would be easily found:
TextBox field = new TextBox();
with (field)
{
    .


Text = "foo";
}
Where is "Wally" <g>? Ops... where is the dot?

Kinda weird, huh?

Well, even this being a paranoic thinking of mine, I'd prefer keep living in this more verbose C# world we have today.

Just my opinion anyway.
-----
Fabio Vazquez
http://www.fabiovazquez.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform