add comment for analyzer wizards-and-warriors-2#2371
add comment for analyzer wizards-and-warriors-2#2371SleeplessByte merged 3 commits intoexercism:mainfrom
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.
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.
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.
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.
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