4 ms·
I use Elixir for work, and have led the adoption of it and therefore the teaching of other engineers. I have learned that in order to get people to produce goo
by rkangel 4y ago
I use Elixir for work, and have led the adoption of it and therefore the teaching of other engineers.
I have learned that in order to get people to produce good Elixir code, the important thing is to get them to think about the data structures first and then the functions: how your information is represented on the way in and out, what your state looks like etc.
Even something as simple as parsing a request, get them to start from "ok I have a binary as my input and then it's going to produce a map/tuple/whatever". Once they think like that (and have some understanding of which datastructures work well where) then the functions you need fall out quite easily, they tend to have roughly the right set of arguments, and modules tend to separate quite cleanly