CandyCode.info

About

In the summer of 2013, I bit into a Milky Way I purchased from a vending machine and was nearly unable to bite all the way through it. Naturally, I started looking for an expiration date on the package, but to my annoyance, I found only a cryptic code stamped on the bar, with no obvious means of deciphering a production or expiration date.

After a little research, I found that there is a relatively easy way to determine the production date of a given candy bar. Strangely, however, I was only able to find one attempt at making a tool to interpret these codes for the concerned vending-machine-using public. Posts and articles describing precisely how to decipher these codes were littered with comments containing codes and requesting that they be deciphered; apparently these codes, as simple as they are, are beyond the grasp of some significant percentage of consumers (stay in school, kids).

Finally, after determining that my Milky Way was at least two years past its expiration date, I decided that I would challenge myself to create an online tool to help people easily decode the seemingly arbitrary characters on their candy without having to do significant research and maybe even some math (gasp). Thus, CandyCode.info was born.

To further the challenge, I decided to make the tool a single page app using one HTML file and some object oriented JavaScript. The result isn't nearly as clever and pretty as I'd like, but it's not terrible either, and gets the job done!


Unfortunately, after I finished the core code for the site, I discovered that many candy manufacturing plants are now printing a normal "best by" date on their wrappers. While it is still obviously useful for extremely old candy, there will hopefully be a day when we know to simply throw away any candy old enough to be lacking a best by date.


Code

The HTML source can be viewed at CandyCode.info
The JavaScript source can be viewed here: candycode.js