Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Don't EVER use the registry! Please

Don't EVER use the registry! Please

Scheduled Pinned Locked Moved C / C++ / MFC
questionwindows-admindiscussion
21 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W wogerdoger

    Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

    M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #7

    Isn't it the purpose of "Application Data" ( or "Local Settings\Application Data" under "Document and Settings" ) the new preferred place to place user settings ? Also, having only a part of the registry, HKEY_CURRENT_USER, writable should limit the damages.


    Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

    1 Reply Last reply
    0
    • W wogerdoger

      Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #8

      wogerdoger wrote: I can't see why any program settings can't be stored in a file within the directory that the app is installed to You mean like .INI files? The files that are easy for clueless users to go and mess up, thereby breaking the program and frustrating said user? MS moved program settings to the registry to prevent that sort of thing from happening. --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

      J 1 Reply Last reply
      0
      • J John M Drescher

        wogerdoger wrote: Why does Windows need a registry ? Windows needs a registry to store settings that are generally not changed often. Have you ever worked on Linux? Linux has thousands of configuration files stored all over the place which makes it a real pain to configure but this is buy design. Since companies can not sell the software but they can sell the support. They have to make it as hard to setup as you can get away with so there is a reason to use the very expensive support services. John

        Z Offline
        Z Offline
        ZoogieZork
        wrote on last edited by
        #9

        John M. Drescher wrote: Have you ever worked on Linux? Linux has thousands of configuration files stored all over the place which makes it a real pain to configure but this is buy design. Indeed, GNOME and GNOME-based apps under Unix now store application data in a central registry called gconf. Apps can "listen" to their gconf keys and be notified when the user (or another app, like a preferences applet) changes the value. Seems the GNOME people at least saw the advantages of a centralized, cacheable, uniform-format configuration system :) - Mike

        J 1 Reply Last reply
        0
        • Z ZoogieZork

          John M. Drescher wrote: Have you ever worked on Linux? Linux has thousands of configuration files stored all over the place which makes it a real pain to configure but this is buy design. Indeed, GNOME and GNOME-based apps under Unix now store application data in a central registry called gconf. Apps can "listen" to their gconf keys and be notified when the user (or another app, like a preferences applet) changes the value. Seems the GNOME people at least saw the advantages of a centralized, cacheable, uniform-format configuration system :) - Mike

          J Offline
          J Offline
          John M Drescher
          wrote on last edited by
          #10

          Thanks for the info. I did not know that about GNOME. John

          1 Reply Last reply
          0
          • W wogerdoger

            Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

            J Offline
            J Offline
            Joe Woodbury
            wrote on last edited by
            #11

            One other advantage of the registry not mentioned here is that it supports multiple users much more transparently. Even without that, I don't see the problem. Why should the registry be off limits to "some scumbag programmer" but not the file system? Hell, why even allow programmers access to the operating system at all? wogerdoger wrote: If I want my computer to behave differently: I'll tell it... Give me a f**king break. In your world every piece of software would come with a printed list of how to manually install it and a massive manual describing, in detail, every change the software would make to your system. Besides, let's assume that files were used as they were in Windows 3.x. Do you believe for a nanosecond that developers would never dare modify an INI file they didn't own? The Registry was invented precisely because of all the horrible problems with INI files. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

            1 Reply Last reply
            0
            • W wogerdoger

              Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

              T Offline
              T Offline
              Terry ONolley
              wrote on last edited by
              #12

              I think you are just having difficulty in using the registry API.


              Have you answered an MTQ? Check out the stats!


              J 1 Reply Last reply
              0
              • T Terry ONolley

                I think you are just having difficulty in using the registry API.


                Have you answered an MTQ? Check out the stats!


                J Offline
                J Offline
                Jason Henderson
                wrote on last edited by
                #13

                Yeah, it can be a royal pain if you have no clue like this guy.

                "We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld

                Jason Henderson
                blog

                J 1 Reply Last reply
                0
                • W wogerdoger

                  Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

                  A Offline
                  A Offline
                  Anonymous
                  wrote on last edited by
                  #14

                  My opinion pretty much matches what everyone else said. To your support, if INI files were used, it would be much easier to back up the settings for a single program. If it's in the same folder as the program, that's one less piece of the program scattered all over your hard drive. However, the registry is still a useful tool, because everything is in one place. I don't have to search all over my hard drive to figure out which file holds a certain program's settings. The registry also uses fewer files, so backing up all your programs' settings is easier. Also, two or more different software packages may need to use the same settings, so a central location is necessary.

                  1 Reply Last reply
                  0
                  • W wogerdoger

                    Hi All. Why does Windows need a registry ? (Or at least: Why does Windows let programmers stuff with it ?) I can't see why any program settings can't be stored in a file within the directory that the app is installed to. It can just load that file and read what it is supposed to do each time it runs. It amazes me that this practice is so common and even promoted (Even here on CP). If I want my computer to behave differently: I'll tell it...not some scumbag programmer who thinks they know better! Maybe there is a need for a "Read-Only" Windows registry for windows settings to be passed to the program. Anyone ? Discussion ? (Quite a rant, but it didn't belong in the Lounge). Cheers If sex is a pain in the ass, then you are doing it all wrong!

                    T Offline
                    T Offline
                    thowra
                    wrote on last edited by
                    #15

                    wogerdoger wrote: Why does Windows need a registry ? COM "The folly of man is that he dreams of what he can never achieve rather than dream of what he can." "If you think education is expensive, try ignorance."

                    W 1 Reply Last reply
                    0
                    • J John M Drescher

                      wogerdoger wrote: Why does Windows need a registry ? Windows needs a registry to store settings that are generally not changed often. Have you ever worked on Linux? Linux has thousands of configuration files stored all over the place which makes it a real pain to configure but this is buy design. Since companies can not sell the software but they can sell the support. They have to make it as hard to setup as you can get away with so there is a reason to use the very expensive support services. John

                      J Offline
                      J Offline
                      Jorgen Sigvardsson
                      wrote on last edited by
                      #16

                      The registry is also a single point of failure. :( -- The coolest game in the world: NHL Hockey[^]

                      1 Reply Last reply
                      0
                      • M Michael Dunn

                        wogerdoger wrote: I can't see why any program settings can't be stored in a file within the directory that the app is installed to You mean like .INI files? The files that are easy for clueless users to go and mess up, thereby breaking the program and frustrating said user? MS moved program settings to the registry to prevent that sort of thing from happening. --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

                        J Offline
                        J Offline
                        Jorgen Sigvardsson
                        wrote on last edited by
                        #17

                        Michael Dunn wrote: The files that are easy for clueless users to go and mess up, thereby breaking the program and frustrating said user? Lol! I think it would be more dangerous if a user ran regedit instead.. :~ -- The coolest game in the world: NHL Hockey[^]

                        M 1 Reply Last reply
                        0
                        • J Jason Henderson

                          Yeah, it can be a royal pain if you have no clue like this guy.

                          "We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld

                          Jason Henderson
                          blog

                          J Offline
                          J Offline
                          Jorgen Sigvardsson
                          wrote on last edited by
                          #18

                          You two are evil. I like it ;) -- The coolest game in the world: NHL Hockey[^]

                          1 Reply Last reply
                          0
                          • J Jorgen Sigvardsson

                            Michael Dunn wrote: The files that are easy for clueless users to go and mess up, thereby breaking the program and frustrating said user? Lol! I think it would be more dangerous if a user ran regedit instead.. :~ -- The coolest game in the world: NHL Hockey[^]

                            M Offline
                            M Offline
                            Michael Dunn
                            wrote on last edited by
                            #19

                            Jörgen Sigvardsson wrote: I think it would be more dangerous if a user ran regedit instead.. Yep, that's why you won't find a Registry Editor shortcut on the Start menu. ;) I can just imagine it now... <clueless-user> hmm, I'm running low on space. What can I do to get rid of some of my old programs? hmm... "Registry editor" Let me see what's there. *clickety* Aitch-kee-local-machine. Is that like my hard disk? Open it up... ah, "software" that must list the software I have on my hard disk. Open it... HOLY CRAP I have all this software installed? *deletes* There we go. </clueless-user> --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.   -- Michael P. Butler in the Lounge

                            J 1 Reply Last reply
                            0
                            • M Michael Dunn

                              Jörgen Sigvardsson wrote: I think it would be more dangerous if a user ran regedit instead.. Yep, that's why you won't find a Registry Editor shortcut on the Start menu. ;) I can just imagine it now... <clueless-user> hmm, I'm running low on space. What can I do to get rid of some of my old programs? hmm... "Registry editor" Let me see what's there. *clickety* Aitch-kee-local-machine. Is that like my hard disk? Open it up... ah, "software" that must list the software I have on my hard disk. Open it... HOLY CRAP I have all this software installed? *deletes* There we go. </clueless-user> --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.   -- Michael P. Butler in the Lounge

                              J Offline
                              J Offline
                              Jorgen Sigvardsson
                              wrote on last edited by
                              #20

                              And what about all them aitch-kee-classes? :a-million-voices-screaming-out-in-pain: -- The coolest game in the world: NHL Hockey[^]

                              1 Reply Last reply
                              0
                              • T thowra

                                wogerdoger wrote: Why does Windows need a registry ? COM "The folly of man is that he dreams of what he can never achieve rather than dream of what he can." "If you think education is expensive, try ignorance."

                                W Offline
                                W Offline
                                wogerdoger
                                wrote on last edited by
                                #21

                                Thought this might belong in the lounge! Thanks for the good points and info (esp. Hockey for the spell-check example and "polymorhpic executables". I guess it borders on self-modifying code). I have never used (As in personally edited) an .ini file and have never run Regedit or toyed with the Registry API (Though after reading up on it, It doesn't look that hard). I liked the comments about "the inexperienced" "playing" with ini files or worse, the registry. My point here is the application should provide the interface (i.e Tools | Options) to change the program's user settings. Anyone who goes into a (.ini) file and "changes stuff" should expect the program to behave in a not-so-qhkwbefnlkjqw manner. Hey I have Word…but IE doesn’t go looking for the “I have a Spell-checker” Key! Is it in the settings…? Cheers for the feedback. If sex is a pain in the ass, then your name must be Joe Woodbury or Jason Henderson!

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups