A while ago I blogged about the pitfalls of working in multiple languages, and lo and behold I instantly went and fell down another of them.
double value1 = 10.50; double value2 = 00.50; double result = value1 + value2;
I know that the leading zero in the number assigned to value2 is not needed but it made the decimal points line up, which made the code a but easier to read (this is an excerpt, there was a large column of numbers in the real code). Well all I can say is that I should have used a space or tab but I didn’t. All was well the code compiled and passed its tests.
var value1 = 10.50; var value2 = 00.50; var result = value1 + value2;