5 ms·
For me using uint8_t and family makes things simpler (working predominately with packets) It is a container for X bits and thats it, its easy to understand ove
by me_me_me 4y ago
For me using uint8_t and family makes things simpler (working predominately with packets)
It is a container for X bits and thats it, its easy to understand overflow and corner case behaviors.
I rarely find good reason to use signed ints, so only when I need them i worry about sign handling.
> because you never know if somebody is going to want to use an integer in, say, a downwards loop
Why risk a possible bug, for a hypothetical case of someone wanting signed var?
If they really want to use signed vars they can handle it themselves.
- bee_rider 4y agoYeah. My context was doing linear algebra stuff. It is apparently a known mistake to say "well we aren't going to have to describe negative positions for matrix elements, so why not make the integer unsigned?" but there are lots of cases where you want a negative offset for whatever reason. ("I want to stop right before the diagonal"). I can definitely see why you might not ever need a sign in networking stuff.