What's the difference between "practices" and "prerequisites" arrays for a practice exercises in config.json?

“practices” controls which concepts(s) the practice exercise appears with on the syllabus.
“prerequisites” controls when the exercise gets unlocked.

Why would I want different contents in each array?

What’s best practice?

I don’t find the documentation particularly illuminating.

Exercises in the practices list appear on the Concept page (e.g. on the side of Numbers in Python on Exercism). They are also the exercises that appear on the Concept map. So these are exercises where completing the exercise will actively help that skill development - for example, an exercise like TwoFer would be good for practicing optional parameters (in many languages anyway).

Prerequisites are the things that are actually needed to solve that exercise, but might not be targeted by that exercise explicitly. So for example, a Practice exercise that happens to use strings but wouldn’t be great practice of strings should specify it as a prerequisite but not as a practice.

Finally, a concept should be tagged in no more than 10 practice keys (from memory) so as not to make the UI look terrible and overwhelm the student.


Also, agree the docs could be lots clearer on this! I’ve just looked and found Practice Exercises | Exercism's Docs (which hopefully says the same as I what I just said), but at least hyperlinking to those would probably be wise by us.

2 Likes