2010-12-02

There’s more than one tool for every job

As we develop our skills as programmers, we hope to improve the quality of our work. When I look at my earlier projects, I’m always surprised to realize that there were easier, simpler, or more refined solutions than the one I had thought perfect at the time!

One common mistake is to over-use a tool or technique. The old saying is that to a man with a hammer, everything looks like a nail! I’ve seen the truth of that this week: Some students have turned nearly every assignment into one of selection, even when selection wasn’t required. Others, who have mastered the if statement, have used it wherever selection was required, even if [grin] case would have been an easier, simpler, and more refined choice. And still others have made their selection based upon highly detailed criteria, when more general criteria would have worked just as well and been much easier to code and understand.

Of course, my hard-working students have really only just begun their journey into programming, so it’s both understandable and to be expected that they’re still learning that there’s more than one tool for every job.

No comments:

Post a Comment