A Philosophy of Software Design

Mike Shah mshah.475 at gmail.com
Wed Jul 1 01:10:01 UTC 2026


On Tuesday, 30 June 2026 at 18:48:32 UTC, Forum User wrote:
> On Sunday, 28 June 2026 at 23:58:07 UTC, Walter Bright wrote:
>> You're worse off with a bad number taking a merry path through 
>> the conditionals, as you won't know which number is bad.
>
> Exactly. Enabling hardware traps for invalid op. etc. 
> "Define[s] Errors Out Of Existence".

NaN as the default(.init) for floats took me a a bit to get use 
to when learning D -- but personally I like it as a default. When 
I wrote my first math library for a game, it helped me catch a 
few bugs (mostly with things like initializing temporary 
vectors/matrices for calculations)!  Probably most importantly, 
it makes me think about what value to initialize a float to which 
is important.



More information about the Digitalmars-d mailing list