Skip to content
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

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

ilya-khadykin
Copy link
Contributor

Hopefully resolves #378


Reviewer Resources:

Track Policies

Copy link
Contributor

@FridaTveit FridaTveit left a 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! :)

@@ -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.
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

@ilya-khadykin ilya-khadykin Oct 5, 2017

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 👍

@ilya-khadykin
Copy link
Contributor Author

@FridaTveit I've corrected those annoying mistakes

Copy link
Contributor

@FridaTveit FridaTveit left a 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! :)

@FridaTveit FridaTveit merged commit 821af98 into exercism:master Oct 6, 2017
@ilya-khadykin ilya-khadykin deleted the issue#378 branch October 6, 2017 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

list-ops: include hints to explain why methods are static
2 participants