3 ms·
Binary protocols are their own negative externality as well. They can be much harder to debug, requiring specialized tooling that may also have its own bugs.
by jandrese 6y ago
Binary protocols are their own negative externality as well. They can be much harder to debug, requiring specialized tooling that may also have its own bugs. They can also suffer from things like insufficiently specified byte ordering issues and differences in floating point behaviour between systems.
I know of at least one game that very close but not quite cross compatible between Windows and Linux due to differences in the way the floating point numbers are handled. People think they can just sweep all of that parsing complexity under the rug by just reading the bytes into their memory structures, but it comes back to bite them in the end.
- jacques_chester 6y ago> requiring specialized tooling that may also have its own bugs The common ones all have Wireshark plugins. So I'm not sure what's special. > They can also suffer from things like insufficiently specified byte ordering issues and differences in floating point behaviour between systems ... I know of at least one game that very close but not quite cross compatible between Windows and Linux... I think this shows I did a poor job of explaining myself. I don't mean that everyone should create their own binary encoding. I'm saying that you should pick a well-known, well-supported encoding like protobufs, Avro, CBOR, flatbuffers ... There are about a dozen strong contenders, all of which have tooling, library support and the ability to ROFLstomp plaintext on any measure of burden other than yours or mine.
- account42 6y ago> I know of at least one game that very close but not quite cross compatible between Windows and Linux due to differences in the way the floating point numbers are handled. People think they can just sweep all of that parsing complexity under the rug by just reading the bytes into their memory structures, but it comes back to bite them in the end. There is no difference in the binary encoding of floating point numbers between Linux and Windows - any differences there are (default rounding mode, etc) affect calculations and would be the same with a text-based format. In fact, text-based formats make things worse because people tend to forget that C parsing functions take the locale into account which affects the symbol used for the decimal point in floating point numbers.