Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Initializing your variables when you define them
Message
From
15/02/2009 02:14:13
 
 
To
15/02/2009 01:56:09
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01381858
Message ID:
01381859
Views:
50
>Do you do it? I've read in one Microsoft Press book not to if you don't need to, but read in another that you should. If you check the setting to treat all warnings as error in your project more than likely at some point you will be nagged about it if you don't.

Yes, I do. This is like that all over the place. Here is an example:
            Dim lcConnection As String = ""
            Dim lcHitLanguage As String = ""
            Dim lcString As String = ""
            Dim lcTempDir As String = ""
            Dim lcValue As String = ""
            Dim lnBackend As Integer = 0
            Dim lnConnection As Integer = 0
            Dim lnCounter As Integer = 0
            Dim lnCounter2 As Integer = 0
            Dim lnShowError As Integer = 0
            Dim lnSQLMode As Integer = 0
            Dim lnTimeZoneOffset As Integer = 0
This provides an overview of all developers of an example of the content of the variable. For a date, I will initliaze to nothing and similar definition for other types of variables.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform