4 ms·
So because you have no idea how to represent some arbitrary things with JSON, we should all stop using it? You, sir, are not making any sense. Also, you seem t
by optymizer 14y ago
So because you have no idea how to represent some arbitrary things with JSON, we should all stop using it? You, sir, are not making any sense.
Also, you seem to be confusing primitive data types with complex data types. Yes, JSON doesn't have a 'color' data type. But guess what? Neither does C, nor Java. If you want a 'color' type, you'll have to create one yourself! Mind blowing, I know.
So here, let me suggest a possible solution:
dates: string
timestamp: integer
colors: string (RGB,BGR,RGBA,...), integer, object
Part of 'data modeling' is to model your data out of basic types. Shocking! If JSON had types for every type of object under the Sun (like you seem to want), JSON parsers would be a lot more complicated and little thinking would be required in the process of modeling your data.