Handling application state is difficult. Different languages and paradigms have different ways for managing state. In this challenge, I would like to use a simple example and see how different people implement the state handling.
The cookie jar is an entity whose state changes over time: sometimes someone takes a cookie out of the jar, sometimes someone adds cookies to the jar. Is it possible for someone to take cookies out of the jar at the same time? Who knows?
The cookie jar can be empty, but there can never be a negative number of cookies...
If cookie monster gets ahold of the cookie jar, he will eat a lot of cookies. Maybe all of them, but probably more than one. Silly Cookie Monster.
Kitten likes cookies, but she's a bit more conscious of her figure, so she's likely to only eat one cookie.
We all love grandma! She doesn't like to eat cookies, but she's always adding cookies to the jar. After all, you look a bit too skinny!
Do you have an example? Let me know!
Copyright © 2017 Joy Clark
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.