3 ms·
You are right about cramming things into bits. But it often makes code more complicated. Eg if you have two operations you do one after another and they have
by eru 3y ago
You are right about cramming things into bits. But it often makes code more complicated.
Eg if you have two operations you do one after another and they have time-outs of t1 and t2, then normally, you know that after t1+t2, either both will have succeeded, or they will have failed.
But that breaks down with the 'C-conventions' when either t1 or t2 equals 0. Thus you need extra logic to deal with these.
As an aside: OCaml uses tagged pointers to cram more information into machine words. That's an implementation technique, and (mostly) hidden from users of the language. (Apart from integers having 63 bits, instead of 64 bits size by default.) So that's an example where the language is 'clean', but the implementation is still efficient and uses all the low level tricks.
And my pet peeve is more that many people always do this trickery, even when not every bit counts.
> It's not just C people :D - Zero may or may not be a natural number depending on who you ask, and negative numbers definitely are not.
Yes, but I never mentioned any restriction to Natural numbers. Btw, in the context of computers 0 is definitely a number that comes natural, even if it's not a Natural number by some people's definition.