Friday, November 14, 2008

Abstraction

I remember once reading that the two most important ideas in computer science were abstraction and caching (by the way, a statement to which I 100% agree!). In this post I will be talking about abstraction.
According to wikipedia abstraction is a mechanism and practice to reduce and factor out details so that one can focus on a few concepts at a time.

In building jawaker, we tried to model card-games with an abstraction general enough to deal with the most common card-games and yet be simple enough to implement and reason about. We ended up modeling card-games as movements of cards between card stacks (used here in the non-technical sense to mean a pile of objects) with side effects (updating score, etc.). This abstraction solved the problem neatly as we worked on our first game (Trix) and is proving to be quite adequate as we work on our coming games.

No comments:

Post a Comment