Casing Conventions

These are the most common casing rules:






PascalCase is used in C# for classes and methods.

Java uses PascalCase for classes but camelCase for methods.

Elixir uses PascalCase for modules and snake_case for variables and functions.

CSS uses kebab-case.

Getting Started With Phoenix 1.4

These are the notes from working through the new version of the book.

Firstly Phoenix 1.4 has been released so the Phoenix install instructions are out of date so here is the update:

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.4.0


I also did not have postgres installed:

$ brew install postgres

initdb /usr/local/var/postgres

/usr/local/opt/postgres/bin/createuser -s postgres


This will get you to the end of the hello app.

Railway Oriented Programming

The common recommendation in Elixir is to let it crash (more accurately it is let a supervisor handle the error ). This is normally the case when you have small processes.

There is another pattern that can be used.

If all of your functions return {:ok, something} or {:error, reason} then technically the function is a Monad. This allows pipelines in which data and errors can be passed through cleanly.

Railway oriented programming takes this a stage further by having defined pipelines that have a good and an error route. It is possible for errors to be handled and returned to the good track. 

Things worth studying in Elixir

It’s worth looking over the basics libraries of a language from time to time to see if you have missed anything useful.

For example Elixir has the very useful:

This allows you to map some data then join it together as a single operation.

This finds the smallest and largest items in an Enumerable by a given definition.

This splits a string on a pattern and allows you to drop the empty elements. This is especially useful if there are patterns that you want to filter out as well. One iteration will split and remove the irrelevant items.