Eric Saxby

Senior software engineer at Sparta Science

It took a while for Eric to come around to programming, trying a few other careers first. Now he focuses on the intersection of code and process, using buzzwords such as TDD, agile, XP, and devops to describe his ham-fisted hammering on keyboards. He finds it most interesting when code fails, and why.

Past Activities

Eric Saxby
Code BEAM SF 2019
01 Mar 2019
15.20 - 15.45

Casting against type(s)

Coercing and validating user input can lead to painful code. Casting language primitives is done by Ecto, and storage problems that once required thought are solved by convention—time is stored in UTC, money without floating points. Managing our own types often gets ugly, though: standard vs metric; currency conversion; jsonb.

Extending Ecto is simple. With custom types, we can separate casting from formatting and dramatically improve the readability and maintainability of applications.


The audience will come away with concrete examples of how to improve their applications. Specifically, this talk will help people in making their applications less complicated, easier to understand, and easier to test.

Beginners to Elixir, Phoenix, and Ecto will come away more able to dive into Ecto internals, thinking about principles of code isolation and separation of view concerns from data persistence concerns.


This would be best suited to people who already have experience with both Phoenix and Ecto. It may also appeal to developers experienced with other web frameworks and languages, who are evaluating Phoenix.