By Source, Fair use,

362 Home









Why is the project based on extending existing code?

The majority of a developers time is spent reading, not writing code. Probably the only time where you will spend more time writing than reading code is in school, which may give you a warped view about what professional developers do. In his book Clean Code, Bob Martin gives a play-by-play of a typical development session that he recorded using a keystroke logger [MartinCleanCode08].

Bob enters the module.
He scrolls down to the function needing change.
He pauses, considering his options.
Oh, he’s scrolling up to the top of the module to check the initialization of a variable.
Now he scrolls back down and begins to type.
Ooops, he’s erasing what he typed!
He types it again.
He erases it again!
He types half of something else but then erases that!
He scrolls down to another function that calls the function he’s changing to see how it is called.
He scrolls back up and types the same code he just erased.
He pauses.
He erases that code again!
He pops up another window and looks at a subclass. Is that function overridden?

Being able to navigate code, identify patterns in code, identify and use extension points, deal with code that was not well designed and refactor (not rewrite) code are important skills that this course attempts to teach. If the project involved creating an application from the ground up, by the end of the semester you would have spent a significant amount of time writing code, and you might feel like you have accomplished a lot, but in reality you would have spent very little time practicing design. In this class we try to do the opposite, in each project iteration you should not need to produce more than several dozen lines of code, but everything you do will be with the intention of practicing good design.