+ 5
Can someone tell me practical reasons why i should use JSON?
8 odpowiedzi
+ 10
JSON along with XML are the most popular and frequently used standards of formatting datasets, translatable to any modern programming language. Both are easily comprehensible, platform- and OS-independent and capable.
+ 10
It's often used when data to sent from a server to a web page. JSON syntax is derived from JavaScript is a format for storing and transporting data.
+ 9
If you develop a web services chances are that you prefer to use json to encode the output. Today is practically a standard.
If you use a nosql database, like mongodb, you can use json by the same reason
+ 6
JSON is easy to learn because the main part is:
"attribute":"value"
and its very usefull
+ 4
Due to the syntax XML is much larger then JSON.
This is why JSON is the preference in web data transfer.
Programming languages can recognise JSON data types easily.
+ 3
Database can be store in Json format. Rest Api transport data also in Json format too.
Javscript objects are closely similar to JSON format.
Example of a dataset in JSON data:
{
"students": [
{
"id": "1",
"name": "Hiro Otawa",
"age": "27"
},
{
"id": "2",
"name": "Y.T"',
"age": "16"
}
]
}
Which can be converted into Javascript object using data = JSON.parse(json)
data = {
students: [
{
id: 1,
name: 'Hiro Otawa',
age: 27
},
{
id: 2,
name: 'Y.T.',
age: 16
}
]
}
In turn, Javascript can convert its objects to dataset in JSON for database or data transportation using json = JSON.stringify(data); function
https://code.sololearn.com/WczSx1thlDD6/?ref=app
+ 3
If we want to serialize a table into JSON and XML, assuming equal number of records, which format in your opinion would be larger (in bytes) between the two?. And which of them supports field definition & description (data type, length etc.)?.
+ 1
I use json for a config file for my open source discord bot