4 ms·
> Nothing will ever unseat JSON because whilst it's crap, it's good enough. JSON is "secretly" being replaced by JSON5 in quite a lot of contexts. So I'm not s
by the_mitsuhiko 4y ago
> Nothing will ever unseat JSON because whilst it's crap, it's good enough.
JSON is "secretly" being replaced by JSON5 in quite a lot of contexts. So I'm not sure that this is entirely accurate. The same was said about XML a long time ago and people claimed that XML will never be replaced. Yet today XML is barely used any more. Likewise TOML is showing up in more and more places were previously INI or YAML was the standard.
- capableweb 4y agoOf course, all of this depends on your context. It's possible that one's world is all about JSON5, while another person's world is all about XML (yes, still). It all depends on where you work, what FOSS you contribute to, what code you write, what language you use. TOML for example is extensively used in the Rust world, but if you're doing PHP, you're much more likely to deal with XML or JSON than TOML on a daily basis.
- paulsutter 4y agoXML had an aura of inevitability, but everyone hated it. That’s why JSON won, it isn’t vile like XML
- TylerE 4y agoXML would have been so much more popular if it hadn't had A: namespaces and B: just about the worst imaginable syntax for same.
- capableweb 4y agoThere is no end-state for formats where one "won" and others "lost". XML "won" in terms of it being used everywhere in the past, JSON "won" in terms of it being used everywhere right now and some other format will have "won" in terms of it being used everywhere in the future. Formats come and go over time, surely JSON will as well.
- mkl 4y agoJSON5 looks great! https://json5.org/ https://json5.org/
- BiteCode_dev 4y agoI wish. But not only this is not well supported, the parsers are usually very slow.
- twic 4y agoI have never come across anything that actually uses JSON5.
- ttfkam 4y agoPostgraphile comes immediately to my mind. https://www.graphile.org/postgraphile/smart-tags-file/ https://www.graphile.org/postgraphile/smart-tags-file/ JSON5 parsing is unfortunately slower than JSON. Not intrinsically, but JSON.parse/stringify are both natively implemented and highly optimized. If browsers started supporting it, it would take off overnight. I can't tell you how often I've wanted to put comments or not worry about removing the last trailing comma from a list. It would win for some of the same reasons HTML5 beat XHTML. Ease of use and implicit rules beat pedantic strictness any day of the week. "Programmers are lazy."
- the_mitsuhiko 4y agoYou would be surprised how widespread it is across certain ecosystems. Even the apple JSON parser supports it. A lot of the .json config files in the JS/VSCode ecosystem are actually JSON5 files.
- deleted 4y ago[deleted]
- lttlrck 4y agoJSON5 is specifically for hand-written config files. So it can only be replacing JSON in that context, or?
- Kuyawa 4y agoI didn't know JSON5 existed until this post and from now on will use it everywhere. Kudos to Asheem and all JSON5 team for building a great product while ignoring the haters [1] [1] https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5 https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5