Re:Falsehoods programmers believe about networks
by saurik on Monday October 24, 2016 @07:09AM
(#12777878)
I had taken that to read that there are programs in the wild that assume hosts are little endian and always "swap" bytes as opposed to converting between the two orders (which might be a no-op on a big endian system).
True, but...
> it can just say "everything is little endian" and be done with it.
... doesn't quite follow. If you're blitting integers directly, your code will break on either a big- or little-endian boxes. Better to pick a standard encoding and always serialize/deserialize properly whatever that means. That standard encoding may be little-endian (maybe better than big-endian - such systems are overwhelmingly more common on the desktop/server) or may be some packed representation. But ideally you could change the representation without changing application code other than the serialization/deserialization itself (which may well live in a library).