Saturday, September 16. 2006Practicing ProgrammingLately, I've been thinking a lot about practicing programming. By that I don't mean the practices of programming--I mean actually programming for the purpose of honing my skills. I used to think that I didn't need to "practice"; after all, I program all the time at my job, right? I even do extra-curricular projects. Isn't that "practice" in and of itself? But recently I've realized that that's not true. When you work on a project, whether it's at work or at home, you're implicitly working within a very narrow scope. When you work within a particular industry, you're also working within a narrow scope. While you may gain a great deal of skill within that scope, you still need to maintain your skills with the "basics": the languages, techniques, algorithms, and so on that make you a well-rounded programmer. If you concentrate all of your efforts into one area, your skills in other areas will atrophy. Practicing programming doesn't just help you maintain your existing skills, either. It helps you to pick up and understand new skills that may be applicable to your current area of focus. For example, when I first was learning Test-Driven Development, I didn't want to plunge into a huge project without ever having written an xUnit test; that seemed pretty overwhelming. Instead, I found it very helpful to write a bunch of small practice programs and solve some exercises using TDD. By the time I started to apply TDD to a large work-related project, I felt pretty confident. That last bit about writing small programs ties into something that I think is essential to getting the most out of programming practice: making it practical. If practicing programming means you have to embark on a full-scale project in order to exercise one or two concepts, and you're lazy like me, you're not gonna get it done. Even if you do get it done, you're going to spend more time worrying about the logistics of the project than boning up on a particular technique. Programming practice should be focused and easy to do. When I'm practicing, I like to work on problems of a scale that I can solve in a few hours--bite-sized programs that I can write in an evening, or on my laptop while I'm on a train ride or plane flight. So where do you find these kinds of problems? I suppose you could make them up. I find, though, that the best practice comes from solving problems that come out of left field, not things that you've already thought about. I like to find exercises that somebody else, with a completely different perspective than my own, has come up with. That maximizes the extent to which you think outside your own areas of focus, and leads you to a broader experience. With that in mind, where can you find exercises to practice with? I've been doing quite a bit of research on this, and have found a lot of sources. Here are a few big ones: Code Katas. Those of you who read a lot of development blogs have probably encountered these; they've become very popular in the last few years. A code kata is a small problem or exercise that you are encouraged to code from scratch periodically. The idea is that, similarly to a martial arts kata, every time you go through the motions of solving that problem, you'll gain new insights into it. I think that's true, but I also think that there's value in doing code katas even if you only solve them once. They provide small but interesting problems to solve. I first encountered code katas when I went to an Agile Development seminar given by Bob Martin, in which he walked us through a couple of katas. Indeed, Bob Martin's blog contains a number of interesting code katas. Dave Thomas also has a great page of code katas at the Pragmatic Programmers site. The Coding Dojo also offers a number of interesting katas. Many others exist on the net, including a lot of language-specific ones (all the katas I've linked to here are language-neutral). Your best bet is to Google "code kata". Coding Competitions. There are a number of websites, such as TopCoder, that host programming competitions. These are typically timed matches during which programmers compete to solve a small problem in the most efficient/elegant way possible. These sites provide you with an "arena" environment that includes a code editor, compiler, test data, and typically a way to view other contestants' entries and critique them. Some competitions even include cash prizes. Even if you're not the competetive type, most of these sites have "practice arenas" in which you can solve problems from previous competitions. Not a bad way to get in some quick programming practice; you don't even need a compiler on your local machine. Books. Remember those exercises at the end of every chapter of your Computer Science textbooks from college? Well, they're still there, and a lot of them pose interesting problems. Dig out your old Algorithms book, or an Operating Systems text, or whatever seems interesting to you, and check them out! Trust me, they're much more fun when you're not doing them for credit. There are also some books of coding puzzles out there, but they seem to be few and far between. One I did pick up recently is Programming Challenges Any thoughts on all this? Got any other resources? Please post them in comments to this entry! Copyright (c) 2006, Matt Kimmel. All Rights Reserved.
(Page 1 of 1, totaling 1 entries)
|
QuicksearchSyndicate This Blog |

