This is a good analogy but the description is really one of a REST API. An API in general can take a form other than one or more endpoints. An API is a means of consuming a program that is not a GUI or CLI but that needs to be accessed through code. Basic front-end development is wrapping code that consumes an API in a GUI. There are dozens of Javascript APIs built into browsers for code that runs locally.
I usually start with saying that an Application User Interface describes how a user (i.e. person) uses the website to get information while an Application Programming Interface describes how another program get information from an application.
Looks very similar to YAML. I'm not sure this will replace JSON though, for one specific reason.
The more levels of nesting you have in the Tree Notation file, the more of the file's space is ... well white space characters. JSON doesn't have this problem, as spaces are not crucial to the structure of the data.
This means that although there's less characters, you cannot minify the Tree Notation, like you can with JSON (as indentation is crucial for representation in the tree)
> The more levels of nesting you have in the Tree Notation file, the more of the file's space is ... well white space characters. JSON doesn't have this problem, as spaces are not crucial to the structure of the data.
This is a good thought, and a theoretical problem I used to think about, but in practice it hasn't really come up. In practice what has happened, is that anytime things started getting deeply nested, it was a sign that the Tree Language should be refactored so things could be made flatter.
> This means that although there's less characters, you cannot minify the Tree Notation, like you can with JSON (as indentation is crucial for representation in the tree)
The other thing to keep in mind that JSON is almost always GZIPPED before it is actually sent over the wire, and the compression characteristics of zipping/minifying TN are as good (if not better--I hope someone some day will do the research here), than JSON.
With the same analogy, UI is probably the dog trainer who knows all the commands that the dog understands. You tell the trainer what you want the dog to do and trainer issues the right command.
https://developer.mozilla.org/en-US/docs/Web/API