As I look into YAF.Classes.Config class, I found that each of Property will search through the AppSettings collection and get the value from it. I think there is 2 points would be slow:
- Unnecessary look up
- Retrieve value from config file again and again
Whether it'd better if we cache them in separate static variable?
public static string BoardID
boardID = GetConfigValueAsString("YAF.BoardID") ?? "1";
public static bool DisableJQuery
disableJQuery = GetConfigValueAsBool("YAF.DisableJQuery", false);
There is always "better" code... but instead of your solution I'd offer a complete abstraction of the configuration system that provided a caching system.