4 ms·
> The only thing that cares at the application layer is the application code, True, but... > it can just say "everything is little endian" and be done with it
by dllthomas 10y ago
> The only thing that cares at the application layer is the application code,
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).
- saurik 10y agoI 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).
- dllthomas 10y agoYeah, that's probably the case, and quite possibly what was intended. I think my elaboration deals fine with that case too, though.