D benchmark code review

Daniel Murphy yebblies at nospamgmail.com
Fri Dec 13 05:34:04 PST 2013


"Rikki Cattermole" <alphaglosined at gmail.com> wrote in message 
news:otjpativnfoecwjqethp at forum.dlang.org...
>
> You have a lot of global variables of same type. With very similar default 
> values.
> Example windX and runTmr. They are both doubles.
>
> Perhaps an alternative way to write it is like this:
> double
>  windX = 0,
>  runTmr = 0;
>
> You also have a lot of enums that like WIDTH and HEIGHT that could be 
> transformed into a single enum.
> e.g.
> enum int WIDTH = 800;
> enum int HEIGHT = 600;
>
> Would become:
> enum : int {
>  WIDTH = 800,
>  HEIGHT = 600
> }
>
> Adds a couple extra lines but hey when you got 20 odd values and repeating 
> the type it kinda looks ugly.
>

I would not consider either of those an improvement. 




More information about the Digitalmars-d mailing list