Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using var benefits
Message
De
27/05/2011 14:20:01
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
27/05/2011 13:01:36
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows XP SP2
Divers
Thread ID:
01512055
Message ID:
01512088
Vues:
54
>>Hi all,
>>
>>Is there any performance benefits to using or not using var to declare objects?
>>
>>Is this better in some way (or not)
>>
>>DBRange range = new DBRange();
>>
>>over this:
>>var range = new DBRange();
>>
>>Thanks
>
>I use var for whatever I can. Just something I started doing, and I haven't run into any negatives yet. Resharper prompts me to change everything var.

I like Reshaper for lots of reasons. I change them to var whenever the initialization is obvious. If it isn't, then I leave it explicit just for readability.
Thanks Mike
Timothy
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform