3 ms·
Because people are lazy in general. It’s easier to follow what perceived to be a convention, without questioning these conventions. Programming books and univer
by Const-me 5y ago
Because people are lazy in general. It’s easier to follow what perceived to be a convention, without questioning these conventions. Programming books and university classes don’t update that frequently, the amount of old information creates that perception.
I am only using big endian for variable-length integers: https://www.rfc-editor.org/rfc/rfc8794.html#name-variable-size-integer https://www.rfc-editor.org/rfc/rfc8794.html#name-variable-si...
In that particular use case, allows to find length of the integer by only reading the first byte. This feature helps for use cases when you wanna skip fields instead of de-serializing them.
And, it doesn’t screw up bit patterns. A variable-length integer 0x808080 gonna have three 0x80 bytes somewhere in the serialized stream. This feature sometimes helps debugging things. A little endian equivalent would have them bit-shifted by the size of header.
For fixed-length integers, I only using little-endian in my file formats.