How to Write Clean, Testable Code
Written by Eric Normand. Published: April 25, 2012.
Eric Normand's Newsletter
Software design, functional programming, and software engineering practices
Over 5,000 subscribers
Reference: How to Write Clean, Testable Code
A good talk by Miško Hevery. I like his point that he likes constructors that have no logic. They simply assign data values passed to them to the appropriate fields instead of doing a lot of reasoning about the values. He likes to decomplect the logic from the data, and claims that it makes code more testable.
It reminds me of Clojure, where data values are typically built using literal maps. Clojure encourages a separation between logic and data construction and generally avoids this problem which is common in Java.