Re:A love letter to the CSV format
by HelloNurse on Thursday March 27, 2025 @04:54AM
(#43491571)
Say "no" to YAML. As a string, if you can.
You can. YAML 1.2 is only 16 years old. Just old enough to drive. Norway problem has been solved for only 16 years.
Re:A love letter to the CSV format
by HelloNurse on Thursday March 27, 2025 @06:34AM
(#43492106)
YAML 1.2 leaves data types ambiguous, merely making the "Norway problem" optional and at the mercy of the application rather than, in the words of https://yaml.org/type/ (which has not been marked as deprecated), "strongly recommended".
Those schemas aren't part of the core schema, and you may interpret them if you are aiming for full 1.1 compatibility. If you're aiming for 1.1 compatibility, then you accept the Norway problem.
I've been looking in the specs and I can't find the link to the https://yaml.org/type/
I agree that one could make wild YAML if you get into advanced stuff, but I make YAML files that look like this:
things:
- title: "A thing"
item_id: "deadbeef-feb1-4e8c-b61c-dd9a7a9fffff"
is_active: true
favorite_formats:
- yml
- ini
- title: "Another thing"
item_id: "deadbeef-feb1-3333-4444-dd9a7a9fffff"
is_active: false
favorite_formats:
- mp3
- wav
Just because you can use it to create a monstrosity doesn't prevent it from being useful for simple configuration. Basically, it's just prettier JSON.
YAML simple? It's sepc is larger than XML... Parsing of numbers and strings is ambiguous, leading zeros are not strings but octal (implicit conversion...). List as keys? Oh ffs, and you said readable. And do not get me started about "Yes" being a boolean, reminds me of the MS Access localizations which had other decimal values for true and [local variant of true] (1 vs -1).
Writable? Even worse. I think I have never been able to write a YAML file without errors. But that might just be me, XML is fine though while unreadable.