-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
list-ops: add hint of using static methods per #378 #864
Conversation
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.
This looks great @m-a-ge! I really like the explanation, very thorough and clear :)
I've put one minor comment but apart from that it looks ready to merge! Thanks for tackling this! :)
exercises/list-ops/.meta/hints.md
Outdated
@@ -1,3 +1,7 @@ | |||
## Hints | |||
|
|||
In Java it's a best pracite to use instance methods over class methods. However, there are conditions in which it is absolutely appropriate for a function to be `static`. Since classes in Java are closed for modification (i.e. you cannot add members to a class outside its definition like you can in other languages like Ruby or JavaScript), you cannot add new behavior to the class, directly. What to do if you still want to define behavior for a given type? The idiomatic solution in this case is to write a utility method. |
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.
Should be "practice" :) And I don't think there should be a comma before "directly"? I'm not an expert on comma usage though so feel free to tell me if I'm wrong :P
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.
Also I think it should be "it's considered best practice" instead of "it's a best practice". What do you think?
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.
@FridaTveit you are right, I'll fix those later today.
Thanks for pointing out 👍
47c8659
to
aa82ee2
Compare
@FridaTveit I've corrected those annoying mistakes |
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 great! Thanks @m-a-ge! :)
Hopefully resolves #378
Reviewer Resources:
Track Policies