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

bjorng
This topic is about Day 14 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/l...
New
ehayun
I have 2 arrays: a1 can be any combination of value or nil like that a1 = [1,nil,3] and array 2 the same a2 = [4,2, nil] How do I com...
New
New
Aetherus
This topic is about Day 4 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/le...
New
New
New
bjorng
Here is my solution for day 1 of Advent of Code: defmodule Day01 do def part1(input) do all = parse(input) {first, second} = E...
New
bjorng
Note: This topic is to talk about Day 4 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can join...
New
cblavier
Hi, there :wave: Today, I felt it was way more challenging! I went through part2 thanks to Agent based memoization (without memoization ...
New
rvnash
Anyone have a solution to Part 2 today? Part 1 was straight forward, but I can’t figure out a programatic way to do part 2. I understand ...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New

We're in Beta

About us Mission Statement