Reaction for: Generating Alternative Designs by Adam

This article really got me thinking about how programs are written. Usually, after the student has arrived at what he thinks is a reasonable design, the student starts in on the code. Arguably it's impossible to spend enough time working on the design of a program because invarably, a better way presents itself by the time the first implementation is done.

I strongly beleive that you can't get a program right the first time: there is always a better solution that will become apparent. With the pace of most computer science courses I imagine that there is little time to go back and examine every facet of a project, but I think that some degree of reveiw would be very beneficial.

Just as a quasi-relevant example: in cs15 I wrote three separate versions of Swarm. Given, I am a loser with nothing better to do on Saturday night than revise Swarm code, but I really feel that I got a lot out of that project which I was able to carry over into other projects. My problem in my first incarnation of Swarm was that I planned to solve the task, not to solve it well. I looked only at what had to be done and solved the problem from that perspective instead of looking at the best way of writing the program to allow for optimal flexability.

There clearly isn't time do to this sort of reexamination in cs15, but it's a valuable exercise at any level of programming expertise.


Reactions


Amanda:

That is one reason why I think that the TA program is a more valuable resource than many of the other programs that the dept offers. It allows you to learn about bad code, like jon said, and it allows you to reexamine and reevalutate code that you have already done...if you are going to show someone a piece of code to use as an example, you're gonna work real hard on that code to make it all nice and perty...


Danah:

You are right. One of the best ways to understand something is through revision. I still have a week left on Logo but have redesigned 4 times already (2 times while coding where I scratched everything and started over- once while almost completely working) and I personally feel that I have acquired so much more knwledge through that process. Unfortunately, the reason that I am able to take advantage of that process while taking a course is that I have enough personal knowledge to know that I am far better off starting early and walking through the whole process with large amounts of thinking and time. I don't think that most students have the ability to do that for whatever time-related reason. And you cannot force someone to want to start early.

On a response to response note, I totally agree with you Amanda. Rewriting Tetris was a goddess-send. There is so much to be said to rewriting and explaining and grading a program so many times that you dream about it.


Andrew

Couple points which may or may not be too relevant:

  1. Be careful in your use of pronouns. If you are going to use 'he' in some example make sure you offset it with a 'she' in the next example. Otherwise use 's/he' or 'one'.
  2. If you think no one gets a program right the first time I suggest you follow this link, he may have a differing opinion for you.
  3. I personally think an assignment in the spirit of our thoughtful programs would be very beneficial to a beginning student. Not only to the student but to the TA grading. This way we might be able to figure out why exactly they are making mistakes -- where in the thinking process are the mistakes being made and how can we actively correct them.

[BACK]