Hacker News new | ask | show | jobs
by binarymax 339 days ago
Literally every other language with unsigned types handles this just fine?
2 comments

I guess it depends on what "just fine" means. What happens when a conversion is applied? Is there silent data corruption (C), or is there an exception (Ada, D) or perhaps a panic (Rust, Zig)? Is the behavior dependent on compiler flags?

Keeping unsigned integer types out of the language makes things much simpler, and keeping things simple was an original design goal of Java.

By no means do C or C++ handle unsigned types just fine. In fact, they're widely recognised as a source of problems even by those who think they're useful (when used carefully).