Comment by breadwinner
1 day ago
Use of preprocessor in the example is incidental. The problem with var is that you're not completely stating your intent, leaving it to the compiler to infer your intent. This can lead to trouble in some cases.
I have seen code that sorts numbers as strings, because nowhere in the code was the intent stated that the array is supposed to hold numbers. As a result, if the programmer forgot to convert strings to integers at input time, the bug is never caught.
See: https://circles.page/567f44465c28b00bf8ed6cf9/Csharp-type-in...
No comments yet
Contribute on Hacker News ↗