3 ms·
YAML is far to helpful to convert bare strings to what it thinks is right (like 1.20 to 1.2 or no to false). It could be helped by having data validation, but t
by SahAssar 3y ago
YAML is far to helpful to convert bare strings to what it thinks is right (like 1.20 to 1.2 or no to false). It could be helped by having data validation, but the fundamental issue is that YAML does not make it clear to either human or machine what is meant or expressed.
The issue is not isolated to JS either, the same could have happened in python, php, or any other untyped language.
- dragonwriter 3y ago> YAML is far to helpful to convert bare strings to what it thinks is right (like 1.20 to 1.2 or no to false Versions of the YAML standard from the last 14 years don't do the later, and supporting numbers as a basic data type is, honestly, a weird thing to harp on as “too far”. > The issue is not isolated to JS either, the same could have happened in python, php, or any other untyped language. Indexing an associative array of runtimes that is keyed by a string, or doing almost anything else that expects a string, when you get a number instead, will fail with an error in most dynamically typed languages including Python and PHP; much fewer string-expcting operating operations (and particularly not object indexing) will fail in JS with a number.