YAML really is the gift that keeps on giving.
This seems less like YAML and more just a bad implementation.
(Admittedly, the underlying problem with stuff like YAML and XML is that it's simple enough that people will try to roll their own instead of using a well-tested generator library.)
@mhoye
I doubt anyone is willing to do the work but there would be a lot of value in formalizing the safe subset of yaml (block syntax, json interoperability, multiline strings, comments) and gets rid of the weird bits (cross references, tags, "no", etc)
On the other hand "everything is a string unless it looks like a number, boolean or null" manages to be both great for usability and a great footgun and I don't know how to square that circle.
@mhoye This is absolutely reasonable behavior - if you want a literal value to be interpreted as a string, enclose it in quotes.
The weakness I see here is inconsistent automatic type identification built into the file format standard. The defense is precision of expression - explicitly state information you know. If you know a value is a string, put it in quotes.
One of my biggest frustrations in computing is not being able to explicitly specify what I know to avoid the language, compiler, etc. guessing wrong. If you know something's a string, an integer, a float, a boolean - specify that explicitly and don't make the computer do extra work and give it an opportunity to disappoint you by guessing wrong.
I know, this violates the rule of modern computing which is that any hack that lets you crap out more code faster is an unalloyed good. How much time was saved leaving off quotes compared to the cost of rediscovering scientific notation?
@arclight I think it's a significant missed opportunity that compilers generally can't or don't modify the text of the code they're working on. If you're going to infer some types at compile time, why put off finding out if you guessed right until you're in production? Why not just push that guess back into the text of the program instead?
@tetron I think that we as an industry need to start getting really explicit about what "usability" means, particularly in those cases where it clearly means "somewhat robust in the face of neglect and negligence."
@mhoye @tetron as I mentioned elsewhere YAML is like a mid century industrial machine. It does its job but it will take your arm off if you're not careful.
Someone decided that we needed a schemaless generic configuration format and we got exactly that.
The implementer in this case didn't check the incoming data.. They fixed the cause of the problem (the unquoted hash) but afaict they don't implement a data check to insure it doesn't happen again even if the workflow changes.