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

Should I Have Separate Personal & Professional Twitter Accounts?

Should I Have Separate Personal & Professional Twitter Accounts?
That was a question I was asking myself more and more recently. After a bit of deliberation, I answered it with yes. This article summarizes my reasoning. My Twitter History I have been on Twitter for more than 11 years. If I remember correctly, Brian Madden - whose website was extremely popular in the Citrix community at the time - had urged people to join Twitter a little earlier. I responded to Brian’s call and quickly realized that Twitter was a great platform that allows people with a common interest to identify each other and communicate. In my case, that interest was end-user computing, of course, the products and technologies from companies like Citrix or Microsoft. After joining Twitter, at conferences, many of the names were known to me, and sometimes I to them. Getting into contact was so much easier. The major difficulty was recognizing someone from their Twitter profile picture (something we often joked about).
Miscellaneous

Latest Posts