Chapter 17. Clojure changes the way you think
This chapter covers
- Thinking in the domain
- Testing
- Invisible design patterns
- Error handling and debugging
In this final chapter, we’ll cover some tangential topics that you might already be familiar with, but perhaps not from a Clojure perspective. Our discussion will start with domain-specific languages (DSLs) and the unique way Clojure applications are built from a layering of unique application-specific DSLs. Next, you’re unlikely to be ignorant of the general push toward a test-driven development (TDD) philosophy with a special focus on unit testing. We’ll explore why Clojure is especially conducive to unit testing and why it’s often unnecessary. Next, whether you agree with the cult of design patterns or not, it’s inarguable that patterns have changed the way object-oriented software is designed and developed. The classical design patterns are often invisible and at times are outright nonexistent in Clojure code, as we’ll discuss. As we’ll then show, error handling in Clojure flows in two directions: from inner functions to outer via exceptions, and from outer functions inward via dynamic bindings. Finally, we’ll explore how having the entire language at your disposal can help change the way your debugging occurs. We hope that by the time you’ve finished this chapter, you’ll agree—Clojure changes the way you think about programming.