version 3
Angelika Tyborska
Hi! I'm Angelika
Hi! I'm Angelika. I'm a web developer. I have been working with Elixir **since 2017**.
During the day, I work at Steady. Steady is a German start up that runs a platform where independent content creators can start a new project and publish content for free or fund an existing project by selling memberships.
We have a beautiful Phoenix monolith and a few smaller apps. All of our backend code is in Elixir.
But that's not what I'm here to talk about. In my free time, I volunteer at Exercism.
Exercism history
2013: v1
2018: v2
2021: v3
You might have heard about Exercism before. It has been around since 2013.
Exercism is a platform for code practice and mentorship. It was created by Katrina Owen as a tool for her students, and it grew to be so much more. **In v1**, it was just a collection of interesting Practice Exercises. **In v2**, it became a platform for free code mentorship.
Last week, on the **1st of September**, Exercism version 3 was released.
v3 🚀 01.09.2021
Today, I will talk you through the changes in v3, explain why they were made and how they will improve your experience on Exercism.
I believe that in its new form, it has the potential to become **the best tool for learning new programming languages, and the Elixir track is leading the way**.
But **why** should you **care**?
**If** you're just **beginning** your journey with Elixir, you can use Exercism to gain fluency and receive mentorship.
**If** you're **fluent** in Elixir already, you can use Exercism to improve your soft skills and find gaps in your knowledge by becoming a mentor and helping others.
And regardless of your level in Elixir or any other programming language, if you believe in free education for everyone, you can help us build and maintain the platform.
Slides
angelika.me/elixir-conf-eu-2021
Before we jump into the topic, I wanted to tell you **where to find the slides** in case you need to take a second look at them later.
They are available online at angelika.me/elixir-conf-eu-2021.
We should have some time after the talk for questions. But if we run out of time, or if you don't feel comfortable asking in front of everybody, feel free to reach out to me. **The last slide** will contain **my contact information**.
Now, let's start with the basics of Exercism, for those of you in the audience who never used it before.
What is Exercism?
code practice
mentorship
free and open source
TDD
over 50 different languages
What is Exercism?
Exercism is a platform for code practice and mentorship.
It's available to anyone, it's free, it's open source and run by volunteers. It's welcoming, friendly, not competitive. It encourages **test-driven development** by offering a detailed test suite for each exercise, but it doesn't benchmark your solutions. There are no scores and leader boards. You can practice over 50 different programming languages on Exercism, Elixir being one of them.
How it works
Download an exercise
Solve the exercise
Upload your solution
Talk with a mentor (optional)
Compare with others (optional)
How does it work? At the core of Exercism, there are **Practice Exercises**. Practice Exercises consist of a **single problem**, for example: changing integers to roman numerals, scoring a bowling game, or implementing the Caesar cipher.
Popular tracks like Ruby, Python, JavaScript, and Elixir have **over 100** different Practice Exercises each.
Once you find an exercise on the platform that interest you, you download it to your computer, solve it, and upload your solution back to the platform.
1. Download an exercise
exercism download --track elixir --exercise bob
Step 1: download an exercise
To download an exercise, you need the Exercism's Command Line Interface.
The download command needs to be told which track you want, which means the programming language, and which exercise.
2. Solve the exercise
bob
├── .formatter.exs
├── HELP.md
├── README.md
├── lib
│ └── bob.ex
├── mix.exs
└── test
├── bob_test.exs
└── test_helper.exs
Step 2: Solve the exercise
Every Elixir exercise is a **tiny mix project**. The README file is the first one you should read. It contains instructions specific to the exercise. The HELP file contains general instructions on how to run the tests and how to submit your solution.
Test suite
defmodule BobTest do
use ExUnit.Case
test "stating something" do
assert Bob.hey("Tom-ay-to.") == "Whatever."
end
@tag :pending
test "shouting" do
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
end
# ...
end
Each exercise comes with a full test suite. Your **goal** is to make all of the **tests pass**. Very often, the exercise description in the README file is very simple, but the tests define all of the corner cases that you need to cover.
Solution stub
defmodule Bob do
@spec hey(String.t()) :: String.t()
def hey(input) do
end
end
To help you get started, there is usually a **solution stub**. That's where you need to add the missing implementation.
Solving a practice exercise can take you anything from **5 minutes to 5 hours**, depending on how fluent you are in a given programming language and how difficult the exercise is.
3. Upload your solution
exercism submit lib/bob.ex
Step 3.
Once you're done, when all of the tests are passing, you submit your solution to the platform using the CLI again.
How it works
Download an exercise
Solve the exercise
Upload your solution
Talk with a mentor (optional)
Compare with others (optional)
If you wanted, you could stop there. But the real value of Exercism is in steps 4 and 5.
4. Talk with a mentor
Step 4: talk with a mentor.
You can submit your solution for mentoring. The mentor will read your solution, **suggest improvements** and try to help you understand the language better. You can also ask the mentor specific questions if you want. All the mentors on Exercism are **volunteers**.
The wait times for mentoring on the Elixir track are relatively low thanks to...
Chris Eyre who is doing like 80% of all the mentoring on the Elixir track. Thank you Chris, if you're listening.
5. Compare with others
Another way to learn from other people on Exercism is...
Step 5: comparing your solution with other solutions
Each exercise has been already solved by **tens or hundreds of other students**. And you can browse all of those solutions.
You will be surprised to learn about all the different approaches you can use to solve the same problem.
How it works
Download an exercise
Solve the exercise
Upload your solution
Talk with a mentor (optional)
Compare with others (optional)
When you're done with one exercise, you can solve another one, and another one, and another...
Now that we all know have a basic understanding of how Exercism works, **let's jump into the main topic.**
What is new in v3?
What is new in v3? Short answer: A lot.
All major changes introduced in v3 are meant to address the biggest problems that people experienced in v2.
Problems in v2
Difficult initial setup
Code practice without learning
Long mentor response time
There are three _key_ problems that v3 addresses:
- one: difficult initial setup
- two: code practice without learning
- three: long mentor response time
Let's take a closer look at all of them.
Problem number one: difficult initial setup. To start with Exercism, you need to install the Exercism **CLI**, the programming language that you want to try, you need to feel comfortable in the **terminal**, you need to configure your editor to do syntax coloring for the new language. For **advanced** developers, all of that setup is an **inconvenient time sink**. For **beginners**, it can be a hurdle impossible to overcome.
1. Difficult initial setup
Solution: let people code in the browser
Web editor (optional)
Test Runners
The solution: let people code in the browser. No initial setup necessary.
To facilitate this, Exercism has now a web editor, and each programming language has its own test runner dedicated to running tests for Exercism exercises.
Web editor
This is the web editor. It has **two panels**, the source code on the left and the instructions and test suite on the right.
It does **not have any fancy features** because its goal is not to be a replacement for your favorite tools. Its goal is to let you **postpone installing** all the necessary tools and dependencies until after you feel more comfortable with the new programming language and you know you want to continue working with it.
The web editor is entirely **optional**. You can continue using the CLI and work with your favorite tools on your own computer.
Test Runners
For the web editor to be usable, there needs to be a way to run the tests against the solution that you write in the browser. This is the job of a test runner. Each language has its own test runner.
The test runner is responsible for reporting test results, but that's not all. It also needs to **extract the test's body** so that you know what code is being executed so that you can interpret the failure message, and also **capture the test's output** so that you can debug your code in the browser **using IO.inspect**.
Test Runners are crucial for solving exercises in the browser, but they will also be used on solutions submitted via the CLI. When browsing community solutions for a given exercise, or when mentoring a student, you can see if the solution passes the tests without having to download it and execute locally.
Problems in v2
Difficult initial setup
Code practice without learning
Long mentor response time
Problem number two: Exercism is a platform for code practice, but it didn't offer any resources for learning a specific language from scratch. You had to do that somewhere else first.
Exercises on Exercism were designed to be **interesting and challenging**, but sometimes even the easiest ones are **too difficult to be an entry point** to a new programming language. This is especially true when you're trying to learn a language with a completely different syntax or even using a different programming paradigm.
2. Code practice without learning
Solution: offer learning
Syllabus (optional)
Learning Exercises (optional)
The solution: offer learning alongside practice. With the addition of the Syllabus and Learning Exercises, Exercism has now become an excellent tool to dive right into a new programming language.
Syllabus
What is a Syllabus? A Syllabus is a **tree of Concepts** that make up each programming language. The Syllabus is unique to each track on Exercism because each programming language is different and has different Concepts. The **Concepts depend on one another**, forming various branches of the tree. You need to learn the previous concept in the branch to **unlock** the next concept.
For example, this is the beginning of the Elixir Syllabus. It starts with a concept called "basics", which covers: how to define a module, how to define a named function, and where to find the documentation for the standard library. This knowledge is necessary for every single Exercism exercise. You need to learn basics to unlock any other concept.
Then, you can learn about for example booleans, and once you know booleans, you can learn about the `cond` expression, and so on.
Syllabus
For perspective, this is the full Elixir Syllabus. At the moment, it contains **over 50 Concepts**, but it still needs to be extended.
At the **top**, you will find Concepts such as: strings, lists, maps, and tuples.
In the **middle**, there's: the enum module, regular expressions, structs, and writing typespecs.
And at the **end**, there's: protocols, processes, tasks, and how to use Erlang libraries.
Learning Exercises
You learn Concepts from the Syllabus by solving Learning Exercises. Learning Exercises are different than Practice Exercises. They were **designed** to teach programming concepts to students that don't know the specific programming language at all, but do know at least one other language and basic programming concepts.
Learning Exercises - introduction
Each learning exercise starts with an **introduction**. The introduction describes basic information about the Concepts that this exercise teaches. Most Learning Exercises teach a single concept, but there are exceptions.
This example shows an introduction about Elixir maps. It explains what maps are, how to define a map, how to access a value in a map and so on. It contains some code examples to show new syntax, but it doesn't contain too many so that you **cannot** just **copy-paste** the introduction to solve the exercise.
Learning Exercises - instructions
Then, there are **instructions**. Instructions for Learning Exercises are split into **small tasks**. The tasks were designed to nudge the student into using the most crucial parts of any given concept. For example, the learning exercise that teaches maps will have the student create a map, then read a value from a map, then update a value in a map, then get all keys from a map and so on.
There is a story to each learning exercise, but **the story is not that important**. It's there so that you don't have to use nonsensical values "foo bar" and "1 2 3" in every exercise, but it doesn't play a big role in the exercise like it does in Practice Exercises.
Learning Exercises - hints
Each task comes with a small list of hints in case the student gets stuck. The hints often reveal which specific function to use in which task and lead you to the documentation for that function.
Practicing Concepts
But solving a single learning exercise is not enough to really master the **concept**. You need to **practice** it too. That's why we reviewed all of the Practice Exercises that already existed in v2 and chose a few that can be used to practice each concept.
This is how a single concept looks like in the tree. The dots represent exercises. The first dot with the light bulb icon is a learning exercise. The other dots are Practice Exercises.
Practicing Concepts
This is how a concept looks like after solving a few exercises. Note how some of the Practice Exercises for this concept are still locked, even though the learning exercise is completed. This is because **Practice Exercises are not limited to practicing a single concept**. Some of them are very complex. You might need to learn more Concepts than just atoms before those exercises get unlocked.
If the Syllabus and Learning Exercises sound **boring** to you, you're right! Learning Exercises are supposed to be trivial for people that are already fluent in a given language. But don't worry, they are entirely **optional**. You can switch from learning mode to practice mode, which will give you instant access to all of the interesting Practice Exercises without having to work through the Syllabus first.
Syllabus = huge effort
One important detail that I have to mention in order to manage your expectations is that developing the Syllabus is a HUUUGE effort. Not every track has enough active maintainers to be able to have a Syllabus ready right now. Right now, Learning Exercises are only available in:
Common Lisp, C Sharp, Elm, Elixir, F Sharp, Go, Java, JavaScript, (skip Julia), Python, Ruby, Rust, and Swift.
The Julia track will launch its Syllabus soon.
Problems in v2
Difficult initial setup
Code practice without learning
Long mentor response time
Problem number three: long mentor response time.
Not every track has enough mentors. Some tracks have so few mentors that the waiting time for mentoring can be up to a month. This has always been **extremely discouraging** to students. It's such a core issue to Exercism, that it's getting addressed from **3 different angles**.
3. Long mentor response time
Solution 1: provide automated feedback
Analyzers
Representers (coming soon)
Solution number 1: provide automated feedback.
A lot of feedback that mentors write to students is repetitive. Being able to detect common mistakes automatically and report them to the student directly is a game changer.
Getting automated feedback about common mistakes will allow the student to improve their solution even before asking for mentoring, which will also make the mentor's job easier. It will save the mentor from having to mention tedious details like snake_case vs camelCase and focus on the essence of the solution.
In some cases, the automated feedback will be enough to satisfy the student and they won't even request mentoring at all.
In v3, there are two types of tools for automated feedback: Analyzers and Representers.
Analyzers
The Analyzer is a tool that looks for specific characteristics in a solution and returns to the student a list of **predefined comments** about what it finds. What characteristics, that depends entirely on the language and the specific exercise.
For example, one of the checks that the Elixir Analyzer does for every single exercise is checking all the variable names and function names. If it finds a name that is not written using snake_case, it will remind the student about the naming convention.
Analyzers
assert_no_call "does not call any Enum functions" do
type :essential
called_fn module: Enum, name: :_
comment Constants.bird_count_use_recursion()
end
The Elixir Analyzer has its own **DSL** that makes searching for specific patterns in the AST easier. Here is an example of an Analyzer check that expects the solution **not to use** any functions from the **Enum module**.
Analyzers
This check for not using the Enum module is specific to the learning exercise for recursion. Using the Enum module defeats **the purpose of the exercise**, but it's something that cannot be detected with a simple unit test.
Representers
def placeholder_1(placeholder_2) do
"Hello, #{placeholder_2}"
end
def placeholder_1() do
placeholder_1("Alice")
end
The second tool that will help us with providing automated feedback on Exercism is the Representer.
The Representer takes the solution and removes the non-essential parts. It **normalizes formatting, removes comments and documentation**, it replaces function and variable **names with placeholders**.
The output of the Representer is called a representation. Each solution submitted to Exercism with be passed to the Representer and its representation will be stored on the platform along with the solution.
Representers
Representation
def placeholder_1(placeholder_2) do
"Hello, #{placeholder_2}"
end
def placeholder_1() do
placeholder_1("Alice")
end
Feedback
Consider using a [default argument](https://elixir-lang.org/getting-started/modules-and-functions.html#default-arguments)
with the value `"Alice"` instead of
defining a separate function clause.
Save
Mentors will then have access to an interface where they can browse representations of submitted solutions. For each unique representation, a mentor can leave feedback on that representation. Then, that feedback will be presented to _every student_ that submits a similar solution that has the same representation. A mentor only has to provide feedback once and the feedback can reach everyone that needs it.
Representers
UI coming soon
Representers themselves are already implemented and deployed for some languages, but the interface for mentors is still missing from the platform, so we need to wait a bit until this feature is available.
3. Long mentor response time
Solution 2: avoid unwanted sessions
Learning Exercises
Always optional
Must be requested explicitly
Initial comment from student
Favorite and block lists
Another solution to a long mentoring queue is to avoid unwanted mentoring sessions.
In v2, mentoring was required for so-called **"core" exercises**. Submitting a core exercise meant that you automatically request mentoring, and you couldn't progress to the next core exercise without mentor approval. A lot of students would learn the language by working through the core exercises, so they needed the mentoring to guide them through the **learning process**.
This is no longer the case. The **teaching role** of core exercises and mentor approval has been **taken over by Learning Exercises** and Analyzers. In v3, mentoring is always optional and must be requested explicitly.
Mentoring request
To request mentoring, you need to answer 2 questions:
What are you hoping to learn from this track?
How can a mentor help you with your solution?
By knowing beforehand what are the **student's expectations** from the mentoring session, the mentor can pick those mentoring requests that fit their knowledge and mentoring style best, which makes it more likely that both parties will leave the mentoring session satisfied.
Mentoring queue & favorites
In the new mentoring queue, mentors will be able to see statistics about the **student's mentoring history**.
They will see which student was never mentored before and might need a more careful review, and which student has been through mentoring many times and understands how it works. Mentors will also be finally able to find students that they mentored before and develop relationships with specific students. Mentors can even add students to **favorites** and use that to prioritize mentoring students with which they previously had a good experience.
Block lists
exercism.org/report-abuse
After each mentoring session, both the student and the mentor have an option of **blocking** the other person. Each user has **two block lists**, blocked students and blocked mentors. The other person will of course have no idea that they were blocked so they cannot retaliate against you. You can choose to block somebody for any reason, but if they are breaking the **Code of Conduct**, please make sure to also report them explicitly to protect other users.
3. Long mentor response time
Solution 3: mitigate consequences
Does not block progress
Can be ended by either side
Mentoring slots
Finally, the last step of dealing with the problem of long wait times is to ensure that even though you need to wait, the negative consequences of the waiting are minimal.
In v3, waiting for mentoring does not stop you from solving other exercises. You can still progress through the track.
A mentoring session can be ended by either side. If you're a student and you don't like the approach a particular mentor is taking with you, you can always ask for a different approach, or you can choose to leave the session. Regardless of how the mentoring session ends, **the student can request a new mentoring session with another mentor** for the same solution.
Mentoring slots
For each track, you can have from 1 to 4 mentoring slots. Having multiple mentoring slots can help when you want to request mentoring for a difficult exercise that is less likely to get mentored fast, while still be able to get mentoring on other exercises at the same time. Mentoring slots can be unlocked by gaining reputation.
Reputation is awarded for publishing your solutions for everyone to browse, mentoring students, and contributing to any of the Exercism's repositories. This means that students that contribute more to the platform can get more mentoring.
Problems in v2
Difficult initial setup
Code practice without learning
Long mentor response time
Those are all the major ways in which Exercism has changed on the first of September 2021.
We added Learning Exercises so that you can learn without leaving the platform, a web editor so that you can code without installing anything, and Analyzers and Representers to that you can get immediate automated feedback. We also removed a lot of frustrating blockers from the mentoring process.
But our work on the platform is **far from finished**.
How to help?
Exercism is a not-for-profit organization that relies on its volunteers.
Anyone can help, and every little bit of help counts.
If you like what you heard today, here's how you too can help the platform grow.
1. Join the platform
exercism.org
Step 1: Join the platform
Become a student on Exercism. Solve exercises. Find bugs. Suggest improvements. Have fun and tell your friends about it!
2. Become a mentor
exercism.org/mentoring
Step 2: Become a mentor
Each track could always use one more mentor.
It's a free opportunity for you to tip your toes into mentoring and level up your soft skills without making a big commitment.
You can practice giving thoughtful code reviews and discover gaps in our own technical knowledge by teaching others.
3. Donate money
exercism.org/donate
Step 3: Donate money
Running a platform like this one costs money. Exercism relies on donations, big and small, to keep running.
**If** Exercism added some value to your life and **your financial situation allows it**, please consider making a donation. Both one-time and recurring donations help.
4. Contribute code & content
exercism.org/contributing
Step 4: Contribute code & content
There are almost 300 repositories on GitHub that make up Exercism and almost every one of them could use additional contributions.
There's a page on Exercism dedicated to discovering open GitHub issues that are waiting for somebody to work on them.
The issues can be **filtered** by different criteria so that you can find the right task for you. **Some of them require coding, some require configuring Github workflows or writing Docker images, others writing content and creating exercises.**
If you want to contribute to open source in a way that will help hundreds of people, this is a good start.
Elixir Exercism repositories
If you want to contribute code to the Elixir track, those are all of the repositories that make up the track.
exercism/elixir contains the exercises,
and the rest contain the corresponding tools I talked about today: Test Runner, Analyzer, and Representer.
Come over and browse the open issues.
Elixir maintainers
Tim Austin
Saskatoon, Canada
Jérémie Gillet
Okinawa, Japan
Angelika Tyborska
Berlin, Germany
If you ever open an issue or a pull request in one of the Elixir repositories, you're likely to get a response from Tim, Jeremie, or from me. We're the current Elixir track maintainers. There have been others before us, but we're the ones currently active. **Tim and I are the ones that worked together for over a year to create over 30 Learning Exercises** for Elixir. **Without Tim, I would not be standing and speaking here today**. Jeremie joined us more recently and he's currently putting a lot of effort into making the Analyzer better.
Not just Elixir
Of course Exercism is not just about Elixir.
There are more than 50 different programming languages on Exercism. More than I could fit on this slide.
Some don't have an Analyzer and Representer yet. Some are missing a few crucial Learning Exercises. Others don't have a Syllabus at all yet. Every single one could use some more help. Your help. (pause)
Contact
If you have any questions about anything I talked about today, you can reach me in one of the following ways:
- on Twitter, I'm @atyborska93
- you can write me an email to hello@angelika.me
- the slides are available at angelika.me/elixir-conf-eu-2021
- or visit my blog at angelika.me where you will find all this information as well
We can also talk in person during the conference. If you want an Exercism laptop sticker, come over and say hi.
That is all that I prepared for you today. Thank you.