Programming Sins Regarding the Registry (Using the Example of Microsoft Excel)

While browsing through the registry I found the following “gem”. It illustrates nicely how programmers are not supposed to store settings in the registry:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Nach Microsoft E&xcel exportieren]
@="res://C:\\PROGRA~2\\MICROS~1\\Office12\\EXCEL.EXE/3000"
"Contexts"=dword:00000001

What is wrong with this? Several things:

  • Localization: Never localize keys or values in the registry (the same applies to configuration files, of course).
  • Spelling: Do not misspell the name of your product.
  • Short paths: Never use short paths.
  • Absolute paths: Use variables like %ProgramFiles% instead of absolute paths.
  • Default value: A registry key’s default value is relict from Windows 3.1. Use named values instead.

Note: This is from a Windows 7 machine with Office 2007 installed (no older Office versions present!).

Comments

Related Posts

Keyboard Shortcuts You'll Never Want to Miss Again

Keyboard Shortcuts You'll Never Want to Miss Again
Keyboard shortcuts are the key to productivity and efficiency. This is true for any machine, any OS and any application. This article lists shortcuts I personally find very helpful and use often. In selecting what to include I focused on shortcuts that might be less well known. Many shortcuts work in other than the described applications in a very similar way. Please do try them out in all your most frequently used applications.
Miscellaneous

Latest Posts

Scripted WordPress to Hugo Migration

Scripted WordPress to Hugo Migration
After having published in WordPress for almost 20 years, it was time for a change. This site is now rendered by Hugo, a static website generator built for Markdown content hosted in a Git repository. The migration from WordPress (HTML) to Hugo (Markdown) was far from trivial. Since I couldn’t find any tool for the job, I developed my own set of migration scripts that fully automate the migration process. You can find them on GitHub along with extensive documentation.
Website