A few days ago, I listed 5 things that I think make a quality developer. 5 things that a person can work on to become a craftsman. One of those things was thinking critically to compose efficient solutions. I should define what I mean.
Thinking critically is the ability to sit back and think about a problem in a broader sense. This is the exact opposite of just jumping in and programming something. Just jumping in will always result in something that you missed. Always.
Working in a way that permits a developer to think will lead to better solutions that have all of the elements that you would want; scaling, loose coupling, simple.
So, how does a programmer that doesn’t use this method get there. I would say there are a few things that you can do.
- Sketch. Just drawing out how your system should work will often reveal holes in your plan and allow you to account for them.
- UML. I know, I cringe a bit too. But I find this method really helpful in certain situations. Especially in designing pure OOP systems.
- TDD. This should probably have been first. Once you take a test driven approach, you can think about the solution in smaller pieces and then ensure that they work. When they don’t work, you’ll see that much sooner. Just like you might if you were sketching the system out on paper.