3 ms·
> Yes, but it's not impossible to achieve it in practice. For any one implementation. But there's a very large number of implementations. You just can't coun
by cryptonector 3y ago
> Yes, but it's not impossible to achieve it in practice.
For any one implementation. But there's a very large number of implementations. You just can't count on object key order being preserved, so don't.
- ash 3y agoThere are situations where keeping order is useful. For example, human-editable json config files. I also gave an example of two implementations that are compatible for a useful subset of keys. By the way, SQLite JSONB keeps object keys in insertion order, similar to Python: https://news.ycombinator.com/item?id=38547254 https://news.ycombinator.com/item?id=38547254
- cryptonector 3y ago> There are situations where keeping order is useful. For example, human-editable json config files. You might have to just normalize every time you want to edit that.
- anamexis 3y agoYou can count on object key order being preserved when you control the implementation. Which is why it's useful to know whether a given implementation preserves key order.