[chbot] naming of variables

Volker Kuhlmann list0570 at paradise.net.nz
Fri Aug 7 08:54:58 BST 2015


On Thu 06 Aug 2015 09:55:58 NZST +1200, Michael Field wrote:

> I strongly
> agree with like adding units on variable that hold quantities.

Yes! No confusion about their scale.

> I sit on
> the fence of the "uint8_t" vs "unsigned char" debate.

No way!! char is NOT guaranteed to be one byte. It is guaranteed to be
the smallest quantity the architecture can handle, so it's
architecture-specific. Bad news. I was programming some TI DSPs once,
32bit architecture, no byte instructions, you wanted to store a
character, that's 32 bits thanks. And sizeof(char) is guaranteed equal
to 1, so you're stuffed. That's why uint8_t became necessary - it's a
hardware abstraction. On that DSP the compiler would have to substitute
multiple instructions, but it stays 8 bits.

And the best thing about Jack Ganssle is, he is allowed to have his
opinions... ;-)))

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list