4 ms·
Could you describe some situations where adding a field broke stuff? I can only imagine that happening if your code cares about the exact binary representation/
by uryga 8y ago
Could you describe some situations where adding a field broke stuff? I can only imagine that happening if your code cares about the exact binary representation/layout of a struct - so serialization, FFI or just bit-twiddling.
- torstenvl 8y agoSerialization is one, but anything involving casting from one struct to another (e.g., if the Berkeley sockets implementation changed the size of struct in_addr), anything requiring careful management of memory alignment (e.g., SSE), etc. could potentially be broken. Never mind the inevitable reckless coding practices that arise in the wild all the time (someone decides to #define a magic number for allocation purposes instead of using sizeof...). On the other hand, a large number of constants are supposed to be tweakable, to the extent that many are designed to be set at compile time. Anyway. OP article had good points overall, I'm just not sold on some of the specifics.