Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Comment Re:Extensible? (Score 1) 838

There's nothing wrong with your scheme if it works for you. The problem is there's like a zillion different developers who all have there own scheme for preference files, and some times it can be quite confusing to a user trying to figure out what changes can be made to the config file. At least xml will look familiar.

My personal favorite way to do simple preference files is to have a Preference class with nothing but public properties, where each property is a preference like Rect LastMainWinPos. all the properties are assigned reasonable defaults. When I want to save the preferences I just serialize the prefs instance to xml and save it to a file. The next time the program runs it reads in the xml file and constructs a prefs object. I use this in C# and it's a really easy way to save prefs.

Xml is not super fast, but it's not like I'm doing this in a tight loop, so speed is acceptable.

Slashdot Top Deals

Per buck you get more computing action with the small computer. -- R.W. Hamming

Working...