Find Long Methods¶
-
Open up the Blackjack codebase and become familiar with the rules of Blackjack found in the README (if you're not already familiar with the game).
-
Look through the three classes,
Card
,Deck
, andGame
. For each method, determine if it qualifies as being a Long Method based on what was covered in class.Note
Ignore
equals()
,hashCode()
, andtoString()
methods as these were code-generated. -
For each method that you consider to be Long, make a note as to why it's long (what makes it long?). Do not make any code changes at this time (it's tempting, I know!), just write down which methods are long and why.
Consider:
- Nesting/indentation: nested
if
andfor
blocks - Mixed levels of abstraction: detailed/low-level code combined with method calls
- Doing too many different things: are there blank lines separating them?
- Easy to understand and comprehend at a glance?
- Nesting/indentation: nested
-
After the lab is over, you'll be asked to share what you found, so type your notes in a convenient place.
You are done!