News for hackers. Stuff that matters.
Re:Modern programming languages require generics by taeric on Tuesday May 24, 2022 @11:15AM (#31493199)
Yeah, this really needs to point out that the elements in Arrays.sort have to be Comparable. More, they have to be Comparable with each other. Should probably show the Collections.sort that takes a Comparator to really make the point that that is dispatched at runtime.

But then you would probably need to cover just how aggressive the JIT is in the JVM and how the costs may not be what you would think they are.

Re:Modern programming languages require generics by GordonS on Tuesday May 24, 2022 @02:26PM (#31495765)
You're not wrong, but I feel like this doesn't need explicitly spelled out, as it would be obvious to any Java dev (or C#, or indeed probably any language with generics).
Re:Modern programming languages require generics by taeric on Tuesday May 24, 2022 @02:31PM (#31495833)
I think my problem is that there is no runtime dispatch between the methods that were listed. Such that that was a bit of a non-sequitur for the point at hand.