With a language such as VB 6.0 which does not not have distinct assignment and comparison operators,
a = 2
' Will compile, whether you mean a is assigned 2 or whether you are comparing a with 2
If you meant compare, there is a likelihood that a runtime error ensues.
' For Assignment if you always write
a = 2
' And for Assignment if you always write
2 = a
' You eliminate the Compile-success and runtime-error scenario.
But, this is just the tip: the visual hint is unavailable when you have an expression like
a = b ' Comparison or assignment?
C# has:
- different assignment (=) & comparison (==) symbols
- comparisons have to be wrapped in brackets.
Then this becomes a non-issue.