Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Your Opinion On This Syntax
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01427920
Message ID:
01427925
Views:
78
>
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform