There are times during the course of a project when you just want to bang your head on the desk or toss your monitor through the window, usually because of a bug that is difficult to find. There are other times when you sit staring at the screen with a blank expression while one hand rests idly on the mouse and your mind is completely blank. Still other times you find yourself aimlessly wandering back and forth between different internet forums, reading new posts almost as soon as they are posted, while somewhere in the back of your mind a voice is mumbling that you need to get back to optimizing your texture loader.
If these attacks of inactivity hit you while you are sitting in a cubicle at your place of employment, you’ll just have to deal with it. For those of you that are self-employed/work at home, program as a hobby, or otherwise don’t have a project manager or team lead staring over your shoulder, there is hope: exercise!
No, I don’t mean that you should drop and do 20 or go speed walking through the neighborhood. I’m talking about exercising your mind. Rather than sitting around frustrated, inactive, or distracted, spend an hour or so on a one-off project completely unrelated to what you are currently working on. Not only will it help to put your mind back into a more productive state, it’s also good practice.
Ideas for coding exercises can come from anywhere. The internet is a rich source, but if you have any programming books around you (as you should), they can be great sources as well. What you do isn’t really important as long as you do something. It doesn’t even have to be particularly challenging. Here are some ideas to get you started:
- work on one or more of the exercises at the end of a chapter in a programming textbook
- port the source from an online tutorial or textbook chapter to another language
- create a short text-based game
- create a simple plugin for another application, such as Firefox (it doesn’t have to be useful or practical)
- create a widget for Yahoo! Widgets (formerly Konfabulator) or a Gadget for Google Desktop
- make a shell script that launches your favorite applications when you start the computer
Like I said, it doesn’t matter what you do as long as you do something. However, it can’t hurt to do something that will have more benefit to you than just getting you in the right state of mind. For example, if you’ve never coded a Firefox extension, doing a simple extension as a coding exercise can be a good introduction. Or if you only have a passing familiarity with Python you might use it instead of a language you are more intimate with.
In addition to getting your state of mind in the right place and possibly learning something new, you might just find yourself with an idea for a new project, or maybe a bit of code that you can reuse elsewhere. One coding exercise I did a while back spawned several more, with the ultimate result being that I learned more about a scripting language I had previously only had passing familiarity with and wound up with a nice application framework in 4 different languages (each of which I use frequently for other code exercises, prototyping new ideas, and anything else I need to knock up quickly).
Don’t get buried by your current project. Use coding exercises to help yourself stay sharp, in the right state of mind, and to improve your skills. Of course, if you find that you just can’t bring yourself to type another line of code then no number of coding exercises are going to help you. In that case, it’s best to step away from your programming altogether for several days to clear your head out. We all need it from time-to-time.
Technorati Tags: programming
{ 2 } Comments
Project Euler (http://mathschallenge.net/index.php?section=project) is worth looking at for some programming problems to solve.
Thanks for the tip. Of course, now I’m probably going to make excuses to step away from my projects just to solve some of those problems.
{ 2 } Trackbacks
[…] General Tip: Coding Exercises […]
[…] found that doing some math puzzles, or coding examples helps out. I was reading Game Dev Mike’s blog entry about doing coding exercises to recharge, and I stumbled across the Euler […]
Post a Comment