why are magic numbers preferred?

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Apr 16 17:13:29 UTC 2008


On Wed, 16 Apr 2008, Bernhard Fischer wrote:

> Some of these could perhaps go into the "library tuning", if vda likes
> it.

Yes.

> Still, i think you're overdoing it a bit.

Yes, I do, I have to admit.

> Funny, i _though_ we had
> # define KB (1024)
> # define MB (1024*1024)

HALF_KB maybe?

> but i do not see them (anymore).
>
> []
> > #include "libbb.h"
> >
> >+#define FOUR    4
> >+#define ONE_KB  1024
> >+#define FOUR_KB (FOUR * ONE_KB)
>
> This somehow reminds me of those people who made a fake-script wrapper
> that was able to run ontop of both bash and csh -- was it SciTech? don't
> remember.

Don't know those people ;-)


Cheers,

-- 
Cristian



More information about the busybox mailing list