gman
07/23/2020, 5:08 AMconfig = JSON.parse(readAsText('configfile'))
print(config.setting1);
print(config.setting2);
Looks great and it works. But then at some point you need to print an error message if the config file is wrong. First thing. the JSON/Yaml/XML is wrong and the message the library prints is cryptic. For JSON in JavaScript the message would be like "unexpected } at character 2647"
That's entirely not useful for the end user (let's skip the part whether or not JSON is useful for the end user for now). So you go end up having to find a parser that will give a line number at least 'error on line 537'
You also maybe add a schema or something to check the structure of the file is correct. It will tell you there is no 'foobaz' setting or that 'size' must be a number not a string but in general that stuff happens after parsing so if you'll get an error "size must be a number not a string" when the error you want is "size at line 537 is an error not a string". Now your schema checker either needs to do it's own parsing making it vastly more complex than it was OR your schema checker needs to ingest a much more complex format of data than just the parsed data where every piece of data is annotated from where it came from.
You might argue such configuration should have a UI where you can't make those mistakes but that's just part of same problem. What started as a effectively 1 line of code is suddenly 1000s of lines of code.
I feel like this pattern repeats itself in many other ways.
Maybe this is like the text editor example where someone rants that a text editor can function in a few hundred lines of code but then someone else points out that it's not a few hundred lines of code when you have to support CJK, Thai, Arabic, and emojiNick Smith
07/23/2020, 8:25 AMgman
07/23/2020, 10:04 AMwtaysom
07/23/2020, 10:29 AMwolkenmachine
07/23/2020, 11:13 AMRay Imber
07/23/2020, 7:32 PMChris Maughan
07/24/2020, 7:57 AM