Phoenix

Phoenix is a web framework developed in the Elixir programming language, designed for high-concurrency and real-time applications. It’s less batteries-included than Rails or Laravel but still has all of the essential features a modern web application requires.

The Ecto library, responsible for data validation and persistence, is a functional take on a traditional ORM. It’s a breath of fresh air for anyone accustomed to dealing with the vagaries of active record approaches, such as Laravel’s Eloquent.

LiveView, another popular library, allows developers to build rich, interactive web applications without writing JavaScript. By keeping complex logic on the server and communicating with the client over WebSockets, LiveView makes implementing sophisticated real-time features much more straightforward.

The following articles delve into the practical realities of working with the Phoenix ecosystem. They’re a great way to delve deeper if you’ve already mastered the basics.

Naming Phoenix context functions

In a Phoenix context we frequently need to create and update resources, using changesets. Each operation requires a function to get the changeset, and a function to perform the operation.

If the operation in question is "create", the standard approach is to name the changeset function create_changeset, but that's just confusing; am I getting a changeset for the "create" operation, or am I creating a generic changeset?

I prefer the following conventions.

Keep reading”Naming Phoenix context functions”

Sign up for my newsletter

A monthly round-up of blog posts, projects, and internet oddments.