ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Why the Windows Registry Exists

<< < (4/4)

If the registry was only used for OS matters, wouldn't it fulfill its purpose better ? But what is that "windows" OS exactly... Like tinjaw said :

I think the whole crux of the issue is that Windows is *not* just an operating system (ie a kernel and basic services) but is basically a whole suite of middleware on top of and operating system. As such, it needs to do much much more, and thereby causes the need for all of the stuff that cause problems.-tinjaw (November 26, 2007, 02:05 PM)
--- End quote ---

Ralf Maximus:
If the registry was only used for OS matters, wouldn't it fulfill its purpose better ? But what is that "windows" OS exactly... Like tinjaw said
-Armando (November 26, 2007, 02:57 PM)
--- End quote ---

Ooh, that's it.  Perfect.  Let Windows use the registry for infrastructury things and leave everyone else alone. 

In fact, it would've been better if the registery were designated an "unsupported" component, to discourage external meddling.

How does Linux or OS X handle configuration stuff?
--- End quote ---

OS X has something called .plists - they reside in:

/System/Library/Preferences/ - core OS, no playing there José!
/Library/Preferences/ - prefs for all users
~/Library/Preferences/ - prefs for particular user

plists are XML, and can be encoded as a binary format for faster execution if needed. They use a simple namespace mechanism for naming to avoid collisions (e.g. for Apple's dock preferences). By dragging your user preferences directory around, you can easily migrate your settings (it worked amazingly well on my upgrade to Leopard). The OS provides users with a way to query and edit plists via the commandline or applescript:

defaults write mouse-over-hilte-stack -boolean YES

There is also a GUI editor which represents them as a DOM. Nothing OS critical is stored in the user accesible plists. You can nuke prefs directories and everything will work fine from internally stored defaults IIUC. Cross-platform apps like Firefox and Opera store prefs in subdirectories, and they use whatever formats they want (Opera still uses its custom INI format on OS X for example).

Registry = Fear and Loathing in HKEY_LOCAL_MACHINE...

The registry is actually a pretty nice thing, pretty efficient (binary search), and imposes a nice structure (instead of the fugly /etc/* files each more or less with their own syntax), and pretty safe (journalled access).

Ths problem, as always, is really the legacy of Win9x and people used to running with admin privileges, meaning that applications are accessing locations they shouldn't. And people (including Microsoft themselves) storing information that shouldn't be stored.

NT uses "hive files" for branches of the registry, so you can already backup per-user registry settings. Problem is that the "Documents and Settings" folder structure has a horrible layout, and the files aren't as obvious to get at as they could be. A hive file per application could be a pretty interesting idea, with the addition of an application being able to use either the default hive or specify it's own custom location - this should already be possible, really, but requires some API calls that most developers aren't familiar with.

But because the world looks like it does, I personally do prefer .xml files and the ability to store either per-user in %APPDATA% or (portable mode) the application folder, even though the registry is technically superior.


[0] Message Index

[*] Previous page

Go to full version