D benchmark code review

Manu turkeyman at gmail.com
Fri Dec 13 08:08:16 PST 2013


On 13 December 2013 23:34, Daniel Murphy <yebblies at nospamgmail.com> wrote:

> "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.
>

Me either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131214/6854818b/attachment-0001.html>


More information about the Digitalmars-d mailing list