4 ms·
This post describes a process of decomposing code into very simple functions: http://www.gar1t.com/blog/solving-embarrassingly-obvious-problems-in-erlang.html h
by jake_morrison 6y ago
This post describes a process of decomposing code into very simple functions: http://www.gar1t.com/blog/solving-embarrassingly-obvious-problems-in-erlang.html http://www.gar1t.com/blog/solving-embarrassingly-obvious-pro...
This results in functions which are, I feel, a bit too small for comfort. On the other hand, Erlang's pattern matching on function parameters has an effect similar to Eiffel design by contract. It has the potential to reduce the number of tests that need to be written (many of which are often very short functions).
Ideomatic Erlang/Elixir code tends toward smaller functions and pattern matching on multiple function heads instead of if/then/else logic.