What is JSON?


What is JSON?

If you have started developing a project in any programming language, sooner or later you will see that everything comes back to JSON. This is especially true for websites, but we also see it quite a bit in applications. So, what is this JSON?

JSON stands for "JavaScript Object Notation" and in Turkish, it is translated as "JavaScript Nesne Gösterimi". It is a structure that allows us to access data very easily.
According to Json.org, it is referred to as a lightweight data-interchange format.

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

What is JSON Used For?

Actually, JSON’s structure varies according to its usage area and we can say it is used for many things.
In single-player games, it is used to store user data (offline games), and it is used in many areas such as data sharing with the API system in large Internet sites.

JSON Data Types

JSON consists of 5 data types, which are;

  • Number
  • String
  • Array: It is used in the form "name":[…].
  • Boolean: true|false
  • Object: It is used in the form "name":{..}.
  • Null

  • Why JSON? 

    Using JSON is quite simple and it is very easy to access data. Although it was initially created for JS, it has been adopted by all languages, and therefore, it can now be used in all languages, and the fact that it is very simple in all of them is a very valid reason for us to use JSON in our projects.
    The opening speed of data is also quite fast compared to a few other methods.
    In addition, because JSON resembles a programming language, it is easy for developers to edit and generate it without the need for any additional programs.


    Sample JSON Code

    {
        "glossary": {
            "title": "example glossary",
      "GlossDiv": {
                "title": "S",
       "GlossList": {
                    "GlossEntry": {
                        "ID": "SGML",
         "SortAs": "SGML",
         "GlossTerm": "Standard Generalized Markup Language",
         "Acronym": "SGML",
         "Abbrev": "ISO 8879:1986",
         "GlossDef": {
                            "para": "A meta-markup language, used to create markup languages such as DocBook.",
          "GlossSeeAlso": ["GML", "XML"]
                        },
         "GlossSee": "markup"
                    }
                }
            }
        }
    }