Closed Abhiram98 closed 4 months ago
I want to thank you for your interest in our Library and wanting to make a contribution.
However, I have some serious concerns about this particular set of changes.
Renaming of many of these variables to their longer, more verbose form is a stylistic change, and out-of-step with the use of some of these variables throughout the entire library.
Extracting out methods that are only used once is quite marginal in its usefulness.
But a more serious impact of these changes is that the code no longer aligns with the code of the parallel classes for "doubles" and "floats" and mostly aligns with "items". These classes were carefully constructed so that one could examine the code for KllHeapLongsSketch and KllHeapDoublesSketch side by side with a comparison editor and visually confirm that the code is identical for both classes, except for the naming of the type variables, where it is, say, "long" in one class and "double" in the other. These classes align line-for-line, which makes debugging and editing much simpler. A change in one KLL type must also be changed in the others. Your changes destroyed this ease of editing, checking and debugging.
Java doesn't have an efficient built-in template capability, like C++, where this kind of duplication of code is not necessary. Java does have generics, but they are very inefficient for this kind of code. The only other alternative is to use a template pre-processor, which I have seriously considered (Java uses template pre-processors internally), but have not yet implemented.
Change for change-sake is not a contribution, and stylistic changes such as these are actually a detriment because they are not consistent with the rest of the library. And in this case, actually destroyed the ease of checking and debugging across parallel classes.
When making contributions, it is important to be sensitive to the style of the original authors, even if it is not your preferred style. And in a library, such as this, it is important to be aware of how your proposed changes might impact the rest of the library.
I am closing this PR.
Thank you for your detailed response. Your feedback is very valuable to me!
Refactor KllDirectLongsSketch, KllHeapLongsSketch, KllHeapLongsSketch by primarily renaming variables, splitting long methods.
List of changes:
KllDirectLongsSketch.java
KllHeapLongsSketch.java
KllLongsHelper.java