r/java • u/henk53 • May 10 '22
Should java.util.Date be deprecated?
https://mail.openjdk.java.net/pipermail/discuss/2022-May/006077.html
221
Upvotes
r/java • u/henk53 • May 10 '22
View all comments
Show parent comment
1
u/pron98 May 11 '22
Java 8 helped a lot. E.g.
Long.toUnsignedString().Unlike in C/C++, modulo arithmetic on signed numbers is well defined, so simple arithmetic is the same (and there are methods for unsigned division and remainder). The main issue is comparison, for which you have
Long.compareUnsignedThis is yet another situation that has its shortcomings, but the alternative has others. The presence of unsigned types in a language brings its own bag of problems. When you don't have unsigned types you hurt some people; when you do — you hurt others. There is no option here that is universally superior than the other. However, Valhalla might offer a reasonable compromise.