- When reading the code, it may not be obvious that currentPosition
and deckOfCards are dependent on each other.
(Poor Readability)
- The Blackjack game logic is intermingled with the deck
manipulation functions.(Poor Readability)
- Whenever the programmer manipulates the array, he or she
must remember to update currentPosition. (Unwanted Complexity)
- When trying to write a Blackjack game, in addition to
keeping in
mind the rules of Blackjack, the programmer also has to attend to the
details of how the deck is implemented. (No Abstraction)
- If you write another card game, you have to cut and paste
source
code for deck, and you have to be sure you get all the proper pieces.
(Poor Reuse).
- On team projects, another programmer might assume the deck
is
saved in the array from right-to-left instead of left-to-right and
write code that changes how currentPosition is used, causing
all the other functions to fail. (Poor Integrity)
- If someone decides a Vector would be a better way to store
the
deck than an array, you have to carefully inspect the entire
application to make sure every reference to the deck has been modified
properly. In addition, all the card games that use the
copy-and-pasted
code have to be changed. (Poor Maintainability)
|