exercism / python

Exercism exercises in Python.
https://exercism.org/tracks/python
MIT License
1.9k stars 1.27k forks source link

[Kindergarten Garden] Making instructions clearer #2856

Closed astrieanna closed 2 years ago

astrieanna commented 2 years ago

I would like to be able to complete this exercise by reading the instructions without examining the tests. This is not currently possible because the instructions do not define the interface that the Garden class is expected to implement.

From completing the exercise, I believe that the interface is:

I realize that most of the details of plants return value appear in the instructions already, but the instructions never mention that there's a function plants that is returning these values, nor does it mention that some tests will construct a garden by passing in a new list of students.

I was confused that the stub code in the editor when you start this exercise has students as a positional argument to the constructor, when the first 17/19 tests do not pass in a list of students.

This information could instead be added in docstrings in the initial code provided, but I don't know how much stub code is allowed when this is a practice exercise rather than a new concept.

I'm happy to make the edits required to improve this exercise, if there are changes that would be welcome.

github-actions[bot] commented 2 years ago

πŸ€–   πŸ€–

Hi! πŸ‘‹πŸ½ πŸ‘‹ Welcome to the Exercism Python Repo!

Thank you for opening an issue! 🐍  πŸŒˆ ✨


​          ◦ If you'd also like to make a PR to fix the issue, please have a quick look at the Pull Requests doc.
             We  πŸ’™  PRs that follow our Exercism & Track contributing guidelines!


πŸ’›  πŸ’™  While you are here... If you decide to help out with other open issues, you have our gratitude πŸ™Œ πŸ™ŒπŸ½.
Anything tagged with [help wanted] and without [Claimed] is up for grabs.
Comment on the issue and we will reserve it for you. 🌈 ✨

BethanyG commented 2 years ago

Hi @astrieanna πŸ‘‹πŸ½

Thanks for this issue, and for the offer to re-work the instructions. A few things to note:

  1. By design, the practice exercises (the exercises that are not in the syllabus tree as the "main" exercises in the boxes) are implemented as a form of TDD - Test-Driven development~searchTerm~'~sort~false~sortDirection~'asc~page~1)). But in exercism's case, we've written out the basic tests for you ahead of time. TL;DR - the expectation is that you engage with and look at the tests in addition to the instructions/specification. That doesn't mean we can't do better on the instructions. But it does mean that we will probably never get to the point of specifying everything in detail -- because we expect you to explore the test file.

  2. Practice exercises are intended to be as open-ended as possible, and to encourage discussion with a mentor. That means we take pains to not dictate implementation. Now for OOP exercises in OOP-supporting languages, some exercises do indeed "dictate" a class and/or method names. But apart from importing expected class and or method names, we try not to overly constrict a student to a particular interface. We strive to have the tests look for results -- I don't care how you implemented Garden -- I care that when I call garden.plants("Alice"), I get back a list that has ["Violets", "Clover", "Radishes", "Clover"]. Even the parameters listed in the stub are optional -- you could call them anything you like. And for students, many community solutions use a default argument of None, rather than use it as positional-only. Again, this is meant to encourage a conversation with a mentor about different possible approaches or techniques.

  3. Stub code for practice exercises is kept to a minimum. While we have been discussing if more detail is warranted, we have been wary of over-specifying or constricting implementation. For now, we are going with bare minimum sans docstrings or typehinting. We might revisit that later this year.

  4. Problem descriptions for practice exercises are actually cross-track and are maintained in a repo called problem-specifications. The reason that some problems may feel ... vague ... is that they're specified for more than one programming language. So the specifics of wether Garden is a class or a function or ... something else .... is left to the track. Which brings us to ....

  5. If you want to add track-specific detail to the instructions for a practice exercise, you need to make an instructions.append file. Here is an example from the Clock exercise that details the difference between __str__ and __repr__. I could imagine something similar for Kindergarten Garden that added some more information or hints on classes, default arguments, constructors and maybe even class attributes -- and maybe also mentioned that the plants method returns a list. And I'd be happy to review an append. Just keep in mind that you don't want to over-specify.

I hope that addresses your concerns. And again -- happy to entertain an instructions.append. Conversely, you could also open and issue in problem-specifications and discuss there with track maintainers what additional information in the general problem description would be helpful.

BethanyG commented 2 years ago

Hi @astrieanna -- are you still interested in working on an instructions.append for this exercise, or should we close it for now? Please let me know! πŸ˜„ Thanks.

astrieanna commented 2 years ago

Yes, I'm interested. Thank you for the thorough and quick response. Sorry, I had a busy week and didn't get back to this.

I'll submit a PR for the instructions.append in the next few days.

BethanyG commented 2 years ago

Thrilled you want to take it on! 🌟 Just as a bump (that answer above was ... long πŸ˜‰ ), here are several instruction.append file examples:

  1. Clock
  2. Affine Cipher
  3. High Scores

And the (obligatory) documentation links πŸ˜„ :

Additionally, if needed, you can add a hints.md file with task-by-taks hints to help students who are stuck. Thinking this might be a good way to address some of the frustrations you outlined with interface design. Could be a nice place to put links in for the different types of parameters, etc.:

Hints.md for Practice Exercises

BethanyG commented 2 years ago

Now that #2915 has been merged, I am going to close this issue. Nice work, @astrieanna!