Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.
added Comparable<T> interface as I forgot to mention that.
Source Link

Addition: in Java you'd implement the interface Comparable which provides the method compareTo so that all e.g. SortedList instances can rely on such functionality to be present.

Addition: in Java you'd implement the interface Comparable which provides the method compareTo so that all e.g. SortedList instances can rely on such functionality to be present.

added 103 characters in body
Source Link

It isn't clear which part of the number is the most and least significant digit. Devs will have to figure this out from the code, which is less than ideal. This could also be accomplished by renaming the class and fields of Node to e.g. DigitNode, and the fields to e.g. lowerDigitNode or higherDigitNode. The start of the list would then be e.g. leastSigDigNode or just least with a comment instead of ref_tail_node.

It isn't clear which part of the number is the most and least significant digit. Devs will have to figure this out from the code, which is less than ideal. This could also be accomplished by renaming the class and fields of Node to e.g. DigitNode to e.g. lowerDigitNode or higherDigitNode.

It isn't clear which part of the number is the most and least significant digit. Devs will have to figure this out from the code, which is less than ideal. This could also be accomplished by renaming the class and fields of Node to e.g. DigitNode, and the fields to e.g. lowerDigitNode or higherDigitNode. The start of the list would then be e.g. leastSigDigNode or just least with a comment instead of ref_tail_node.

added 115 characters in body
Source Link

Using a linked list instead of an array of 32-bit integers or 64-bit longs is also far less performant. The only advantage could be to avoid memory copies as Java BigInteger classes (but then you'd have to perform calculations on the same instance, rather than returning a new one as is done now). Using the decimal calculation style is also fully unnecessary, computer use bytes and words of various sizes. This is doubly true because this just seems to be an implementation detail - the inner calculations are not exposed to the user.

Using a linked list instead of an array of 32-bit integers or 64-bit longs is also far less performant. The only advantage could be to avoid memory copies as Java BigInteger classes. Using the decimal calculation style is also fully unnecessary, computer use bytes and words of various sizes. This is doubly true because this just seems to be an implementation detail - the inner calculations are not exposed to the user.

Using a linked list instead of an array of 32-bit integers or 64-bit longs is also far less performant. The only advantage could be to avoid memory copies as Java BigInteger classes (but then you'd have to perform calculations on the same instance, rather than returning a new one as is done now). Using the decimal calculation style is also fully unnecessary, computer use bytes and words of various sizes. This is doubly true because this just seems to be an implementation detail - the inner calculations are not exposed to the user.

added 5 characters in body
Source Link
Loading
added 399 characters in body
Source Link
Loading
Source Link
Loading