Hacker News new | ask | show | jobs
by MoreQARespect 1003 days ago
It's not type safe.
2 comments

> It's not type safe.

I fail to see what leads you to believe this is a relevant point when discussing INI files as the alternative to YAML.

Yaml coerces values (the string "on" is coerced to bool true for example), with ini you do any conversion from strings yourself
> with ini you do any conversion from strings yourself

INI isn't specified, thus you cannot claim that the INI format does something a certain way.

The best shot at a specified INI file format might be TOML, and even that format is subjected to the same type of criticism.

So is JSON, and all mainstream config formats actually. However, that stopped being a problem with JSON schema, which, despite the name, works on yaml too.
>> It's not type safe.

> So is JSON

Blink. I beg your pardon, JSON is strongly typed per RFC 8259 standard:

> JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays).

The type system does not align well with any other type system out there (float/int ambiguity, no timestamps, etc.) but it's still better than any coercion.