2 ms·
> Comparing that to the amount of typing I have to do to define a scheme From my use case of config files the code that is reading them knows the type anyways.
by kevincox 5y ago
> Comparing that to the amount of typing I have to do to define a scheme
From my use case of config files the code that is reading them knows the type anyways. So for a setup like Rust+serde there is no overhead to set this up.
> This problem would be caught immediately anyway if the config is read into static types.
That is true, but it still breaks you out of your flow. You get a confusing error, it probably doesn't tell you the exact line number and you need to look over your changes. If you changed a lot of places in the file it may be easy to miss that adding `no` to a list was the mistake. Because problems like that are easy to understand in retrospect, but if you keep reading "no" as "Norway" it is easy to look straight at this mistake and think it is fine before hunting elsewhere in the file.
I think you are right. It is still unclear if the cognitive overhead when writing the file is worth it, but from my point of view the upsides are much more valuable then you make them appear to be.