I’ve finally kicked my primitive obsession! I didn’t even know I had one until I got serious about making a type for everything that has a name. I’ll never write a method like this again
Unit types are neat (
Acceleration), but they solve a straight-forward problem. Let’s look at a more complicated use.
It is important to understand the implementation of a log call before making changes for performance. If you already configured log4net and have an instance of
ILog, any log call is simple.
Have you ever wanted to log performance metrics? If you’re using log4net, have you implemented a custom
ILogand added a new
Level? That requires adding five new members to
ILogger, creating a new
LogManager, and overriding/assigning a new
Levelin the application configuration.
Michael Feathers wrote about festering and budding codebases last year. Festering code bases have code inserted into existing classes and methods. While budding code bases have new classes and methods created. This is the essence of the open-closed principle.
I was refactoring an internal application used in automated testing. It’s one of those tools that was written quickly, but inevitably outgrew it’s original purpose. I extracted a lot of hidden concepts and made many of the features explicit. Then I was in the code-behind facing down three timers, a handful of conditional loops, and cross-thread invocations.
I have a class that implements two behavioral interfaces