Better use on the name of variables

Posted by Cuartico on Programmers See other posts from Programmers or by Cuartico
Published on 2012-05-18T20:57:12Z Indexed on 2012/09/04 15:52 UTC
Read the original article Hit count: 317

Filed under:
|
|
|

I have a method that looks like this:

Public Function NormalizeStreetAddress(country As Namespace.Country,
                                       streetAddress As Namespace.StreetAddress) _
                                   As Namespace.StreetAddress

        Dim _streetAddress As New Namespace.StreetAddress = streetAddress

        If My.Settings.Streeteable = True Then
            Dim _AddressCustom As New Namespace.AddressCustom
            _streetAddress = _AddressCustom.NormalizeStreetAddress(country, streetAddress)
        End If
        Return _streetAddress
End Function

I receive a streetAddress object, but inside the method I need to use another streetAddress object which I called _streetAddress — is that following the standard? A friend of mine told me that object names such as _yourNameObject are for global variables, but I can't find info about this and I want to make this method more readable.

© Programmers or respective owner

Related posts about naming

Related posts about variables