The above video,Three Flaws in Software Design – Part 1: Writing Code that isn’t Needed, was a bit long considering the content presented but there were two ideas worth sharing:
- Let the version control system worry about tracking dead code. I’ve worked in plenty of programs with code that I’ve been tempted to bypass because it was suspected dead code. Removing the suspected dead code might not cause the customers testing to fail but customers don’t always test their own requirements properly. Without the old code it becomes difficult to track how the program once functions unless you use a version control system. Whats worse than trying to avoid making dead code? Working around mysterious code from a long departed coder, unsure if it’s still relevant, while trying to make my own logic clear among rotting bits.
- Establish when functions can assume variables are well formatted and note them in the function documentation. It’s so easy to start coding away, checking for possible conditions that might have been checked closer to the user input. It’s painfully agonizing trying to return a high level validation failure from a very low level function.
If the addition videos in the series contain any pearls of wisdom they’ll get posted here.