Was The Windows Registry a Good Idea?

I just want to make clear that regardless of my earlier comment, I’d like to drop the registry for many things as well, if anyone could come up with a half-decent way to overlay required settings on config files in a centrally-administrable manner. (In such a way that the apps know, so settings can’t just be changed back every time the app is opened.) I know for a fact that this is one of the issues holding back Firefox adoption in some businesses, having heard from other admins. But the open source community doesn’t see this as a need at all, and perhaps actively loathes central management. I’ve been hoping Novell or Red Hat would come through for a while, but not yet.

I like the idea of “only have write access to your own folder”, which vista’s and terminal server’s redirection partially gives you, except that it’s the user’s home folder

Really, the number of developers who think that the one true home for ini files is the program folder rather shocks me. I guess that happens when you’ve never touched a machine that someone else uses. Mozilla does an excellent job with registry, centralized, roaming, and local data; more developers could take a few tips from them instead of outright rejecting alternatives. (Aside from the fugly Mork files.) All it needs is a way to lock down without a custom plugin and it would be perfect.

My vote is for getting rid of the Registry.

Funny also that no one is mentioning the use of .Net app config files (whatever.exe.config) which are simply XML files with application settings in them, but in a standard format.

Does that mean no one is really doing .Not^H^Het development?

As an aside, XnView is one software that gives you complete choice - you can set it to save to the registry, an ini in the program folder, or in the user’s application data. A little bit of stuff always gets written to all three, but only a couple of small, unimportant files.

Portability and debugging are enormously easier when the software actually gives you the choice.

I hate the registry as much as the next guy but one positive that comes out of it is the ability for one application to check to see if another application is installed (what version etc…) Also as annoying as it may be the registry in many cases is a huge anti-piracy tool.

Sheesh said:

Don’t forget to implement proper locking logic to handle multiple users hitting the same ini file.

Under what usage scenario do you have multiple users changing the same setting at the same time (and thereby requiring locking)? And if it does, what the hell is wrong with standard file system locking?

You have a server, you have multiple users with personal settings and/or state to maintain - why should they “hit the same file”? Shouldn’t any sane application provide each user with their own settings file in the their own home directory?

Or do you really suggest that your preference for a bright yellow desktop should override mine (and all other users) preference for the standard sky blue?

Seriously, is there any situation where conflicting updates to settings file is a problem? Do you really have multiple administrators performing uncoordinated configuration changes on a single box at the same time?

Grow a brain and think it over.

I’ve already got one thanks.

Ryan, good point but that would also be possible if the registry was used for nothing more by applications than to write the location to their “ini” file.

As for those saying ini files are bad because they are scattered around… I’m not sure what your complaint is. Do you believe my jedi knight 2 key mappings really need to be saved in the same spot as my microsoft word settings?

Using the registry means that you’re updating global machine state to install your application. Sometimes this is exactly what you need, but more often it is nothing like what you need. Accessing global state has all kinds of unpleasant implications on user ability to have multiple versions of your app/library installed, it is a substantial downside that needs to be balanced by a corresponding upside to be worthwhile. Such upsides are very rare in practice.

I’ve written libraries that get used by dozens of in-house projects at once (analytics for banks), and the first key idea of such libraries is xcopy-type install, otherwise you are absolutely and completely hosed - how else can you have several versions running on a single machine, used by applications developed by competely independent teams? While the registry is a reasonable match in some cases, it is hopelessly overused in the Windows world.

A sensible default posture is to request uses of the registry to be positively justified, rather than taking it as a starting assumption.

I remember many many years ago, back in the days of Windows 3.1/3.11, Microsoft told developers to contain all of their application files in one directory. This was at a time when application INI files were starting to clutter the win.ini and the system.ini. The Microsoft fix was to have the application INI files located with the application and not in the OS INIs. Seems to me that would have worked

How appropriate. I post about the aggravating nature of the registry last night, today I get to “fix” a DVD-R drive that mysteriously fails to load with error code 39, by making this cryptic registry change:

http://forums.techguy.org/hardware/572840-dvd-burner-stopped-working-drivers.html

(see post #4 – remove “LowerFilters” from the “{4D36E965-E325-11CE-BFC1-08002BE10318}” key under HKLM\System\CurrentControlSet\Control\Class)

Works like a champ now. :stuck_out_tongue:

I don’t think I have ever agreed with anything you have ever posted more than this.

DOWN WITH THE REGISTRY!

I personally try to only use INI files and XML config files. Every once in awhile I must admit that I sin and store stuff for my applications in the registry.

Your article reminded me of this quote;-

Those who do not understand Unix are condemned to reinvent it, poorly.
– Henry Spencer

nuff said.

I think alot of the posters are missing the point: the registry is a tool like any other. It has both benefits and drawbacks.

Pros:

  • Database-like architecture means reads and particularly writes are fast
  • Standard API
  • Easy to share among various instances of a running program, run by the same user (yes it does happen sometimes, get used to it)
  • Theoretically harder to muck up at a low level than text-based files
  • Everything is in the one place

Cons:

  • Everything is in the one place
  • It is hard to split out the settings for an application. In comparison a gamer-level user can manage to extract file-based settings
  • Low level implementation not as fast or robust as it could be
  • Cannot use “xcopy” deployment
  • COM was built on top: COM is an even bigger problem
  • centralised packaging not common in windows: packaging is an even bigger problem
  • Contents are not self documenting
  • Contents are not externally documented (Try to accurately enumerate all the com ports in a windows system sheesh!)

-Andrew

Actually the problem is that MS has never written any useful tools for the registry. The null problem wouldn’t be a problem if we had a decent registry editor and useful command line utilities (possibly Powershell??) I won’t list the other commands that are missing, I leave those to your imagination.

But I can’t close this message without mentioning the almost complete lack of documentation, and what I think are implementation problems, mostly a lack of date stamping for entries but also the way the same information is stored in multiple places, and the decision to show, what is it, three generations of some registery information (current control set, and all it’s little brothers) in the program they call an editor.

It may not be all it should be, but if MS would get of its collective backside and provide the tools it could be very much better than it is.

Ever tried to make a single entry in an ini-file readonly for the user?
I wish you lots of fun…

Only with the registry you could administer hundreds of machines in an easy and consistent way.
Only with the registry there is a way to double-click a .reg-file and enter its content automatic into the registry.
and on an on and on.
Registry is like a database, ini-files are like chaos.

Jeff: “How appropriate. I post about the aggravating nature of the registry last night, today I get to “fix” a DVD-R drive that mysteriously fails to load with error code 39, by making this cryptic registry change:”

This is a problem with the device driver. Maybe part of the problem is that since everything is stored in the registry, people blame the registry for everything.

-Andrew

Thats awesome, Windows is becoming more like Unix with every release and I’m all for it. I do wish they’d adopt the same plist configuration format found in OSX, its XML based, very flexible and easy to work with.

Ini is kinda primitive when compared to plist, and Unix’s convention of having no convention here is a poor idea.

All in all a good move by Microsoft.

Saying the registry is “obsolete” is ridiculous. The article and some of the comments seem to imply the registry concept was OK in it’s time, but is now outdated. Rubbish. It was never OK. The registry never did ANYTHING but break software and occasionally kill your windows installation.

What are the advantages of a single place to store system settings? Is there a single one?

Don’t you think that .NET’s move to .config files proves your point without even making it? Hell, the .NET libraries for manipulating the registry aren’t even in the System namespace. They’re hidden away in the Microsoft namespace, where only desperate people and VB programmers go.

I think Microsoft wants the registry to go away as badly as you do. But as Michael Sinz once said, “Programming is like sex, one mistake and you have to support it for the rest of your life.”

The registry COULD have been a good idea… err… nvm.

What the registry should’ve been was a database tracking localized .ini files, which could be binary or plain-text files containing the same information. That way if you just delete the folder containing the application, the OS can’t find the file and assumes it’s gone, or asks to search for it.

The only thing missing from linux is a microsoft’s media center. Until I can figure out how to hook my xbox360 and my laptop/pc together so I can watch TV, use that neat sports thing, and download showtime movies… I don’t know if I can justify the switch. Gentoo is by far my favorite OS.