floating point - nan initializers

Walter Bright newshound at digitalmars.com
Sun Feb 19 18:46:24 PST 2006


"Anders F Björklund" <afb at algonet.se> wrote in message 
news:dtaf3q$2qlp$1 at digitaldaemon.com...
> Then again, it's usually better to catch those bugs at compile time ?
>
> Like in Java: (jikes compiler)
> *** Semantic Error: The variable "sum" may be accessed here before having 
> been definitely assigned a value.

"may" be? That's why it isn't in D. Wishy-washy messages aren't a solution. 
Furthermore, they encourage programmers to introduce dead assignments to get 
rid of the message, leaving the mysterious assignment to confuse the 
maintenance programmer trying to figure out what the code does.

Good, clean code should have every statement be reachable, and every 
assignment mean something. Having the compiler force you to insert 
meaningless assignments and unreachable code is just not helpful. 





More information about the Digitalmars-d mailing list