I tend to use the words define, declare and assign interchangeably but this seems to cause offense to some people. Is this justified? Should I only use the word declare for the first time I assign to a variable? Or is there more to it than that?
I tend to use the words define, declare and assign interchangeably but this seems
Share
Define and declare are similar but assign is very different.
Here I am declaring (or defining) a variable:
Here I am assigning a value to that variable:
Here I am doing both in one statement:
Note
Not all languages support declaration and assignment in one statement:
T-SQL
Some languages require that you assign a value to a variable upon declaration. This requirement allows the compiler or interpreter of the language to infer a type for the variable:
Python