Writing clean, testable code

A must watch for would-be programmers: Writing clean, testable code

Most of this stuff I’ve picked up through hard experience, though putting all of this stuff in one place is useful. Some of the most important code I work with is also some of the earliest I wrote at Vocalabs, and it’s nigh impossible to test. One thing he doesn’t mention is that when concerns are properly separated, it’s also easier to reuse and modify code, which I’m also bumping into. Unfortunately, the right way to separate concerns isn’t always obvious, and that same code includes some false attempts. (I.e. “dependency injection” means knowing your dependencies ahead of time, and getting it wrong is annoying.)

Advertisements