A Philosophy of Software Design

Walter Bright newshound2 at digitalmars.com
Mon Jun 29 19:49:54 UTC 2026


On 6/29/2026 1:05 AM, Richard (Rikki) Andrew Cattermole wrote:
> But you can also throw static analysis at it to catch royally stupid cases like so:
> 
> ```d
> void thing(float arg) {
>      float f;
> 
>      return f + arg * 2;
> }
> ```

Default initializing f to nan catches it and propagates the error. Default 
initialization to 0 does not.



More information about the Digitalmars-d mailing list