In VB.NET you can use shortcut assignment operators for example:
x += 1 is equivalent to x = x + 1
And
s &= "Hello" is equivalent to s = s & "Hello"
To me the latter expressions are more readable, but I have read on one website that the shortcut assignment is faster when executing code becasue it loads the lefthand side into memory only once, while the latter does so twice. Is this true ??
x += 1 is equivalent to x = x + 1
And
s &= "Hello" is equivalent to s = s & "Hello"
To me the latter expressions are more readable, but I have read on one website that the shortcut assignment is faster when executing code becasue it loads the lefthand side into memory only once, while the latter does so twice. Is this true ??