|
|
|
|
|
by neilparikh
2016 days ago
|
|
There's a real reason to do something similar if you're developing for a memory constrained devices with a API someone else will use. If you have objects your API functions return that API consumers will use, you want to make sure the objects don't suddenly grow in size, since that would eat into the memory that the consumers expect to use. So, you'd pad those objects with unused fields, and then if you need to add a new field, you can just use that padding area. Something similar applies if you're sending objects over the wire, since you may not want to increase the size of the message later. |
|