In what way would the underlying type change? I believe that it is a change solely to the warnings/errors produced by the compiler. Although I guess some code copied from Stack Overflow may break ;) I've wanted this since C# 1.0. Any run-time error you can prevent at compile time is something that I'm for, although with all the semantic sugar they're adding, I'm worried about diabetes. I agree it's best for greenfield, I'll bet most older projects aren't updated. I wish they had made it optional by a postfix ! instead the way they did way back when with a preprocessor, but I see that acting a lot like the const poisoning that happens with C++ when you make something const so I understand why they just yanked off the band-aid. Ralph
R
Ralph Trickey
@Ralph Trickey
Posts
-
Whose idea was this in C\? -
Whose idea was this in C\?I'd be more likely to use an iterator for that case. Besides, doesn't the compiler generate a warning/error? It should know that testing an unsigned against all positive integers always returns true and seems common enough for them to catch it. Where Auto/Var shine for me is that it's more readable in the more normal SomeObject object = new SomeObject(Parameters) case.
-
Musk says we are a computer simulationWhen you look at things like the Planck constant, it actually makes a lot of sense. You lose fidelity at the edges.