| ▲ | jdw64 5 days ago | |||||||
>The number of data formats I see that miss obvious things like alignment etc. After reading that sentence, I felt a little guilty. It's actually a basic principle of design, but in practice, I just don't pay much attention to it and only write code for readability | ||||||||
| ▲ | benj111 5 days ago | parent [-] | |||||||
It doesn't even have to impact readability. See for example https://github.com/MayaPosch/NymphRPC/blob/master/doc/nymphr... There's an int8 in the middle of int32s knocking everything out of alignment. And it doesn't need to be because flags is int32 and only uses 4 bits. Changing that doesn't have to impact readability. Makes it easier to process, makes a struct representation more compact. | ||||||||
| ||||||||