asked 126k views
3 votes
List the rules to keep in mind as you declare a variable in VB.NET

1 Answer

1 vote
- What is your variable scope? Ie., in what parts of the program do you need it?
- Is it a value type or a reference type. Reference types must always be "newed". Value types are more expensive to pass as parameters.
- Does the type implement IDisposable? Then you should use it in a using { } clause.
- Is the type immutable (like string or DateTime)? Then making changes to it is more expensive than you may think.
answered
User Jason Boerner
by
7.8k points

No related questions found