Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-platform configuration, options, settings, preferences, defaults

I'm interested in peoples' views on how best to store preferences and default settings in cross-platform applications.

I primarily work in node.js and Perl on *nix and Windows but I'm also interested in the bigger picture.

In the *nix world "dotfiles" (and directories) are very common with system-wide or application default settings generally residing in one path and user-specific settings in the home directory. Such files and dirs begin with a dot "." and are hidden by default from directory listings.

Windows has the registry which also has paths for defaults and per-user overrides.

Certain cross-platform apps do it their own way, Firefox uses JavaScript preference files.

Should a cross-platform app use one system across platforms or say dotfiles on *nix and registry on Windows? Does your favourite programming language have a library or module for accessing them in a standard way? Is there an emerging best practice or does everybody roll their own?

like image 987
hippietrail Avatar asked Dec 20 '10 09:12

hippietrail


1 Answers

What about storing in DB? It is cluster-friendly and has been working great for us. In my last job we used to store them in a directory server.

Java has support in the form of Preferences API.

I am not a .Net guy but I think they have User Profiles.

Python specific discussion: What's the official way of storing settings for python programs?

Ruby on Rails: Rails: Best practice to store user settings?

like image 103
Aravind Yarram Avatar answered Sep 23 '22 11:09

Aravind Yarram