-
-
Notifications
You must be signed in to change notification settings - Fork 731
Football Match Reports: Teach default keyword instead of exceptions #3020
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
Football Match Reports: Teach default keyword instead of exceptions #3020
Conversation
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.
For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
Leaving this for the active maintainers to review, but since I got pinged I'll leave my 2cts: The fact that you as a learning student got stuck because you had to figure out exceptions by yourself instead of through a concept exercise is a good indication that this should be addressed. As for the solution, I really like the approach. The only remark I have is that the current Edit: thanks for contributing, especially since you're using Exercism to learn Java! 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sanderploegsma for the comment - I found it helpful in the review 😄. Also thanks @AlvesJorge for pointing this out and and improving things on the Java track!
I also like removing exceptions from here since there is a separate concept for it and removing it from here reduces the number of dependencies for the switch
concept.
The changes generally look fine, but:
- The example solution will require updating to pass the test changes.
- Feel free to also to add yourself to the contributors in the exercise's config.json (see Knapsack's config.json for an example with contributors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @AlvesJorge!
@kahgoh I noticed the new exercise is published in the java track, but the existing solutions are still marked as "passed latest version of the exercise" (see screenshot). |
We deliberately included This way, the changes only apply to solutions submitted from now onwards. So nothing was forgotten, it’s actually by design! 🙂 |
👆🏻 that and to properly mark them as no longer passing requires re-testing them all, which can be a rather expensive operation (more info in the docs if you're interested). |
Yeah I understand the not wanting to check if all submissions pass the latest version. It's just that they explicitly say "This solution correctly solves the latest version of the exercise". Which is awfully specific, and very wrong. If i was a newbie and I copy pasted the solution code I'd be so confused as to why it's not passing. |
Are you sure it shows that? As far as I know, and even after checking, it doesn’t seem to. Could you double-check on your side? Edit — Ah, you’re right! It does say that, just realised it now after @kahgoh mentioned it shows up when hovering on the check mark. |
Yeah ... I see it ... the tooltip does say that when hovering over the check mark. I can see how it can be confusing and using On another note ... I wonder if the test display name "The onField method returns 'invalid' for invalid shirt number" should describe why it is invalid (e.g. "The onField method returns 'invalid' for shirt positive number outside range"). It would be more consistent with the one below it which says "negative number". If so, we could make the change and re-run the check at that point (@AlvesJorge, if agreed, would you want to raise the PR?), otherwise I'll see if someone can trigger the re-testing. |
Exceptions is a separate concept and it has a dependency on switch, which is covered in Football Match Reports. Removing exception reduces the number of dependencies that Football Match Reports has and breaks this dependency cycle. Adding this to prevent rerun over existing community solutions [no important files changed]
The Football match reports is a concept exercise teaching the switch statement. This precedes the 'exceptions' part of the track, so it feels odd that the exercise asks you to do something that you haven't learned before, and which is not an intuitive part of the language for beginner programmers.
In contrast, the exercise does not propose the use of the
default
keyword.I changed it so that the exercise now wants you to return
"unknown"
for any shirt outside of the 1-11 range, instead of wanting you to throw an error.@sanderploegsma had previously showed a similar sentiment in this issue and related forum thread, but got no replies.
On the same note, the
break
keyword is also not being "taught" here, most people are simply returning from the switch, or returning the switch itself. So there's an opportunity for change there as well, but I got no suggestions atm