Functional Banana vs. Stateful Gorilla
John D. Cook’s post quotes Joe Armstrong, creator of Erlang, on software reusability. This goes along well with the Law of Demeter. The goal of the Law of Demeter is to reduce the coupling between object-oriented code modules, thus decreasing the side-effects of your code – the size of the gorilla holding that banana you’d like to use.
In application development, we end up needing to manage a lot of state. The key is to minimize the state we’re managing and the coupling between modules, and to recognize when it makes sense to factor our code into functional chunks that are free of state and side-effects. The benefit we gain is code that is easier to understand, debug, and reuse.
- August 6 2011 | - Read More →


