In this video, Software Craftsman Samir Talwar discusses using your type system to make all these problems go away (at least from the core of your code). As a bonus, one will end up with a much more expressive, readable, maintainable and most importantly, correct code.
Samir has also written a fantastic blog on the topic which you can find here.
Software is our passion.
We are software craftspeople. We build well-crafted software for our clients, we help developers to get better at their craft through training, coaching and mentoring, and we help companies get better at delivering software.