Friday 17 June 2016

Cleaning up Teemu

It's surprising that I'm now a better programmer than I was couple of years ago, because I was really great then. When I'm looking at the source code of Teemu I can now see some issues clearly. The main problem is the way classes have functions (and functionality) that belongs to somewhere else. This is often easy to fix and I've been doing some of that already.

Sometimes functions could use another class using two or more classes to modularize classes to do only what they are supposed to do. But in some cases it's probably not that bad, especially in smaller projects like Teemu. Some classes could be broken into smaller ones, but it's not worth the trouble, because often some functionality is used in limited number of places. I've learned to avoid refactoring when weighing the benefits of better source code vs. time spent to fix some minor issue. Everything can be fixed later.

It's also useful to arrange files into small logical groups in the IDE using virtual folders (or filters as Visual Studio is calling them). This is more important in large projects, but it also keeps files in control in small-ish projects like Teemu.

No comments: