Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Your Opinion On This Syntax
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01427920
Message ID:
01427925
Vues:
77
>
>dtShopOrder = new ERP().GetShopOrderDetails(txtSerialNum.Text);
>
>
>as opposed to
>
>
>ERP erp = new ERP();
>dtShopOrder = erp.GetShopOrderDetails(txtSerialNum.Text);
>
>
>Does one work better than the other? Any reasons to do it one way over the other?
>
>Personnally, I find syntax 2 easier to read.

Haven't tested this and could be completely wrong but I'd assume that the instance of ERP would potentially hang around longer using the second form (untill erp goes out of scope) - so if you know you won't need it again then use the first one.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform