Click here to Skip to main content
15,878,959 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What's wrong with Java? Pin
Greg Utas4-Mar-21 7:51
professionalGreg Utas4-Mar-21 7:51 
GeneralRe: What's wrong with Java? Pin
Gerry Schmitz4-Mar-21 8:38
mveGerry Schmitz4-Mar-21 8:38 
GeneralRe: What's wrong with Java? Pin
Rick York4-Mar-21 9:34
mveRick York4-Mar-21 9:34 
GeneralRe: What's wrong with Java? Pin
Cp-Coder4-Mar-21 14:39
Cp-Coder4-Mar-21 14:39 
GeneralRe: What's wrong with Java? Pin
trønderen5-Mar-21 6:33
trønderen5-Mar-21 6:33 
GeneralRe: What's wrong with Java? Pin
Rick York5-Mar-21 6:39
mveRick York5-Mar-21 6:39 
GeneralRe: What's wrong with Java? Pin
NelsonGoncalves4-Mar-21 20:21
NelsonGoncalves4-Mar-21 20:21 
GeneralRe: What's wrong with Java? Pin
Member 133016794-Mar-21 23:03
Member 133016794-Mar-21 23:03 
Quote:
I fondly remember discovering that the byte type is signed (why, really why ???)


I know the answer to this one: it's because the representation of signed integers is specified (as two's complement), so there is no problem with bit-shifting (or other bit operations) them as there is with bit-shifting signed numbers in C++ (which doesn't specify the integer representation).

In C++, for example, you cannot write this (to check if variable 'a' overflowed):

if (a + 1 < a) { ... }


and expect it to work on all conforming compilers because there is no guarantee that the underlying representation uses twos-complement. In Java the representation is guaranteed to be twos complement.

In C++, the result of:

a = b >> 3;


Is undefined if 'b' is signed. In java it's defined (right-shift twos-complement).

Sure, those are sh*tty reasons to leave out unsigned types, but they're still reasons. The only place you're likely to run into problems is when trying to add two signed 64-bit numbers that overflow the signed 64-bit type.
GeneralRe: What's wrong with Java? Pin
NelsonGoncalves4-Mar-21 23:23
NelsonGoncalves4-Mar-21 23:23 
GeneralRe: What's wrong with Java? Pin
Member 133016795-Mar-21 0:03
Member 133016795-Mar-21 0:03 
GeneralRe: What's wrong with Java? Pin
trønderen5-Mar-21 7:18
trønderen5-Mar-21 7:18 
GeneralRe: What's wrong with Java? Pin
NelsonGoncalves6-Mar-21 3:11
NelsonGoncalves6-Mar-21 3:11 
GeneralRe: What's wrong with Java? Pin
Peter Adam4-Mar-21 21:07
professionalPeter Adam4-Mar-21 21:07 
GeneralRe: What's wrong with Java? Pin
Member 133016794-Mar-21 22:47
Member 133016794-Mar-21 22:47 
GeneralRe: What's wrong with Java? Pin
Martin ISDN4-Mar-21 22:58
Martin ISDN4-Mar-21 22:58 
GeneralRe: What's wrong with Java? Pin
Member 133016794-Mar-21 23:07
Member 133016794-Mar-21 23:07 
GeneralRe: What's wrong with Java? Pin
Martin ISDN5-Mar-21 1:49
Martin ISDN5-Mar-21 1:49 
GeneralRe: What's wrong with Java? Pin
Dan Neely5-Mar-21 2:44
Dan Neely5-Mar-21 2:44 
GeneralRe: What's wrong with Java? Pin
obermd5-Mar-21 3:35
obermd5-Mar-21 3:35 
GeneralRe: What's wrong with Java? Pin
Bruce Patin5-Mar-21 6:02
Bruce Patin5-Mar-21 6:02 
GeneralRe: What's wrong with Java? Pin
Cp-Coder5-Mar-21 6:22
Cp-Coder5-Mar-21 6:22 
GeneralRe: What's wrong with Java? Pin
Bruce Patin5-Mar-21 10:22
Bruce Patin5-Mar-21 10:22 
GeneralRe: What's wrong with Java? Pin
Cp-Coder5-Mar-21 10:28
Cp-Coder5-Mar-21 10:28 
GeneralRe: What's wrong with Java? Pin
Bruce Patin5-Mar-21 10:43
Bruce Patin5-Mar-21 10:43 
GeneralRe: What's wrong with Java? Pin
sasadler5-Mar-21 6:28
sasadler5-Mar-21 6:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.