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

Time values #147

Merged
merged 1 commit into from Sep 9, 2019
Merged

Time values #147

merged 1 commit into from Sep 9, 2019

Conversation

ok2c
Copy link
Member

@ok2c ok2c commented Sep 7, 2019

@garydgregory TimeValue is mostly your code. Could you please please take a look at this change-set and let me know if you find anything disagreeable?

@ok2c ok2c requested a review from michael-o September 7, 2019 16:48
Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi All,
I am -1 to this PR:

  • Please keep the methods in alphabetical order (IOW, do not move them around.)
  • There are no unit tests to prove that the Comparable interface is implemented properly.

@ok2c
Copy link
Member Author

ok2c commented Sep 8, 2019

Please keep the methods in alphabetical order (IOW, do not move them around.)

Why is that? Is there any rational reason for keeping methods in alphabetical order? Some methods fulfill a common purpose and are a port of the the same contract such as #hasCode and #equals. Those methods should be kept together.

@michael-o
Copy link
Member

I tend to agree with @ok2c that common methods should go together.

@ok2c
Copy link
Member Author

ok2c commented Sep 8, 2019

@garydgregory Added test cases.

@garydgregory
Copy link
Member

garydgregory commented Sep 8, 2019

Please keep the methods in alphabetical order (IOW, do not move them around.)

Why is that? Is there any rational reason for keeping methods in alphabetical order? Some methods fulfill a common purpose and are a port of the the same contract such as #hasCode and #equals. Those methods should be kept together.

For me, AB order is the simplest ordering. When I am in a plain text editor, I can find things easily; when I am in an IDE, I have the IDE set to sort methods in AB order; everything matches up. I never have to "search" for a method, it is always in an obvious place in a file. Anything beyond that invites more bike-shedding. You want to "group" methods together? Are the methods in each group in... AB order? What if a method belongs in more than one group? What group do you put the method in? Do the method groups come at the end or the beginning of a file? Why? How are the groups sorted? On and on. I never want to have to discuss this mess. In short, AB order follow the KISS principle.

@ok2c
Copy link
Member Author

ok2c commented Sep 8, 2019

@garydgregory I fail to see how getters and setters being in completely different places may be "obvious" to anyone but so be it. I will back out that commit.

@garydgregory
Copy link
Member

@ok2c it's all a matter of perspective, as one could equally be disturbed that setters are scattered all over a file instead of all in one place. Same for getters. In this case the get and set methods are groups of sorts, one for reading, the other for writing. It's all about what kind of POV you take when looking at a file.

@ok2c
Copy link
Member Author

ok2c commented Sep 8, 2019

@garydgregory And from my POV #equals, #hashCode and #compareTo clearly belong together.

@ok2c
Copy link
Member Author

ok2c commented Sep 9, 2019

@garydgregory Please review the updated change-set.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now.

@ok2c ok2c merged commit 4b02bc0 into apache:master Sep 9, 2019
@ok2c ok2c deleted the time-values branch September 9, 2019 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants