Just where has this language gone wrong?

David Piepgrass qwertie256 at gmail.com
Thu Jul 19 15:32:03 PDT 2012


> I suspect that you have a C++ background. If this is not 
> accurate, ignore the rest. But if it is accurate, my plea to 
> you is: Learn other languages. C++ has next to no innovative 
> language features (even C++11's take on lambdas is an 
> abomination) and encourages defensive programming to the point 
> where it's ridiculous (I mean, no default initialization of 
> variables? In 2012?).

Actually, C# has no default initialization* of local variables, 
and I love it. Instead, it is a compile-time error to read a 
variable if the compiler cannot guarantee that you have 
initialized it. IMO this is much better than D's "let's 
initialize doubles to NaN so that something fishy will happen at 
runtime if you forget to initialize it" :)

* technically the compiler asks the runtime to bitwise 0-fill 
everything, but that's just an implementation detail required for 
the .NET verifier, and the optimizer can ignore the request to 
preinitialize.


More information about the Digitalmars-d mailing list