The Best (and Worst) Code I Ever Wrote
As a software engineer, I've written a lot of code through the years and forgotten most of it. Some bits, though, I remember vividly. One routine in particular sticks out in my mind as simultaneously the best and worst code I've ever written. Picture this: we have a set of official forms used in nursing homes that need a UI to set the configuration for each form. There are three types: Physician Order (A), Medical Administration Record (M), and Psychotropic (P). For reasons I can no longer remember, there were two categories: the first had only Physician Order and MAR forms, the second had all three. With me so far? Herein lies a cautionary tale against the "it's just..." reasoning. The request probably sounds simple so far. It's decently easy to explain and understand. However, because of the complexities around that functionality, I wrote a routine that persisted in that code for probably a decade or more until the project was officially deprecated and shut ...