All threads / Do we need an alternative to JSON?

Ask A Question


You’re not receiving notifications from this thread.

Do we need an alternative to JSON?

Charlesmartin asked in Javascript

Hey everyone,

Maybe this is a controversial topic but I've been wondering for a while about a JSON alternative. Being able to serialize objects, array, string, numbers and booleans is nice and fit 99.9% of needs, but there's still that 0.1% left behind. I'm thinking serializing dates, sets, functions?, refere nces (more on that later) and other data structures we can use in "native" JS. fedloan

On the other hand, it's really convenient to have a standardized data parser/serializer that's super simple and thus works across many programming languages, still is human readable/writable enough.

But I've seen quite a few project (JSON graph, netflix's Falcor) trying to shove in graphs under a JSON notation, other smaller libraries scanning strings to see if one matches a date format or a RegEx that I feel like we hold to JSON a little bit too much, and maybe a slight evolution wouldn't be bad. easybib

On the references side, I find it really funny that a core property of JS variables (objects and arrays are just references) isn't carried to the serialized version. Makes more sense on the human readable/writable sense, but becomes very verbose, especially in the graphQL age (which by the use of JSON should be called Graph2TreeQL IMO), and gets wrecked by circular object which are just fine a easy to serialize if you add a way to do it.

Am I alone in this or are there other people sometimes frustrated with JSON limitations? And if yes, what is the biggest "I wish it could do X" be?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.