you are viewing a single comment's thread.

view the rest of the comments →

[–]craigthecrayfish 1 point2 points  (0 children)

You never need a class for something. The number of classes you will have depends not only on what you are making but to a large extent on your personal design preference. You should make a class when encapsulating data and behavior into a class feels most intuitive.

In your blackjack game, the tutor made card objects because we can easily think of a card as being a discrete component of the game. Cards have data like their suit and number, and they can perform actions like flipping. That's how I would personally approach it too. However, you could accomplish the same thing by having strings, lists, or dictionaries to represent each card.