coen.bakker

coen.bakker

Elixirland - a collection of assignments, each with an idiomatic example solution

Since I started using Elixir, I have benefited greatly from being able to study various open-source projects. The codebase of LiveBook, in particular, has been a valuable resource for me. However, I also found that having access to a broader range of projects would have been even more beneficial (and from what I gather I am not to only one!).

This is what drove me to create Elixirland — a collection of assignments, each with an idiomatic example solution, intended as a learning resource. The goal is to provide learners with a diverse range of open-source solutions to well-defined problems (i.e., the assignments) and to encourage community discussions around these solutions.

Currently, my focus is on making a few assignments public to get the ball rolling. Over time, and with your feedback, the assignment descriptions and example solutions will be improved. Ensuring that the code in the examples is indeed idiomatic is important, though early versions may need refinement.

One challenge I anticipate is addressing the varying levels of consensus on what is “the right way” of solving different parts of an assignment. My aim is to implement Elixirland in a way that helps users understand where consensus is strong and where is might be weaker. Over time, I will be able to focus more on tackling this aspect.

Go to elixirland (Elixirland) · GitHub to find out more about Elixirland.

Currently, one assignment is public. It’s called Xl Phoenix API and can be found here: GitHub - elixirland/xlp-book-club-API: Build a simple web API for a book club with Phoenix.. As you can see, writing tests and documentation are also part of the assignment.

Contributions are welcome.

P.S. Elixirland will also be accessible at https://elixirland.dev. Coming soon. I’ll post when online.

Most Liked

D4no0

D4no0

OK, this is extremely neat, I was thinking of doing something like this but by breaking bigger projects into smaller pieces.

I am ready to be a full contributor, count me in.

D4no0

D4no0

Even without junior or mid elixir jobs, you can cry in 90% of cases when looking at a elixir codebase that was written by someone that switched to elixir and still writes in the way it used to in their previous languages, and there are countless cases when this happens in companies, one of them I discovered recently.

The biggest value I see from this platform is teaching of how to write “standard” code, in a manner how credo enforces consistency at syntax level. At the same time this also means that the focus of the assignments should be on quality, not quantity. Each example should prove excellence in all aspects of what it makes a good codebase, namely: simplicity/clarity/documentation/tests.

coen.bakker

coen.bakker

A humble first version of https://elixirland.dev/ is now online.

barttenbrinke

barttenbrinke

I’d really like something like this but about telemetry. I understand technically how it works, but setting it up to be practical and actionable is beyond me apparently :slight_smile:

barttenbrinke

barttenbrinke

So, Phoenix / Elixir gives you a lot of tools to help you with breaking up big apps, there is:

  • Phoenix Contexts / Modules / Umbrella apps/ The fact that any file can live anywhere is great for Domain logic.
  • Phoenix pubsub for eventing / realtime communcation between parts
  • EXQ / background workers
  • OTP for singular state enforcement
  • Opus.Pipeline for workflows
  • Statemachines

et cetera. The core issue IMHO is the question “when should we use which part”, so that we:

  • Don’t make things even worse (ever tried debugging an app that is strung together with Pubsubs? Sideeffects with sideeffects)
  • Do not get stuck in refactor hell (lets change the wheels on a car while driving!).
  • Don’t get stuck in a Design Pattern hell (FactoryFactoryFactory).

I think you can teach all of the tools of the toolbox above, but knowing when to use what is mostly down to experience IMHO. My teacher used to call it “Navigating the swamp”.

Now that I think of it, you can probably make an example where you basically say “as an exercise it has been decided that in this case we will try and decrease the complexity of the app by using a Pubsub pattern”.

You would probably be able to create one single “complicated” example and have multiple possible solutions. Start with a SignupController that is 200 lines long.

  • Convert it to using Managers
  • Convert it to using Background workers where possible that update the frontend using Pubsub
  • Convert it to use a workflow
  • Convert it to use a statemachine …

Where Next?

Popular in Challenges Top

sneako
Note by the Moderators: This topic is to talk about the first day of the Advent of Code. For general discussion about the Advent of Code...
New
DmitriyChernyavskiy
Hello everyone, I’m a new in elexir and functional language. I’m trying to implement Websocket interraction with server. On first layer...
New
bjorng
This topic is about Day 5 of the Advent of Code 2021. We have a private leaderboard (shared with users of Erlang Forums ): https://adve...
New
bjorng
Note: This topic is to talk about Day 12 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can joi...
New
New
Aetherus
This topic is about Day 7 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/le...
New
bjorng
Note: This topic is to talk about Day 13 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can joi...
New
New
bjorng
This topic is about Day 18 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/l...
New
Qqwy
Note by the Moderators: This topic is to talk about Day 6 of the Advent of Code. For general discussion about the Advent of Code 2018 an...
New

Other popular topics Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement