Hello to all,
My 1st post, I was able to reset my password...
Sorry for my English, I use DeepL.
I have a structured list to save or load with parents and childs.
I have not practiced either xml or json formats.
Apart from json which seems to me easier to read.
What are the cons and/or pros you see of either format and in which case choose one over the other ?
Pros and cons JSON vs XML
Re: Pros and cons JSON vs XML
Json is lighter on resources, but has a few more limitations. For most applications with general requirements, if either can do it, json is preferred. This article goes a little deeper into the differences:Boulcat wrote: ↑Sun Apr 18, 2021 12:28 pm Hello to all,
My 1st post, I was able to reset my password...
Sorry for my English, I use DeepL.
I have a structured list to save or load with parents and childs.
I have not practiced either xml or json formats.
Apart from json which seems to me easier to read.
What are the cons and/or pros you see of either format and in which case choose one over the other ?
https://hackr.io/blog/json-vs-xml
Re: Pros and cons JSON vs XML
Thank you for your answer and for the link
After reading and in my case here, Json seems to be better.
For the future and to have a more global view with the dev side, let me know the limits, constraints that you have encountered
I saw this thread "Save JSON data with object members well-arranged" viewtopic.php?f=12&t=69100
I do not know if it is always current and if I should use it, my list is already sorted.
But I'm not sure how to use it with a list, It would be nice if someone could write me a small example with a structured list, as a starting point for me
Thanks
After reading and in my case here, Json seems to be better.
For the future and to have a more global view with the dev side, let me know the limits, constraints that you have encountered
I saw this thread "Save JSON data with object members well-arranged" viewtopic.php?f=12&t=69100
I do not know if it is always current and if I should use it, my list is already sorted.
But I'm not sure how to use it with a list, It would be nice if someone could write me a small example with a structured list, as a starting point for me
Thanks
Re: Pros and cons JSON vs XML
Why choose either xml or json over a sqlite database file?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Pros and cons JSON vs XML
I'm preferring XML choosing between those 2. But don't see much difference and can use both, just I like XML syntax more than JSON.
Depends on purposes, of course.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Re: Pros and cons JSON vs XML
I also prefer the XML format and use it to store programme and project data.
When these are in a structure, it is very very very simple.
Example Link: https://www.purebasic.fr/english/viewto ... 12&t=74233
When these are in a structure, it is very very very simple.
Example Link: https://www.purebasic.fr/english/viewto ... 12&t=74233
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Pros and cons JSON vs XML
JSON format is good if you have a lot of small data.
XML format is good if you have a lot of data in each field (example: blocks of text).
An XML file can be edited easily with a text editor without the risk of destroying the structure by clumsy punctuation.
We can add:
If one then wants to do sorting and filtering easily, and the volume of data increases; SQLite is ideal.
If the data are just pairs, then the INI format (prefs) is the easiest.
XML format is good if you have a lot of data in each field (example: blocks of text).
An XML file can be edited easily with a text editor without the risk of destroying the structure by clumsy punctuation.
We can add:
If one then wants to do sorting and filtering easily, and the volume of data increases; SQLite is ideal.
If the data are just pairs, then the INI format (prefs) is the easiest.
-
- Enthusiast
- Posts: 429
- Joined: Sun Apr 06, 2008 12:54 pm
- Location: Brisbane, Qld, Australia
- Contact:
Re: Pros and cons JSON vs XML
I use XML and find it easy to work with and edit.
Re: Pros and cons JSON vs XML
just use binary storage, you'll sleep better at night even if you can't read it better during the day