CompSci 108
Fall 2010
The Software Studio

Code Critique

In the same teams you worked with for the last assignment, read, evaluate, and improve an initial implementation of this popular online game. This project's primary purpose is to help you start to build a sense of what makes one piece of code better than another given a specific set of design goals. Along the way, you should learn more about your game engine as well as its ability to support complex game development.

Start by reading the code to understand how it works; make a list of any questions you have about the code. While studying the code, also note any good things about it, that you might keep in the final version, as well as problems with the code. To help you understand the code, you should convert it to run using your game engine.

Your justification of which changes to make to the code rather than simply how many changes you make is the most important aspect of this assignment. In other words, if you feel strongly that the code is perfect as is and make no changes, you can still get an excellent grade if you completely justify why the code does not need to be changed in the context of your design objectives. On the other hand, you can also decide to scrap the code entirely and start over from scratch but, again, you must clearly justify your decisions and why the submitted code is better than the original. Justifications that refer specifically to principles given in the resources below will be given higher credit than those that use terms like "clearly/obviously", "good/sucks", or "like/hate".

Refactoring

Refactoring is the practice of updating a program to improve its design and maintainability without changing its current functionality significantly. An example of refactoring is creating a single function or class that replaces two or more sections of similar code because it reduces the amount of redundant code within the program and makes the code easier to debug and test. You should examine the given program and refactor it based on your critique and our discussion in class. You may create (and comment) any new functions or classes you want to help improve the program; however, you must justify each change you make by explaining specifically how it improves the code.

Improving

Finally, using your refactored code, describe how you would change the code to do each of the following:

Implement one of these changes.

Resources

The following readings provide principles for improving the design of the code.

Deliverables