Friday, September 5, 2014

One of the best practices in angular.js development that I have trouble adhering to is minifiable injectables.

I have always been a huge fan of dependency injection, and I am constantly advocating for it in my work projects that aren't fortunate enough to have it. When attempting to convince a developer who hasn't experienced the wonders of dependency injection and the slew of benefits it brings to testability, they only seem to think of it as an API. A verbose API.

That is part of why I am creating the language Wake, to make syntactically beautiful DI and to require its use. Because without a dedicated language doing so, dependency injection is inevitably more work - and that's the work you have to sell to that skeptical developer. Take java.

But this boilerplate is inherently predictable, so I decided I've had enough. I sunk some time into creating a plugin that manages the two for me, with extra goodies to add/remove/reorder the dependencies for me.

Here's a gif of it in action, recorded with the handy-dandy ttygif project.