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

Latest Posts

Fast & Silent 5 Watt PC: Minimizing Idle Power Usage

Fast & Silent 5 Watt PC: Minimizing Idle Power Usage
This micro-series explains how to turn the Lenovo ThinkCentre M90t Gen 6 into a smart workstation that consumes only 5 Watts when idle but reaches top Cinebench scores while staying almost imperceptibly silent. In the first post, I showed how to silence the machine by replacing and adding to Lenovo’s CPU cooler. In this second post, I’m listing the exact configuration that achieves the lofty goal of combining minimal idle power consumption with top Cinebench scores.
Hardware

Fast & Silent 5 Watt PC: Lenovo ThinkCentre M90t Modding

Fast & Silent 5 Watt PC: Lenovo ThinkCentre M90t Modding
This micro-series explains how to turn the Lenovo ThinkCentre M90t Gen 6 into a smart workstation that consumes only 5 Watts when idle but reaches top Cinebench scores while staying almost imperceptibly silent. In this first post, I’m showing how to silence the machine by replacing and adding to Lenovo’s CPU cooler. In a second post, I’m listing the exact configuration that achieves the lofty goal of combining minimal idle power consumption with top Cinebench scores.
Hardware