The acronym JSON derives from the English language expression JavaScript Object Notation , which can be translated as JavaScript Object Notation . It is a lightweight text format that allows data to be exchanged.
JSON is based on a subset of JavaScript , an imperative, object-oriented, and interpreted programming language that was created by American Brendan Eich . In any case, it maintains independence with respect to this language.
Originally, JSON emerged as an alternative to XML ( eXtensible Markup Language ) , a meta-tag language. Due to its speed of reading and its smaller size, JSON achieved rapid acceptance.
For humans , reading and writing JSON are actions that are quite simple. Computers, meanwhile, have no difficulties in generating and interpreting it. That is why it is frequently used for data transmission in web applications.
This simplicity when reading JSON is also reflected in what it takes to write a parser for this format . Another name given to the parser is a syntactic analyzer , and it is a computer program that is developed with the objective of analyzing a string of symbols taking into account certain rules of a formal grammar.
In short, JSON is a data format that is based on text that respects the JavaScript object syntax. Despite its similarity to the object literal syntax of this language, it can be used independently of JavaScript .
A collection of name-value pairs and an ordered list of values are the structures that make up the format. In JSON , each object is an unordered set of name-value pairs. Names, meanwhile, are strings (sequences of zero or more Unicode characters), while values are strings, booleans, null values, numbers, objects, or arrays. These arrays, for their part, are ordered sequences of values or objects of any type, which are enclosed in square brackets and separated with commas.
A null value is used to indicate, for example, that a variable has not been initialized. It is not the same as "zero" itself, as if we were to say that "there are zero apples on the table", but rather that "the apple object does not exist, it has not been initialized and the computer cannot process it because it does not know it." ». Booleans are used to represent two values: true and false.
Since other alternatives, such as XML, are not always at a disadvantage compared to JSON, in many cases there is a balance between the differences between the two. One of the issues that worries many developers is the security of data manipulation with JSON, and that is why its most common use occurs in environments with a large flow of data between both ends (the client and the server), and where The source of said data is reliable, in addition to not requiring processing or transformation on the client's equipment.
Among the companies that use JSON we have Google, Mozilla and Yahoo!, three industry giants that manipulate an incalculable amount of data per day to meet the needs of their millions of customers. Some consider JSON an option for those who do not want or cannot use XML; However, cases in which both are combined in the same application are common.
Regarding the pronunciation of the name JSON, in English it tends to be read as the name Jason , although its creator, Douglas Crockford , assures that the stressed syllable should be the second ("son"). In Spanish there are two tendencies: /yeison/, which is how we pronounce the name Jason , or /jotasón/, reading the name with the letter J and then the syllable "son" normally.