-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
HighScore: Two new tests for methods interference #1744
Conversation
When solving the problem event using the tests. Is very easy to sort the scores in personal_top_tree() or personal_best() which will break latest(). The test never catch that because they are testing only one method at a time. But knowing the difference between sorting in place and returning new sorted list is valuable. Also is good to know early you have to be careful with objects states.
@cmccandless Because for me at least if we introduce classes, data integrity is the lesson you need to learn as early as possible. So for me this kind of tests are logical to exist. |
Looking at the original PR that created the exercise (exercism/problem-specifications#1378), the intent was for an easy exercise for working with arrays/lists. Some tracks don't bother with a class implementation at all for this exercise. I'm wondering if that would be a better route for this track as well. |
That is something that bugged me also when i saw it for the first time :) Changing the exercise to produce just three functions that manipulate list in different manners make sense. I am not sure how to handle that change tough ? Sorry to bother you with so many questions. If you like we can talk it trough in the maintenance channel i am willing to put some effort to improve/fix this exercise and tests. It is one of the first people see and do. |
A PR that converts to using functions would be welcome. I would close this PR first though. Feel free to reach out on Slack if you need help getting started. |
I will do some work to change the exercise to use functions instead of class with 3 functions. |
When solving the problem event using the tests.
Is very easy to sort the scores in personal_top_tree() or personal_best() which will break latest().
The test never catch that because they are testing only one method at a time.
But knowing the difference between sorting in place and returning new sorted list is valuable.
Also is good to know early you have to be careful with objects states.