I'm trying to develop some good programming practices and today I am working on a program that will take info from textboxes, radiobuttons and checkboxes. I know I could do it like this, for example:
TextBoxResult.Text = Val(TextBoxNumbA.Text) + Val(TextBoxNumbB.Text)
and it will work. Or I could also do it like this and it will work as well:
Dim result, numberA, numberB as Integer
numberA = Val(TextBoxNumbA.Text)
numberB = Val(TextBoxNumbB.Text)
result = numberA + numberB
TextBoxResult.Text = result
My question is: which is the proper way to do it? The short way without declaring variables or the long way declaring variables? How do software companies handle this?