Previous section   Next section

Imperfect C++ Practical Solutions for Real-Life Programming
By Matthew Wilson
Table of Contents
Appendix B.  "Watch That Hubris!"


B.4. To Insanity, and Beyond!

Several years ago, I was tasked with writing a general-purpose library to supplant the standard library IOStreams, strings and containers for an existing, specific custom-database subsystem, and to then rewrite the existing solution to use the new classes, without changing the design or public interface of the subsystem—which had never shipped outside the development team—one iota.

By the end of our efforts on the project, we'd got ourselves so tangled up that we reached the nutty situation of having to have a separate include file for every standard library function, for example, fprintf.h, and contextual typedefs (see section 18.2.2) for every conceivable thing relative to every conceivable permutation of standard versus custom library component.

My mistake was a simple but crucial one. I should have said that the design was poor, the initial implementation was poor, and the idea of rewriting a great many standard components to work with the performance-related constraints was a bad one that, even if done well, would take several months. Instead, I allowed my working relationship and personal friendship with the original implementer, who was also the development lead for the client, to cloud my judgment, and I just busied myself with getting on with the task. I did what we programmers tend to do all too readily, which is to get stuck into the challenge without working out whether the challenge is a worthy one. Kind of like spending five hours in a gym, when what you should be doing is a three-col climb in the French Alps or staying at home and having pizza with your kids!

I'm sure the story is all too familiar. What was supposed to be a three-week job was still only halfway finished nearly three months later, by which time our working relationship had soured, I was deeply troubled by the work itself and severely demotivated, and my colleague was ruining his previously second-to-none reputation within the company. My contract was up for review, and I was relieved to be no longer required as the project got the can. My erstwhile colleague left his employer of several years soon after, and was out of work for many months.

The lesson here's simple: if the Emperor's not wearing any clothes, then for heaven's sake say something! Don't stay silent and work in swill because you'll end up regretting it anyway.


      Previous section   Next section