4 ms·
JSON is machine readable first; and human readable for convenience. Its primary purpose is for machine to machine communication, but it does allow human interve
by rusk 2y ago
JSON is machine readable first; and human readable for convenience. Its primary purpose is for machine to machine communication, but it does allow human intervention. People have used that as a signal to start using it for configuration files but that is an anti pattern in my opinion.
If you want something like JSON that is designed for humans take a look at YAML
- orphea 2y agoI will pick JSON over YAML every single time. Not because JSON is so good, it's just YAML is so much more cancerous.
- yas_hmaheshwari 2y agoCan you explain why is Yaml cancerous (Genuine question) I have always preferred (even without thinking) to use configuration files as Yaml and kept Json for interprocess communication
- orphea 2y agoMany people explained it better than I ever could, so let me defer to them. TL;DR: YAML is an overcomplicated spec with too many footguns. - https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr... - https://www.arp242.net/yaml-config.html https://www.arp242.net/yaml-config.html - https://noyaml.com/ https://noyaml.com/ (couldn't not mention this famous piece)
- rusk 2y ago“I don’t want to learn how to use it properly therefore it’s like [bad thing I clearly have no experience of]” JSON is not fit for purpose as a configuration format. Use YAML or don’t, use properties if you like. JSON is first and foremost for m2m- it’s even in the name “Object Notation”
- deleted 2y ago[deleted]