Skip to content

Update config.json to match new specification #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kytrinyx opened this issue Aug 18, 2016 · 10 comments · Fixed by #476
Closed

Update config.json to match new specification #274

kytrinyx opened this issue Aug 18, 2016 · 10 comments · Fixed by #476

Comments

@kytrinyx
Copy link
Member

For the past three years, the ordering of exercises has been done based on gut feelings and wild guesses. As a result, the progression of the exercises has been somewhat haphazard.

In the past few months maintainers of several tracks have invested a great deal of time in analyzing what concepts various exercises require, and then reordering the tracks as a result of that analysis.

It would be useful to bake this data into the track configuration so that we can adjust it over time as we learn more about each exercise.

To this end, we've decided to add a new key exercises in the config.json file, and deprecate the problems key.

See exercism/discussions#60 for details about this decision.

Note that we will not be removing the problems key at this time, as this would break the website and a number of tools.

The process for deprecating the old problems array will be:

  • Update all of the track configs to contain the new exercises key, with whatever data we have.
  • Simultaneously change the website and tools to support both formats.
  • Once all of the tracks have added the exercises key, remove support for the old key in the site and tools.
  • Remove the old key from all of the track configs.

In the new format, each exercise is a JSON object with three properties:

  • slug: the identifier of the exercise
  • difficulty: a number from 1 to 10 where 1 is the easiest and 10 is the most difficult
  • topics: an array of strings describing topics relevant to the exercise. We maintain
    a list of common topics at https://github.com/exercism/x-common/blob/master/TOPICS.txt. Do not feel like you need to restrict yourself to this list;
    it's only there so that we don't end up with 20 variations on the same topic. Each
    language is different, and there will likely be topics specific to each language that will
    not make it onto the list.

The difficulty rating can be a very rough estimate.

The topics array can be empty if this analysis has not yet been done.

Example:

"exercises": [
  {
    "slug": "hello-world" ,
    "difficulty": 1,
    "topics": [
        "control-flow (if-statements)",
        "optional values",
        "text formatting"
    ]
  },
  {
    "difficulty": 3,
    "slug": "anagram",
    "topics": [
        "strings",
        "filtering"
    ]
  },
  {
    "difficulty": 10,
    "slug": "forth",
    "topics": [
        "parsing",
        "transforming",
        "stacks"
    ]
  }
]

It may be worth making the change in several passes:

  1. Add the exercises key with the array of objects, where difficulty is 1 and topics is empty.
  2. Update the difficulty settings to reflect a more accurate guess.
  3. Add topics (perhaps one-by-one, in separate pull requests, in order to have useful discussions about each exercise).
@rbasso
Copy link
Contributor

rbasso commented Sep 18, 2016

I'll keep this PR open until we finish at least the first two - maybe all - of the three proposed stages:

  • Add the exercises key with the array of objects, where difficulty is 1 and topics is empty.
  • Update the difficulty settings to reflect a more accurate guess.
  • Add topics (perhaps one-by-one, in separate pull requests, in order to have useful discussions about each exercise).

Now that we finished stage 1 of the migration, it is time to give approximate difficulties to all the exercises (stage 2). 😄

@rbasso
Copy link
Contributor

rbasso commented Oct 13, 2016

I'll just paste here an unfinished exercise's classification, so that in the future I, or someone else, can continue from where I stopped.

triangle                    { Math (Triangles       ) }
leap                        { Math (Integer division) }
difference-of-squares       { Math }
ocr-numbers                 { Strings }
pig-latin                   { Strings }
series                      { Lists, Strings }
crypto-square               { Lists, Strings }
anagram                     { Lists, Strings }
beer-song                   { Lists, Strings, Refactoring }
house                       { Lists, Strings, Refactoring }
food-chain                  { Lists, Strings, Refactoring }
kindergarten-garden         { Lists, Strings, Maps }
scrabble-score              { Lists, Strings, Maps? }
bob                         { String, Parsing }
sum-of-multiples            { Lists, Math (Factors            ) }
luhn                        { Lists, Math (Integer division   ) }
palindrome-products         { Lists, Math (Palindromic numbers) }
prime-factors               { Lists, Math (Prime numbers      ) }
pascals-triangle            { Lists, Math (Pascal's Triangle  ) }
sieve                       { Lists, Math (Prime numbers      ) }
raindrops math              { Strings, Math (Integer division) }
largest-series-product      { Strings, Maybe }
queen-attack                { Strings, Maybe }
grains                      { Math, Maybe }
hamming                     { Lists, Maybe }
atbash-cipher               { Lists, String, Maybe }
allergies                   { Enumerates, Deriving type-classes, Math (Numeric encoding), Lists }
all-your-base               { Math (Numeric encoding), Lists, Folding, Maybe }
binary-search-tree          { Data Structures (Binary Tree), ADTs, Deriving type-classes, Folding, Recursion, Maybe }
clock                       { ADT, Deriving type-classes, Instantiating type-classes, Math (Integer division) }
custom-set                  { Lists, ADT, Deriving type-classes, Library reimplementation }
word-count                  { Strings, Maps }
etl                         { Strings, Lists, Folding, Maps }
lens-person                 { Lenses, Record-syntax, Calendar }
accumulate                  { Lists, Recursion, Library reimplementation, Lazy evalutation }
list-ops                    { Lists, Folding, Library reimplementation }
nth-prime math, filter      { Maybe, Lists, Math (Prime numbers) }
nucleotide-count            { Either, Maps, Strings }
parallel-letter-frequency   { Maps, Text, Parallelism }
phone-number                { Maybe, Strings }
rna-transcription           { Pattern matching, Lists, Maybe }
roman-numerals              { Strings, Maybe, Math (Numeric encoding) }
saddle-points               { Arrays, Lists, Math (Saddle Points) }
say                         { Strings, Math (Numeric decomposition), Maybe }
secret-handshake            { Typeclass (Creating a typeclass and instances), Strings, Math (Binary Encoding) }
sgf-parsing                 { Data Structures (Tree, Map), Maybe, Text, Parsing }
space-age                   { ADT }
grade-school                { ADT, Maps, Sets, Lists }
meetup                      { ADT, Calendar }
robot-simulator             { ADT, Strings }
sublist                     { ADT, Lists }
pythagorean-triplet         { ADT, Lists, Deriving typeclasses, Math (Pythagorean triples) }
simple-linked-list          { ADT, Library reimplementation, Lists, Folding }
matrix                      { ADT, Deriving typeclasses, Vector }
bank-account                { ADT, IO Monad, Maybe, Mutable State }
linked-list                 { ADT, IO Monad, Maybe, Mutable State }
robot-name                  { ADT, IO Monad, Mutable State, Random }
simple-cipher               { Strings, IO Monad, Random numbers }
strain                      { Library reimplementation, Recursion, Non-strictness, Folding? }
wordy                       { Parsing, Maybe, Strings }
change                      { Math (Knapsack type problem), Maybe, Lists }
minesweeper                 { Grids, Strings, Lists }
zipper                      { Zippers, Maybe }
pov                         { Data Structures (Trees), Zippers, Maybe }
connect                     { Graphs (Undirected graph), Strings, Lists, Grids, Maybe }
forth                       { ADT, Deriving type-classes, Text, Strings, Either, Maps, Parsing }
go-counting                 { Strings, Lists, Sets, Maybe, Graphs (undirected graphs), Grids }

@petertseng
Copy link
Member

I found an old list I made at #193 (comment) , I might take a look at it sometime and see whether that has any useful information thta can go here.

@rbasso
Copy link
Contributor

rbasso commented Oct 19, 2016

This list of topics I made was initially based on you previous classification. Forgot to give the credits, sorry! 😄

@petertseng
Copy link
Member

Sometimes I feel like just taking the #274 (comment) list and adding it to the config.json, unmodified, just so that we can say this got done.

But other than the satisfaction of being able to close the issue, there is too little incentive to get this task done. The topics don't show on the site, so the only possible benefit is maybe we can reorder the exercises based on what we observe from the topics.

But we already reordered the exercises on difficulty, so we may not gain much from that.

Being able to reorder the exercises in a reasonable way was what gave the incentive to add the difficulty ratings, of course.

@kytrinyx
Copy link
Member Author

@petertseng Let's do this without the difficulty rating. We aren't using it for anything yet, and when we do we'll be way more motivated to actually add them.

@petertseng
Copy link
Member

Sometimes I would like to know - all the exercises in this track that use Maybe. All the exercises that use Result. All that use algebraic data types. Today, I would use grep for this. But maybe we can put it in the topics section. But fear that it will get out of date! But maybe it's time to let go of that fear. After all, how often does the list of problems change?

Or you know a crazy dream of mine? That at least these elements of the topics section can be automated.

@petertseng
Copy link
Member

petertseng commented Jan 30, 2017

By the way, I hope I don't sound too harsh or critical.

I say that because a very pessimistic reading of my comment is that I am complaining that higher powers have handed down a task of no benefit and that I am in active rebellion against the task. Now, I don't think that anyone is going to read it that pessimistically, but I could believe that someone will read it slightly pessimistically.


What I see here is:

  • The task has a few subtasks: use exercises not problems, add difficulties, add topics.
  • One large benefit to be gained is the ability to order the exercises intelligently.
  • We gained that benefit! We have benefitted from this issue being filed!
  • But we gained it by only doing some of the subtasks. What do we do with the remaining ones?
  • Given we have limited time and need to prioritise, we may have to wait until the topics are more widely used across different tracks so we can understand the further benefits.

At this time, I decided to add a few topics that I feel the track will derive benefit from. Then I propose we can consider this issue complete.

@kytrinyx
Copy link
Member Author

It didn't sound pessimistic to me. I think it was opportunistic to consider adding the difficulty ratings, but more practical to not do so right now. I'd like to be able to intelligently order exercises better, and I suspect that we might do so eventually (and maybe not with the difficulty rating).

petertseng added a commit that referenced this issue Jan 30, 2017
While evaluating that a proposed hello-world exercise in #475 would
introduce Maybe into the track at the first exercise, I found myself
wondering what other exercises introduce Maybe. I decided to put this,
and select other topics, into the config.json file.

The topics selected are, largely, those that might affect a problem
ordering decision. They are topics that either require some effort to
grasp (so we should not put them too early) and/or are repetitive (so we
should not place them too close together).

* Maybe
* Either
* Lazy evaluation
* Define a data type
* Library reimplementation
* Refactoring
* Accumulator-strictness
* instance TC (where TC is any typeclass other than Eq or Show)
* IO Monad
  * Random
  * Mutable state

Closes #274.
@petertseng
Copy link
Member

petertseng commented Jan 30, 2017

It is a little unfortunate to leave the work in #274 (comment) hanging, but I felt that trying to maintain all that information would require a lot of mental effort and not enough benefit.

But my hope is that if the time comes to flesh out the topics, we can revisit that work, since I imagine things will not have changed too much with the exercises. We can also add more topics as time goes by, if we see that they are relevant to making ordering decisions.

An implicit consequence of the way this was done: The current topics in config.json would be of use for students if suddenly they were appear on the website today, but the primary use is for track maintainers so that we can understand our problem ordering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants