Refactoring Elixir for maintainability
summary
Argues that heavy pattern matching often hides duplication and suggests replacing ad‑hoc guards with concrete abstractions: build a blog using Elixir, Phoenix and Ecto, wrap markdown in a markdown struct, implement Phoenix’s safe protocol to auto‑render HTML via raw, and add an Ecto.Type behavior to cast/load/dump markdown to a DB string. The result is fewer template calls, centralized conversion logic, easier testing and maintainability—pattern used successfully on a production news app to reduce repeated plumbing.
AI-written summary · about
chapters (9)
- 0:00Start
- 5:52Markdown
- 7:07Debugging
- 8:01Prevent User Input from Injecting Bad Values
- 9:29Refactor for Maintainability
- 10:50Protocol Consolidation
- 11:12Safe Protocol
- 13:02Behaviors
- 14:01Backing Type
related talks
47mGood behaviour: Cultivating Healthy Elixir Teams & Codebases
44mElixir & Phoenix - Fast, Concurrent and Explicit
52mWrite Less, Do More (and Have Fun!) with Elixir Macros
56mKeynote: Think Different
37mModern Abstractions and the Web, and avoiding Pitfalls because Life is short
27mPattern matching: The gateway to loving Elixir
47mElixir for curing product development pains?
47mElixir for curing product development pains
