8
Using non-priminal variable type in C# can affect performance?
I have seen several codes where, instead of using primitive C#types, many use types similar to other languages that the IDE accepts.
I once questioned a programmer why he did it and he told me it was because he liked the color combination, hehe...
For example:
Primitivo --> Utilizado
int --> Int32;
string --> String;
long --> Int64;
Note that in C# there is not exactly the concept of primitive variable. What you are talking about is just one alias the real kind that is always a
object
, in some cases more precisely a type derived fromstruct
such as theint
or thelong
.– Maniero
Possible duplicate of What is the difference of string vs string?
– Randrade