O'Reilly logo

CoffeeScript, 2nd Edition by Trevor Burnham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mini-Project: Refactored Checkbook Balancer

Let’s take what we’ve learned from this chapter and use it to add a new feature to the checkbook balancer from Mini-Project: Checkbook Balancer—while making the code more maintainable!

The original checkbooks program allowed you to pick one of three accounts (“checking,” “savings,” and “mattress”) and deposit or withdraw money from that account. The program had one limitation that made it slightly impractical: no persistence. When you closed the program, all account balances were reset to $0. The new checkbooks2 will remedy that by serializing account objects to a JSON file. We’ll also add a “transfer” action that moves money from one account to another.

Let’s start by creating a new directory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required