3 ms·
IMHO, that was an excellent talk, well presented and insightful. I found your argument starting around 28:00 interesting. I’m not familiar with the specific to
by Chris_Newton 4y ago
IMHO, that was an excellent talk, well presented and insightful.
I found your argument starting around 28:00 interesting. I’m not familiar with the specific tools you’re using and their idioms, so it’s possible that I’m missing some context here. As a general principle, I like to make it very clear where code is doing I/O and what is happening with any data involved. If this function receives data in one format, transforms that data into another format and finally sends that data to the database, then to me that seems like a useful separation of concerns and a clear representation of the overall behaviour. Maybe I wouldn’t choose the same name/structure as User.registration_changeset in your example, but the principle of hiding the implementation details of the data transformation seems helpful, for the same reason it’s helpful to see Repo.insert() instead of five lines of SQL at this level of the code.
- tommica 4y agoAh, the talker is not me, I'm just a fan of the concept
- Chris_Newton 4y agoAh, sorry, I misunderstood. In any case, it seems we probably agree! :-)