Quick update
Hey everyone,
I had almost finished a long blog post about modules and object copying in Javascript when I picked up Douglas Crockford’s Javascript: The Good Parts. It’s a great book, and I highly recommend to anyone serious about writing good code. However, it completely demolished the issues and plans I described in my post; instead of writing a highly classical module system, I’ve decided to go with a more functional/prototypal system. After playing with that for an hour or three, I’ve decided not to rewrite the MealImage class right now; instead, I’m going to give the style a try as I write modules for page state management, language support, and image display.
Good news: I’ve finished test coverage for the MealImage javascript class, the most complex piece of front-end code I expect to write for the project. Test-writing was quite an undertaking, clocking in at about 2100 lines of code for about 560 lines of code+comments, but is well worth it. Knowing I broke nothing by changing out the underlying HTML renderer from Jaml or by universally changing == to === is well worth every minute I spent on tests over the last month. I’ve taken notes for a blog post on unit testing in Javascript and will start that soon.
Nothing much has happened on the Devise front — I’ve been mostly focused on Mealstrom, and Alex has been busy too. I’ll get to that no later than January 30th, when we plan another all-night hackathon.
That’s about it. I’ll be focusing on adding new features to Mealstrom again and finishing the meal editing page so that you can test it out on the beta site.
Enjoy your weekend — find something good to eat.
Alex
















