views:

319

answers:

3

I am using C# (.Net 2.0) to develop windows application. I need to store nearly 50 to 60 user settings. Can anyone, please, tell which is better of the following?

Binary Serialization or Application Settings (user.config)

Thank you.

+2  A: 

It depends on your needs.

Binary is faster of course, and you can use it if you have a large amount of data, when

  1. you don't want it to be edited by hand or readable, and
  2. you are sure that it's binary representation won't change OR you can handle those changes.

User application settings if performance is not such a big concern and you want it to be human-readable.

Botz3000
+2  A: 

Do you want to be able to edit them easily, without writing your own interface? Then the application settings is the way to go.

But if you may be storing complex types, and there is no requirement to edit outside of the fashion you allow, then BinarySerialization would be preferable. You may need to elaborate a bit, but I think the Application Settings may be a fine approach.

Noon Silk
+3  A: 

App-settings is built in, works, and has IDE support.

Performance isn't really an issue for this small set of data; re binary, I would actively avoid BinaryFormatter in this case, since app-settings typically evolve between versions, and BinaryFormatter is very brittle when it comes to versioning. There are other ways to serialize data as binary, but in this case I'm not sure I'd bother...

Marc Gravell