Managing Debug Code with Boolean Switches

Most of us figured out at one time or another that we could use an external source—a text file, a .ini file, or the registry—to store external configuration information. Many clever programmers probably stumbled on this as a way to ultimately turn debug information on or off without rebuilding and redeploying an application. Well, now that you have mastered that trick, technology has evolved and we can accomplish the same thing more easily with an XML .config file and a class called BooleanSwitch. What you and I have been doing for years is finally part of the .NET Framework.

We shouldn't judge too harshly, though. For decades developers have been contriving idioms that solve problems and then become ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.