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.
Sean Allen
Your friendly reminder that if you aren’t reading Eric’s newsletter, you are missing out…
Your friendly reminder that if you aren’t reading Eric’s newsletter, you are missing out…
Nicolas Hery
Lots of great content in the latest newsletter! Really glad I subscribed. Thanks, Eric, for your work.
Lots of great content in the latest newsletter! Really glad I subscribed. Thanks, Eric, for your work.
Mathieu Gagnon
Eric’s newsletter is so simply great. Love it!
Eric’s newsletter is so simply great. Love it!