Elixir Blog Posts

Pretty good article! And thanks a lot for the Fey library. I have looked for similar libraries and found several but they never quite went all the way. You have put attention to detail in yours and I love it. I will use it. Thanks!

Responding to your three main points in the article:

  1. Self-containing

This is fine and I understand it and somewhat like it but I think it has to be said that it’s also a bit of a forced point. With modern IDE tooling – including in the terminal with Neovim – you can jump backwards and forwards between function definitions all day long without losing focus. I get the appeal of everything being in one place and I also prefer it but have compromised on it long time ago because it’s not very often that we can get away with such small self-contained units. Private functions help a lot.

  1. Follows prepare-execute-format flow

This is kind of the same as item 1 IMO and same points apply; I do like it but it’s not often that I can practice it in my paid work.

  1. Using OCaml-like helpers

Should have also added Rust. :wink:

I love that item. I tried introducing libraries or home-grown macros but work teams were always adamant that they don’t want it. I see their point; the corresponding Elixir code is not difficult to grasp and is 100% explicit – this is a solid argument and I have yielded upon hearing it almost every time.

BUT.

Sometimes you can get away with a shorter function if you use stuff like Fey, and the code fits on a single screen and is more understandable.

I’ve met an awful lot of programmers who shrug and say “I’ll not forget what it does” which of course they do but various ego factors prevent them from ever connecting the dots, plus they often don’t account for future programmers and onboarding. The amount of senior devs onboarding me and looking embarrassed when we went through some particularly gnarly code pieces can fill an entire 12-hour comedy marathon.

I am not judging though. I understand how they arrive at that situation. But I would have avoided it by making use of such convenient wrappers like yours.

Again, thanks for Fey. I will absolutely use it.