Was The Windows Registry a Good Idea?

I think the registry is better left for more complex application that require resources as such. I have an rather simple application that has been out for a while and I use the registry settings to store a few formatting options, like window size, what tabs were selected, etc. to give a more consistent user interface when the user comes back in.

So following the “standard” I put these settings in the registry. However, I started running into some problems during the beta cycle where people were closing a tab and the UI wasn’t catching it, so their tab was “lost forever” since the app saved it’s state to the registry upon closing. Trying to help people navigate through that is nasty.

I cleaned up the code and the registry settings remained into the production, and I made sure the installer removed the registry keys as well. However, now that I’m working on a 2.0 release, the thought occurred that my program is so lightweight that it would function quite nicely on a USB key and given the nature of the program (deck building program for a TCG), it would be perfect for a kid to bring their USB key with the app over to their buddies house, fire it up, and work on things from there. But with it looking/writing to the registry, this becomes an issue.

So my 2.0 release is going to leverage the app.config file to read/write most of these things. None of my settings can do nasty hacks, other than hide/show some tabs and make the window tiny and the advantages I get from it are great. Plus I like how most of your middle/light apps functioned in the old days, you put the EXE on a disk and ran it, no need to wait for things or pull in resources, you just ran it.

I don’t know what UNIX convention you’re talking about… AIX was built with a registry. And officially, you only use SMIT to deal with it.

How do you handle DLLs? Put a copy of every DLL that your app links with in the app directory? How about the DLLs that they link to? Oh, you want to have a common place to keep system DLLs so they don’t have to be in every app dir? What do you do about apps that need different version of a system DLL? (It’s called DLL Hell).

–Point: How about letting the admin user decide? A properly written dynamically linked application doesn’t -care- whether the DLLs it uses are in the application folder or elswhere in the path. So let the -user- make the choice.

–Oh, and BTW, what’s a “System DLL”? I have never seen an app break because it needed a different version of Kernel32, User32, etc. Only because Microsoft arbitrarily decided that MFC42.DLL, COMMCTL32, half of Internet Explorer and Media player are “System” DLLs do we have most of these DLL issues.

How about newer apps that communicate with other apps (photoshop and a scanner control app)? How about all of those COM interfaces that let apps bind at run-time? How do I find RPC functions in a common place?

–Same way they always have. Look in the system configuration files and environment space. MS doesn’t have a lock on scanners and inter application communication, and they didn’t invent RPC.

I think that if you go back and substitute a substantitive app, perhaps even a browser like FF, you either have a huge app directory filled with everything needed to implement modern componentized applications, or you have something like the registry that can be located by any app and queried for the location of common shared copies of things.

–Point: actually, any number of “substantive” apps, including Firefox, Thunderbird, OpenOffice, MySql, Apache, the GIMP, and hundreds of others DO NOT REQUIRE INSTALLATION…at all. They come with installers, which allow you to perform optional tasks, such as select components and register file extensions, etc. But they work
just fine being copied rather than installed. Check out PortableApps.com; this lets you carry several “substantive” apps around on a 2 GB thumbdrive, with room for over 1 GB of data. (Yes, I know the default uses an install; my point is that it’s not impossible to make copy-only apps; it just requires you to try)

Do you really want to download 100 or 200 mb install packages that have all this stuff in them? As bad as the registry is, the world of .rc (er, .ini) files is as archaic as the isolated apps that used them.

–That’s also unnecessary. If a shared component exists, use it; if not, disable the function that uses it. And, in fact, MS is shipping larger, not smaller packages.

–I favor something the Open Source community is doing: multiple download links, on the order of “If you already have Gtk/Java 1.4 installed, you can download this. If you don’t, download this, which includes everything.” Simple, direct…all it requires is treating the user like a reasonably intelligent person, not a feebleminded click-monkey.

Myself, I kinda like being able to drag-n-drop things in the GUI, mash up some COM components into a new app without rewriting everything from scratch, and have my Java call C++ functions from a DLL that is common to some functional domain.

Does anyone not use these kind of apps? If not, other than writing bash scripts or perl, how do you create extensible, versatile tools to solve your problems?

–Point: Libraries, static and dynamic,a dn decent tools; that’s it. Check out some of the non-MS things out there. RubyGems, Gtk, a lot of C libraries and a whole slew of reusable components. MS didn’t invent code reuse, and they haven’t perfected it.

Paul Thurrott wrote: “As for whether the Registry was a “good idea,” yes, actually it was. The alternative was a proliferation of INI files, which was a horrible idea, even then.”

Actually, proliferation of ini files was only an alternative. The choices were not limited to ini files or Registry.

I think the main problem was the 80s-vintage concept of disk usage and user file management: one user, one machine, little or no structure beyond the Windows directory (or the System Folder on Mac OS pre-X)

If the only thing you, as an app developer, can depend will be on the customer’s disk are C:, the Windows directory and the application’s folder (if there is one) then it’s natural for ini files to start piling up in c: and c:\windows.

When you add more structure to the filesystem, and have user accounts (even on single-user machines), and home directories, then there start to be places to put preferences that make more intuitive sense, and keep user preference information from corrupting or clogging up system information.

So, lacking the structure in the filesystem, it was provided in the Registry (in addition to using the Registry as the central switchboard for system RPC, a rather different function).

Microsoft programs suck in some parts, but so does many other programs too. Here is an example: In VB6 if I search text, then after the search has looped every findings, it disables the next-button (though this does not happen in every case, I don’t know in which ones). But what if I want to loop the findings again? I have to close the search dialog and open it again. Sucks.

Example 2. Scrolling with mouse wheel does not work in VB6 code window. Sucks.

Example 3. If I change the letter capitalization of a variable in VB6, it changes every reference to it in the code. But what if I just made a mistake? When I try to commit the code to version control, I notice the mistake and have to go back to the code and fix it. Sucks.

Example 4. In Outlook email program when I try to paste, it pastes also the style of the text. What do they think? That I want to send mails that look like christmas trees? If I copy text from SQL Server Management Console, its usually green and different font if it was inside comments. I just wanted to append bits of information into my mail, but now I have to select paste special first. But paste special was this time disabled in the edit-menu. Sucks.

Example 5. If I borrow net cable for my coworker or otherwise disconnect from the net, then Windows Resource Management still tries to connect into my mapped drives for other machines. Why? Windows waits a minute or so if it can’t get into the drives. But if I unplug the cable, then it should not even try to reconnect, because there is no cable in the first place. I know that Windows knows that the cable is unplugged because a yellow tooltip appears and says ‘by the way, the net connection is not available’. Sucks.

Example 6. It is really annoying that tooltips pop up everywhere and instantly covering up areas of screen that I am trying to look at. This can be seen for example in Visual Studios. Many times the tips are not even necessary. Why it has to be so f*ing hard to set delays and on/off-settings for tooltips? Sucks.

Why put ini-data into the registry, if they are in ini-files in the first place? If I want to change a setting, I have to change it in the ini-file anyway, if I want to eg. version control the ini-files or something. Sucks.

Amen. The registry is a hierarchical database. So is the file system. If you need app/user specific settings, build a heirarchy of folders and files under the working directory of your exe. System settings could be under WINDOWS or whatever. Just as long as you can XCOPY the whole app somewhere else without having to deal with the registry would be great. My suspicsion (I’ve never investigated this) is that one reason the registry was invented was to overcome slow disk IO back in '95. The reg is just a file on the file system which makes reading settings quicker.

Again I say Amen. No registry would make Windows a much leaner OS.

The worst thing about the use of the registry is that it means that you cannot move an application easily from one system to another (which I believe is Microft’s main reason for keeping it).

I only use the registry for file associatons if they are necessary. All other state information I normally keep in ini files.

The Registry is exacly the ‘solution’ I would expect from microsoft.

Learn Unix and you will not need to ask why it is a bad idea.

But if you learn unix you will no longer consider MS a software vendor.

I am encouraged to see that I am not alone thinking the same way!

I have been into computing for over three decades now and things have been seriously going downhill for the past 15, and I am now at the end of my string as far as patience with Microsoft and modern operating system paradigms and programming principles are concerned.

I mean, come on, whose bright idea was it to make it more difficult for users to maintain their own computers? Copyright reasons and the power of greed? or the elitism of a class of people who are intent to keep the control they gained away from users for reasons of control and power, based on the very basic but mistaken concept that people are basically stupid?

Frankly, I simply can’t find any logic to this argument and the basic paradigms it promotes. And I say that from the perspective of someone who has been using computers since the days of punched card systems when getting something done meant using logic and the power of electricity as leverage to accomplish much more mental work than a single human could accomplish.

So to me, the whole concept behind the registry is purely based on the politics of power and control and nothing else.

Just look back 15 years ago and how clean and clear everything was under Windows 3.11, who itself was a pretty much half baked operating system because of the constraints of technology imposed by the DOS model and its original memory addressing specifications. If only they had kept its clear principles and expanded them to profit from the advances in technology (can you say “Instant ON”, anyone?)! No, instead, architects and developers in their paranoia decided it was much better to install a supplementary layer of obfuscation and frustration to specifically prevent users from taking their responsibilities for their own actions and take charge of their own life. Here lies the root cause of the problem: the flawed concept that this is all done for the ‘user’s own good’ (the modern buzzword is ‘security’).

Great idea, and so was fascism and communism. Funny how software design so well reflect the trends in society, wouldn’t you think? Billions of people’s rights trampled for reasons of ‘security’ on the pretext of the action of a few dozens causing a few thousand victims… That doesn’t seem right, doesn’t it? I thought so!

Enough said! I’m going back to Windows 3.1… Maybe my old mother had it right all along… Using that old 486 for all her work, and the fancy new one just for emails and going online :wink:

Every so often I look at my program’s ini files and think the registry would be so much better.
Then I read this again and remember why I avoided it like the plague!

I am convinced that the registry was absolutely brilliant for its’ time.

I come to realize this after a summer studying the power of JSON and evaluatable-javascript-object-files.

Essentially, if you throw out all the INI garbage, and replace it with JSON, it would actually be a rather clever structure for the hack that it was in the first place.

Think of any website you make. If you have to manage data, your simplest option is to store text files. The next best thing to storing text files is storing ini files because there is actually a system for reading and writing to it, and you don’t have to invent a new one for reading text.

They didn’t have xml at the time registry was created so they did not jump to that, and xml is not quite what they wanted, especially since all the emphasis on “structure” and “doctypes” which are not actually needed in xml but make it seem difficult to switch to.

JSON in contrast is perfect replacement for inis. and many websites and programs use JSON to store settings rather than mysql or some blackbox database system.

Basically, It was the best option for doing what they wanted to do at the time without inventing anything new.