Wednesday, October 27, 2010

Reusability and You

Greg sent me this link a little while ago: The Basics of Design Patterns

It's about how useful it can be to use design patterns in your code. Not only for the sake of reusability but also because they can, if used in the right place, make your code cleaner and more efficient.

It got me thinking on how much I have been implementing not only design patterns but also reusable code in Call Connect. I've been long time friends with Singletons and have a solid Singleton class that follows me around from project to project but when it comes to some other elements I feel like I could (and should) create code that is much easier to transfer over to new projects. The menu system I have created is reusable but could be improved to reduce the size of the eventual screen changing switch statement as one example.

The tricky decision is always whether to spend the time creating something reusable or to just hack something together so that it is working sooner. Sometimes the temptation to hack and see results quicker is too great and the promises to 'come back and redesign later' are made. You just have to make sure to actually keep those promises otherwise you'll get to the next project and find you have to rewrite something that would have been easy to bring over from the previous project. I know I've found myself in this situation too many times over my academic career and so I am aiming to rectify this in my professional one.

This is also something that can be extended to Tools Development, something which I have not put enough effort into and will have to fix in the very near future. Tools can be especially helpful in smaller teams as they can - depending on the type of tools - share the development load across more people. With the right tools Greg could be tweaking game design elements and testing game assets instead of all the this load being placed on me, the programmer. Luckily with the close work environment and quick change and build times this is not as large a burden as it could be but it still is one of the more important lessons that has been learned in the development of Call Connect and will see improvement in the future.

Call Connect, as the first project from Walk Through The Clock, has always been thought of as a learning tool (As well as our stepping stone to fortune and fame!) and hopefully using good design patterns and tools will allow each subsequent project to not only have reduced development times but to also be an improvement on the previous project.


P.S. Matt has also started documenting the various possible design patterns starting with The Singleton. Check it out.

No comments:

Post a Comment