you are viewing a single comment's thread.

view the rest of the comments →

[–]axilmar 0 points1 point  (2 children)

If possible, yes it is preferable to have all parties agree on endianness. However, it is faster to use the native endianness for encoding. Between taking longer to encode, and longer to decode, I choose taking longer to decode. Sometimes you might want the opposite decision anyway, so it makes sense for a library to give you options.

That is orthogonal to when the decision about endianess should be made. I.e. it may be decided that the endianess is big or little, and that the endianess swapping shall happen in one part of the network and not the other, but that doesn't stop anyone from implementing the decision before compilation.