logoalt Hacker News

pjmlpyesterday at 8:55 PM2 repliesview on HN

Java doesn't have unsigned as primitive types, because James Gosling did a series of interviews at Sun among "expert" C devs, and all got the C language rules for unsigned arithmetic wrong.

Yes I miss them in Java as primitives, however there are utility methods for unsigned arithmetic, that get it right.


Replies

jstimpfletoday at 11:24 AM

The way he conducted those interviews, and the conclusions he drew from them, may have been flawed. Because the situation now is that C has unsigned types and Java mostly has not.

And despite all pitfalls especially around mixing signed and unsigned in C, unsigned types are very useful, I'd in fact say that for low-level programming they are essential.

show 1 reply
layer8yesterday at 9:58 PM

Java has char as an unsigned 16-bit integer type. They should have made byte unsigned as well.

show 1 reply