Can i ask a favor of you? Can you try not to be clever when you code?
i'm in the process of trying to reform a module for work. The change is actually pretty simple, but i'd like to test it out to make sure that things work correctly. Unfortunately, that's far from simple.
In order for me to test what's going on, i need to bounce back and forth between two directories (one of which inexplicably has templates located beneath the code instead of oh, say, where the other templates are) decipher if i should call "dall" or "t_all" (i actually need to call both of them it turns out), and generally spelunk through reams of code only to discover that the only way for me to apparently test my change is to make it available on production servers. Live.
This is generally not what "Testing" is for.
i'm quite sure that the code itself is very clever and able to do all sorts of things, but you know what? i'm not using a stitch of it. It fails my simple need to display a modified form on a back end machine.
You know what would be an even more clever way of coding?
How about a simple way to have a program list the various views available in a given target directory, allow a toggle to display locally or remotely and use function names like "debug_all" or "test_display_all" instead of cryptic shit. This means that your clever efforts won't be erased by the next person who doesn't feel like trying to figure out just how clever you were.
i still think that anyone brought into a company should have to spend a minimum of six months doing maintenance on other people's code. Let them discover what a real pain in the ass "clever" coding really can be and why simple, straight-forward design is far more elegant than popshifting variables on an unlabled hash you're accessing as an array.
(And people wonder why code optimizers are flakey…)
Save This Page
