Stop Writing AngularJS Directives!

I see it time and time again. A new developer comes to Angular. She wants to, say, display a list of things and a button that sorts them. So she asks her fellow—more Angular savvy—colleagues how on earth to do that. Write a directive, they say. Your logic…

Taming Gruntfiles

Every software project needs plumbing. If you write your code in JavaScript chances are you’re using Grunt. And if your project has been around long enough, chances are your Gruntfile is huge. Even though you write comments and indent properly, the configuration is starting to look unwieldy and is…

Speeding Up Grunt Builds Using Watchify

Grunt is a great tool for automating boring tasks. Browserify is a magical bundler that allows you to require your modules, Node.js style, in your frontend code. One of the most useful plugins for grunt is grunt-contrib-watch. Simply put, it watches your file system and runs predefined commands whenever…

Going Functional: Reduce

Reduce (a.k.a. foldl) is one of my all-time favorite higher-order functions. It’s kinda sorta the crane stance of the functional style kung-fu: you don’t want to use it a lot but when you do it can save the day. Every now and then you come across…