Re:Cue Wins
by numbsafari on Friday January 13, 2023 @11:25AM
(#34370005)
You’d think, as an industry, we’d have learned that parsing an introspecting config files shouldn’t have side effects.
[ Parent
| on HN ]
Re:Cue Wins
by HelloNurse on Friday January 13, 2023 @01:03PM
(#34371450)
It's the eternal opposition between taking shortcuts and doing things the easy, cool and dangerous way vs. planning and optimizing and doing things the boring, slow and cautious way.
In the specific case of configuration files, the danger is easy to underestimate because configurations are often considered a minor, easy,low value part of an application.
I think you may be overestimating how universal the lessons are.
For more complicated configs, a common approach I see is that the “config file” is a program that generates the actual configuration data. If you just need to parse and introspect the config data, you fetch the build output and parse that, which does not have side effects.