NotesJSON is extremely popular but deeply flawed. This article discusses the details of JSON’s design, how it’s used (and misused), and how seemingly helpful “human readability” features cause headaches instead. Crucially, you rarely find JSON-based tools (except dedicated tools like jq) that can safely handle arbitrary JSON documents without a schema—common corner cases can lead to data corruption!
(blog also has a neato minimap view of the whole entry on the side, like VSCode)FeedUnfurl
NotesThis makes it possible to insert JSON straight into SQLite and then have it extract data and index them, i.e. you can treat SQLite as a document database. This has been possible with PostgreSQL and obviously is what something like Elastic provides but having it available in an embedded database is very nice for lightweight stuff.FeedUnfurl
NotesLes recently gave a talk on "Designing a Beautiful REST + JSON API" at the San Francisco Java Users Group, which covers 18 months of his research into API design.Unfurl
Notesjq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.Unfurl
NotesThis is not really new. This is just an example of the same DOM/JS garbage collection issues that have plagued webdev since time immemorial. Don't keep references to DOM nodes in your JS code: they tend to stick around.Unfurl
Notes"As I wrote this blog engine, the need for a commenting system arose and I reflected about a small and simple commenting system with just a flat file JSON store. This is my solution, which can be used on any static page on a server with PHP support."Unfurl
Notes"Personally I'm thrilled by the idea and encouraged by its execution so far, and have been poking cautiously at Laconica for the past couple of weeks, hoping to contribute in whatever way I can. Here's a prototype badge, based on Laconica's RSS feeds andUnfurl
Notes"I do not claim to have invented JSON. I claim only that I discovered it. It existed in nature. I identified it, gave it a name, and showed how it was useful."Unfurl
NotesSkeptical, not yet a fan - "A word of warning: this takes a little getting used to. It is slightly more verbose than the current methods for using JSON in JavaScript"Unfurl
Notes"Think about the benefits of having a single scripting language that you can use reliably on the server, in browsers, for applications ... and scripting tasks ..., and also the same language for data encapsulation and transfer as well."Unfurl
Notes"a generic microformats parser for JavaScript. Yes, there are a few things about but they all tend to be tied to a single format and I wanted to build a framework that would allow any microformat to be defined using a JSON-like definition so it could be uUnfurl
Notes"With the AJAX Feed API, you can download any public Atom or RSS feed using only JavaScript, so you can easily mash up feeds with your content and other APIs"Unfurl
Notes"Google has announced a new Ajax Feed API makes it possible to extract information from multiple RSS feeds with only a few simple lines of JavaScript"Unfurl
Notes"The Google AJAX Feed API provides functionality that allows webpages to retrieve any public RSS or Atom feed via a simple JavaScript method call."Unfurl
Notes"The security of systems that use JSON is determined by the quality of the design of those systems. JSON itself introduces no vulnerabilities."Unfurl
Notes"It may seem clear to some that parsing/generating JSON is more efficient than XML, but here’s some numbers that make things a little clearer."Unfurl
NotesI'd totally forgotten that FeedBurner now offers JSON renderings of RSS feeds. I should use this if I ever revamp to a new portal-of-me homepage.Unfurl
Notes"Note, we have an improved implementation of JSON stringify that builds up a string array instead of doing inline string concatenation. The version below should use less memory than the original JSON implementation."Unfurl
Notes"Hence, mixed content. Hence XML. If you need mixed content you really need it. If you don't need it, sometimes you cannot even conceptualise the problem it solves. And yes, mixed content totally complicates the lives of those who are using XML for data-cUnfurl
Notes"GET http://api.feedburner.com/format/1.0/JSONP for JSON wrapped with the near mystical callback function of your choosing - just begging you to apply your JavaScript wizardry to it."Unfurl
Notes"JSON is a better fit for Web services that power Web mashups and AJAX widgets due to the fact it gets around the cross domain limitations put in place by browsers that hamper XMLHttpRequest and that it is essentially serialized Javascript objects which mUnfurl
Notes"Please. As if <foo>bar</foo> has any more "semantic meaning" [1] than "foo": "bar". Symbols have meaning when some agent imparts meaning to them."Unfurl
Notes"Use XML - If you want to provide general-purpose data that the receiver might want to do unforeseen weird and crazy things with, ... or if the data is potentially long-lived (as in, more than seconds) XML is the way to go."FeedUnfurl
Notes"The answer is that JSON works because most people don’t really need all that overhead, and because it’s often possible to do really complex things with really simple formats."Unfurl