Why static analysis is the way to go

H. S. Teoh hsteoh at qfbox.info
Sun May 31 04:05:47 UTC 2026


On Sun, May 31, 2026 at 12:24:05AM +0000, matheus via Digitalmars-d wrote:
[...]
> I remember a long long long time ago while I was writing my game
> engine code, I wrote something like this:
> 
>     for(i=0;i<siz;++i);{
> 
> I was reading this code on high resolution monitor + small fonts, I
> really thought there was a bug in the compiler, how come my loop
> wasn't looping? - I lost about a hour or more until I finally saw
> ";"... and then I slapped my forehead in dismay. xD
[...]

D did the right thing by forbidding `;` as an empty for-loop body and
requiring `{}` instead.  I didn't like this at first, but have since
come to appreciate the wisdom behind it.


T

-- 
No! I'm not in denial!


More information about the Digitalmars-d mailing list