At my company we have multiple C# programs that use Dictionaries in a config class to keep track of the configuration and state of the program.
bool isFoo = config.GetBool("Foo");
This seems clunky to me for a number of reasons. For one, there is no easy way of knowing what is in the Dictionary at any given time. (Is "Foo" a valid key? Has it been set yet? Is it spelled correctly? Is it a bool?)
These programs are not OO. The coding style seems to be more like procedural(?). In general there are many (on the order of 100) keys, and 2 to 3 Dictionaries holding different data types.
Is there any reason not to just make these properties? E.g.
isFoo = config.Foo;
Is there any way to improve this code without rewriting it completely?