two-fer: Remove default parameter from solution stub#1641
two-fer: Remove default parameter from solution stub#1641cmccandless merged 4 commits intoexercism:masterfrom
Conversation
The Two-Fer exercise is quite a simple one which really requires only two pieces of knowledge in any language: - How do you append strings? - How do you create default parameters? In Python, the first is trivial, while the second is slightly trickier. As written, the example code already provides the answer to the second question which is a massive spoiler, making the exercise far too easy in my opinion. With this PR, I propose that this be dropped from the exercise, leaving the student to work out how default parameters work for themselves.
|
@xarxziux I've asked some of the track mentor's to weigh in on this since this exercise is only the second in the core progression. |
|
Leaving it in:
Taking it out:
I'd be tempted to leave it in but could be persuaded otherwise. |
Conditional answers won't cover the following usage: two_fer()
two_fer("Alice")Students familiar with other languages like C++ might attempt to use an overload instead, but that won't work in Python. Default argument is required by the tests because of this usage, so one way or another, the student will have to learn default arguments in this exercise, whether it's handed to them directly or not. |
|
Didn’t even think of that! Doh! |
|
I'm 👍 on removing it from the stub. In Ruby, pretty much everyone works it out (I don't think I've ever seen someone not work it out) and it leads to lots of interesting conversations as they often set the default value to be |
These are my thoughts exactly. I just came across it as a student and that was my impression. |
|
I think the consensus is on removing the default argument, but there's still a problem with doing so: this would be the only exercise in the track that the Python interpreter cannot compile out-of-the-box.
|
|
Personally I think this exercise opens up the opportunity for the student to learn several things:
Of the bunch I'd tend to argue the default argument is the easiest learned and the least valuable to their future progress. Personally I'd go for: def two_fer(name):
passThe first test will fail, as it should. They'll notice that no argument is being presented in by the test suite; they may decide to remove the parameter and return the required string and they'll pass test 1 but fail test 2 ... now they'll know and argument may or may not be presented, and this will lead them to default values. |
As requested in issue exercism#1641, the parameter to the `two_fer()` function is set to a named value.
As requested in issue exercism#1641, the parameter to the `two_fer()` function is set to a named value.
9bab6c9 to
940bb4e
Compare
|
Merged; thanks for working on this! |
The Two-Fer exercise is quite a simple one which really requires only two pieces of knowledge in any language:
In Python, the first is trivial, while the second is slightly trickier. As written, the example code already provides the answer to the second question which is a massive spoiler, making the exercise far too easy in my opinion. With this PR, I propose that this be dropped from the exercise, leaving the student to work out how default parameters work for themselves.