Coding Like Forrest Gump
Posted on Friday, October 24, 2008
It never fails. Every semester, I have to help at least one student who wants to create some convoluted, twisted function for their homework assignment, when it really isn't necessary. I tend to squint at their screen for a moment, scratch my head, and ask, "...and what are you trying to do here, again?"
It seems to be a two-fold problem. The first (and I know I've harped on this before) is just plain a lack of planning. No matter how many times the instructor hints at it, students just don't seem to like taking a little bit of time to sketch out their programs before they fire up their IDE.
The second problem seems to be related to over-thinking the task at hand. The students seem to want to throw a whole lot of code at a rather simple task, or store some data in a type that really isn't a good fit for what they need to do.
It's frustrating at times, but I can eventually convince these young gentlemen and ladies to take a step back from their development environments and watch and listen as I sketch out simple data structures on some scrap paper.
Once we have a good, simple data structure to store data in, the input phase tends to become a lot easier, and this makes every other step that follows easier, too.
So, maybe Forrest should say this if they ever make a sequel: "I may be a simple man, but I know what good code is..."
:)