When Adding Complexity – Just in Time Beats Just in Case
Posted in Uncategorized on July 28th, 2011 by ben – 3 CommentsIt’s better to introduce complexity into your code “Just in Time” rather than “Just in Case”.
Let’s make this ultra flexible, Just in Case someone wants to do x, y and z.
Let’s split this into a new library, Just in Case we need it elsewhere.
Let’s optimize this piece of code, Just in Case it’s too slow.
They’re really going to want a, b or c (not x, y and z).
It’s easy to create that new library later, when you know you need it.
A profiler will tell you what parts are slow.
If all the Just in Cases were saved until Just in Time… there would be time to refactor, there would be time to do more testing and the code would be more maintainable.
You should think about the Just in Cases, but don’t implement them yet… (unless it has to do with testing).