java
java copied to clipboard
darts: Unnecessary complication of exercise by using method without parameters
The exercise "Darts" is categorised in the "Conditionals If" exercises and is categorised as "easy".
While the exercise itself is indeed easy, the use of a 'score' method without parameters and thus the necessity to write a constructor is making the exercise more complicated to understand than it needs to be.
Especially as other, similar exercises just expect the student to write a method that uses parameters given.
Is there a reason why this simple exercise uses an approach that differs from this?
I agree we should simplify this.
So the task here is to have the exercise just require static methods instead of requiring the building of a new object and putting a method on it. Anyone is welcome to open a PR with this change.
I think a different approach would be to instead let the user write a method that calculates the score using methods where the x and y position is passed as an argument, instead of pulling it from the object as a field.
The object creation and call of the methods with the proper arguments would more or less stay the same.
See the bird watcher tests for example.
@JanB1 I see, that works too :)
is anyone working on this issue actively?
@jennylia I don't think so, feel free to take this.
yea I'll give it a try.
https://github.com/exercism/java/pull/2180/files is my PR. Please also tag me for hacktoberfest thank you very much
@andrerfcsantos
This issue should be closed.
@kerolloz Indeed, thanks for the reminder.