-
-
Notifications
You must be signed in to change notification settings - Fork 954
add comment for analyzer wizards-and-warriors-2 #2371
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
add comment for analyzer wizards-and-warriors-2 #2371
Conversation
| @@ -0,0 +1,4 @@ | |||
| # Reuse code from Describe two params | |||
|
|
|||
| The `describe(Character, Destination)` method should reuse the logic implemented in `describe(Character, Destination, TravelMethod)` or in the individual methods `describe(Character)`, `describe(Destination)`, `describe(TravelMethod)`. | |||
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.
Suggestion for slight rewording and I don't think the describe(TravelMethod) is needed here.
| The `describe(Character, Destination)` method should reuse the logic implemented in `describe(Character, Destination, TravelMethod)` or in the individual methods `describe(Character)`, `describe(Destination)`, `describe(TravelMethod)`. | |
| The `describe(Character, Destination)` method should reuse the logic implemented in `describe(Character, Destination, TravelMethod)` or in the individual `describe(Character)` and `describe(Destination)` methods. |
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.
I think the describe(TravelMethod) is actually needed. In fact, the method describe(Character, Destination) can be implemented in two ways:
-
public String describe(Character character, Destination destination) {
return describe(character, destination, TravelMethod.WALKING);
} -
public String describe(Character character, Destination destination) {
return describe(character) + describe(destination) + describe(TravelMethod.WALKING);
}
Without referring todescribe(TravelMethod), the student may think that one solution is also:
public String describe(Character character, Destination destination) {
return describe(character) + describe(destination) + "You're traveling to your destination by walking.";
>}
Also in design.md, they suggest to indicate it.
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.
Oops, you're right! The describe(TravelMethod) is needed here.
| @@ -0,0 +1,4 @@ | |||
| # Reuse code from Describe two params | |||
|
|
|||
| The `describe(Character, Destination)` method should reuse the logic implemented in `describe(Character, Destination, TravelMethod)` or in the individual methods `describe(Character)`, `describe(Destination)`, `describe(TravelMethod)`. | |||
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.
Oops, you're right! The describe(TravelMethod) is needed here.
|
Looks good to me now. +cc @exercism/guardians |
related to #262
The goal is to add a new comment for the analyzer