paulthepaddy
Well-known member
Hi Guys, this might seem a simple question, but its one that google isn't giving me much help with.
im looking to know what is the best way to use declarations.
what is the diffrence between dim and private?
is their any scenarios that i should use private over dim or dim over private.
but mainly properties. i understand properties are useful because of their 'get' & 'set'
EXAMPLE
The 'InvoiceNumber' needs to be uppercase contains a few letters and mainly numbers, so the 'set' will be useful for making sure that its is in uppercase and that its in the right format of our invoice number. but the 'DIM _InvoiceNumber' should i use dim or private or does it not matter.
AND
'Paid' doesn't need a 'set' or 'get' so a property doesn't give any advantages over Public as far as im concerned, but it is a property of an invoice object.
is it a case of i can do what i want and it doesn't really matter as long as it works. or is their a general GOOD programming rule to follow as such?
thanks guys, i know this isn't a help me kinda of question, but since i am re writing my app again.. would like to know peoples advice
im looking to know what is the best way to use declarations.
what is the diffrence between dim and private?
is their any scenarios that i should use private over dim or dim over private.
but mainly properties. i understand properties are useful because of their 'get' & 'set'
EXAMPLE
VB.NET:
Public Class Invoices
Dim _InvoiceNumber As String
Public Property InvoiceNumber As String
Get
Return _InvoiceNumber
End Get
Set(value As String)
End Set
End Property
Public paid As Boolean
End Class
The 'InvoiceNumber' needs to be uppercase contains a few letters and mainly numbers, so the 'set' will be useful for making sure that its is in uppercase and that its in the right format of our invoice number. but the 'DIM _InvoiceNumber' should i use dim or private or does it not matter.
AND
'Paid' doesn't need a 'set' or 'get' so a property doesn't give any advantages over Public as far as im concerned, but it is a property of an invoice object.
is it a case of i can do what i want and it doesn't really matter as long as it works. or is their a general GOOD programming rule to follow as such?
thanks guys, i know this isn't a help me kinda of question, but since i am re writing my app again.. would like to know peoples advice