Phoenix for Rails Developers – Part 1

I was lucky enough to win a copy of Phoenix for Rails Developers.

(Thanks to @plataformatec)

This gives me one more thing to study!

Oddly I am not a Rails developer (but have worked on a number of frameworks that were inspired by Rails).

So far I am working through the main examples and will post them here:

https://github.com/chriseyre2000/storex

I am developing this using Visual Studio Code.

Typically I also have two terminal tabs open.

The first is to run the application in:

mix phx.server

or

iex -S phx.server

The second is used for generator or to update git.

I am working with Elixir 1.6.4

So far the book is a gentle introduction to Phoenix. The language is introduced as needed.

It has stayed away from more complex Elixir topics (OTP).

When I have made typos the Elixir compiler will always tell you exactly where you have made the mistake, although it is not always obvious what the mistake was. The live reloading of the web application does allow for very rapid feedback. You do need to remember to restart the app on non-website changes.

The only catch that I have had so far is setting up Postgres locally. All other details have been clearly explained.

Equivalent Ecosystems: Groovy vs Elixir

Given that a little over two years ago I was a C# developer I have had to learn the JVM way of doing things fairly rapidly. Java does has many ways of solving things but these are those that I am familiar with:

Here is a map between the Java world and the Elixir world

JVM => BEAM

Gradle => Mix

https://search.maven.org/ => https://hex.pm

JUnit => ExUnit

JavaDoc => ExDoc

Dropwizard (or web framework of choice) => Phoenix

Jooq => Ecto

More Elixir on Windows

I am still working my way through the Programming Elixir book.

This time I am trying to get the sample issues app to work on Windows.

Elixir is fine on windows – its the HTTPoison library – it has dependencies that fail silently at compile time. Known issue

However the HTTPotion library does seem to work on windows. I have adapted the sample and have a github repo with this applied.

This is a similar problem to the Javascript/NPM world. Windows is treated as a second class citizen by some of the libraries which creates artificial constraints. Windows can be used as a development platform for more portable development (I use windows at home, ubuntu in the office and have a mac work laptop – I need portability).