Problem-specifications: Don't assume two-fer is the second exercise.

Created on 12 Oct 2017  路  10Comments  路  Source: exercism/problem-specifications

Ref. exercism/bash#86

Don't assume two-fer is the second exercise. Remove the section on test driven development and maybe put it somewhere else? What is the consensus on this?

Most helpful comment

Here are the tracks that have two-fer, and two-fer's zero-indexed position in each:

gems/trackler-2.2.1.45$ for t in tracks/*; do ruby -rjson -e "i = JSON.parse(File.read('$t/config.json'))['exercises'].index { |e| e['slug'] == 'two-fer' }; puts '%20s: %d' % ['$t', i] if i"; done
         tracks/bash: 10
       tracks/csharp: 5
       tracks/delphi: 1
       tracks/erlang: 19
       tracks/factor: 2
       tracks/fsharp: 4
           tracks/go: 1
       tracks/groovy: 7
         tracks/java: 1
       tracks/python: 76
          tracks/sml: 1

All 10 comments

I don't see how this is related to exercism/bash#68.

Another way to think about this. Hello-World is the 0th exercise. Its purpose is to help the student realize that their environment is properly setup and working correctly for the given track. This, in-turn, makes two-fer a good 1st exercise....

I can surely say this: For the same reasons that I in https://github.com/exercism/problem-specifications/issues/520 recommend against old hello-world (roughly equivalent to two-fer) as the first exercise of at least the six tracks Elm, F#, Haskell, OCaml, Purescript, and Rust, I recommend against two-fer as the second exercise of those tracks. I am not a maintainer of all six tracks I named, but my recommendation remains.

Hello-World is the 0th exercise. Its purpose is to help the student realize that their environment is properly setup and working correctly for the given track.

I agree, because it contains the minimum that will be present in all further exercises (a test suite that tests some function) without introducing any logic in the tested function(s).

This, in-turn, makes two-fer a good 1st exercise....

I do not agree, because the previous statement (contains the minimum that will be present in all further exercises) is not true. Furthermore, depending on the track maintainers' decision, variable arities and/or option/maybe are not necessarily appropriate to be the first non-hello-world exercise.
Edit: The crossed-out reasoning is an incorrect argument, so I retract it. The remaining portion is my remaining argument that I stand by.

So, the "just after Hello World" at https://github.com/exercism/problem-specifications/blob/master/exercises/two-fer/metadata.yml#L3 seems to be too restrictive of the position of the exercise.

An interesting question to ask is: Is there any track that wishes to use two-fer as an exercise in any position other than second?

If there never will be any such track, there will be no contradiction to leave everything as-is; tracks either have two-fer second or not at all.

If there will be, then indeed "just after Hello World" would need to be removed, and any other changes y'all find necessary.

sorry @rpottsoh you're right it doesn't relate to exercism/bash#68 I meant exercism/bash#86 I have edited the description to fix the error

Here are the tracks that have two-fer, and two-fer's zero-indexed position in each:

gems/trackler-2.2.1.45$ for t in tracks/*; do ruby -rjson -e "i = JSON.parse(File.read('$t/config.json'))['exercises'].index { |e| e['slug'] == 'two-fer' }; puts '%20s: %d' % ['$t', i] if i"; done
         tracks/bash: 10
       tracks/csharp: 5
       tracks/delphi: 1
       tracks/erlang: 19
       tracks/factor: 2
       tracks/fsharp: 4
           tracks/go: 1
       tracks/groovy: 7
         tracks/java: 1
       tracks/python: 76
          tracks/sml: 1

Are you going to submit a PR for this @Smarticles101 ?

@Insti yep, I can do that :)

@Insti said:

The descriptions should only describe the task.

I agree with this in principle.

I see in #975 that the section of TDD has been removed. Is this information that should appear somewhere else? Does it already appear somewhere else? Since hello-world seems to be the defacto first exercise, should the removed text be incorporated there? If so how, in the README or the canonical data?

Since hello-world seems to be the defacto first exercise, should the removed text be incorporated there?

If it did, it would revert https://github.com/exercism/problem-specifications/commit/35aa16b27b3f4a6ef958f5740d23648d9ec975ef#diff-607a2b1720cb33d38eae0ecd2272b67e and https://github.com/exercism/problem-specifications/pull/544 . If that is done, will the person who does that please provide the reason why it appropriate to add it back to hello-world, thank you

Tracks should decide:

a) The order of the exercises.
b) The content of their Readmes

If there needs to be a common version about TDD philosophy, this should probably be stored in the documentation repository.

Was this page helpful?
0 / 5 - 0 ratings