Problem-specifications: Is "write a program" accurate?

Created on 6 Aug 2016  路  12Comments  路  Source: exercism/problem-specifications

We have a lot of descriptions that say "write a program". As https://github.com/exercism/exercism.io/issues/2746 explains, this may set up a wrong expectation from students that they are writing e.g. something with a main function (or equivalent entry point in language of choice).

But it seems that most tracks I've seen simply ask the student to write a function. Most languages then verify the behavior with unit tests against that function.

In the interest of setting up expectations correctly, shall we replace "write a program" with "write a function"?

Things I would like to check before doing that:

  • Are there any tracks that do, in fact, expect the student to write a full-fledged program?
  • Are there any tracks in which the equivalent concept is not called a function? (Perhaps it's called a procedure instead? Or something completely different?)

    • Even if there aren't, what if we add such a track in the future?

    • If there currently are or could be in the future, should we do anything about it? In other words, do we decide that we'll simply use a "function" as a generic terminology, regardless of how this concept maps onto the target language?

Anything else I'm missing?

Appendix:

$ grep -li "write a program" *.md
change.md
crypto-square.md
etl.md
food-chain.md
grains.md
luhn.md
protein-translation.md
scale-generator.md
sum-of-multiples.md
transpose.md
two-bucket.md

$ grep -li "write a program" *.yml
allergies.yml
all-your-base.yml
anagram.yml
beer-song.yml
binary-search-tree.yml
binary-search.yml
binary.yml
change.yml
flatten-array.yml
food-chain.yml
gigasecond.yml
grains.yml
hamming.yml
hello-world.yml
hexadecimal.yml
house.yml
kindergarten-garden.yml
largest-series-product.yml
leap.yml
luhn.yml
matrix.yml
minesweeper.yml
nth-prime.yml
ocr-numbers.yml
octal.yml
paasio.yml
palindrome-products.yml
parallel-letter-frequency.yml
pascals-triangle.yml
phone-number.yml
point-mutations.yml
protein-translation.yml
proverb.yml
queen-attack.yml
raindrops.yml
rna-transcription.yml
robot-name.yml
saddle-points.yml
say.yml
scale-generator.yml
scrabble-score.yml
secret-handshake.yml
series.yml
sieve.yml
space-age.yml
sum-of-multiples.yml
transpose.yml
triangle.yml
trinary.yml
twelve-days.yml
two-bucket.yml
word-count.yml
wordy.yml
zebra-puzzle.yml
documentation good first issue policy

Most helpful comment

I like the idea of removing the words where possible, and if not, go with a super generic "some code" to avoid the _but this is not an X_ argument.

All 12 comments

Perhaps "write a program" is the most generic way to address this? In the case of Ruby, I don't think I have yet to see a "Write a method" request, on its own, the final result is usually a class or a module, and many solutions don't require either, which is perfectly fine with me. It leaves the implementations open.

Most generically, it may be "write instructions" to accomplish something.

Once you ask for a function or procedure or method, you are probably being too specific, even the tests in many cases may be considered too specific, driving a certain way to solve something, which may be impossible to avoid, or just may be hard to avoid.

What were if we ask for writing a library? This leaves everything open
while not suggesting the io stuff.

KOTP [email protected] schrieb am Sa., 6. Aug. 2016 12:20:

Perhaps "write a program" is the most generic way to address this? In the
case of Ruby, I don't think I have yet to see a "Write a method" request,
on its own, the final result is usually a class or a method, and many
solutions don't require either, which is perfectly fine with me. It leaves
the implementations open.

Once you ask for a function or procedure or method, you are probably being
too specific, even the tests in many cases may be considered too specific,
driving a certain way to solve something, which may be impossible to avoid,
or just may be hard to avoid.

"write some code"?

(Library sounds big and scary.)

"Write code" sounds cryptic... just kidding. But yeah, the same "generic" flavor.

I agree that library seemed potentially too large in scope. It's admitted to me that there are some tiny libraries, but maybe such a thing would not be as apparent to students.

"Write code" seems suffciently generic. I think I would prefer it to "write a function".

Here is another possible suggestion I have: Just remove the words completely. As an example, binary-search, before:

Write a program that implements a binary search algorithm.

Binary search, after:

Implement a binary search algorithm.

Seems to avoid duplication if every exercise has "write code" in common

I agree with this, the removal allows the "obvious" interpretation regardless of terms the individual user should choose to replace with the implied statement. We don't care if they write it or craft it or conjure it, whatever it is, as long as the tests pass and they get the learning experience from it. (And even the tests passing are only a guide and a common reference, in their experiences context.)

I like the idea of removing the words where possible, and if not, go with a super generic "some code" to avoid the _but this is not an X_ argument.

Here's a PR for this: #528

Looks like it was merged in, so closing.

Thanks @kotp I forgot to close this.

No problem. Don't forget that if there is a "fixes #000" in the commit, it will do so automatically when they are brought in.

Thanks for the explanation @kotp. I had "addresses #000" in the commit, so it didn't pick that up as a keyword.

Was this page helpful?
0 / 5 - 0 ratings