3 ms·
Depending what you are making, there is different formats that you can use, such as: YAML (which is a superset of JSON; however, it does not use the same commen
by zzo38computer 8y ago
Depending what you are making, there is different formats that you can use, such as: YAML (which is a superset of JSON; however, it does not use the same comment format as JavaScript), X resource manager format (I wrote two implementations, both of which are smaller than the one in Xlib, and can be used independently of Xlib), a C include file (but then you have to recompile the program to configure it, although it makes the program more efficient), INI (some programs use a simplified version without section headings), RDF, TOML, executable code (especially if the program is written in an interpreted programming language, such as JavaScript, or embeds one, such as perhaps SQL if it is a database program, although SQL seems isn't generally a very good configuration format), etc. What is best depends on what the configuration file is for, I think.
I haven't heard about JSON5 before now, and I don't know what is JSON5 (I read in here apparently JSON5 is JSON with comments; what format of comments (is it same as JavaScript), and does it accept trailing commas?). Also, XML is OK for markup, but it is often used for other stuff where other formats are often better (although maybe you have some case where the other options would be worse than XML for the configuration format).