Introduction. Cookbook. Introduction Automated testing of software is an essential tool in development.
If it's a long-running project that you plan on maintaining and changing over time, it's even harder. Features come and go. You'll experiment with something, only to find it's not the right call and leave traces of old code sprinkled throughout. I absolutely despise messy code. It's hard to read, hard to maintain, hard to collaborate on, and it's just plain ugly to look at. Complexity sneaks up on you. Here are a few techniques, crutches, coping mechanisms, and semi-pro tips for staying sane. Refactor early, refactor often Entropy is inevitable in a codebase. Some developers seem hesitant to touch code they've already written.
Code is just text, not an edict. Don't be scared of refactoring. Separating views and state This is the biggest lesson I've learned building lots of single page apps. CommonJS Modules That's it! Grab your moonboots. Using events: Modules talking to modules. How do you keep your modules cleanly separated?