torkell: (Default)
[personal profile] torkell
Oh yes, and I almost forgot my recommended daily software rant: in Java, all bytes are signed. There is no such thing as an unsigned byte.

A side-effect of this is that a statement such as byte foo = 0xAA; gives a compiler error.

Date: 2010-04-15 09:57 pm (UTC)
From: [identity profile] pewterfish.livejournal.com
Yes, that can be a bit of a pain in the arse, especially when you're trying to talk to hardware. The canonical solution is to always allocate one storage class larger than you need (put a char in a short, a short in an int, and so on). It's a stupid, wasteful fix, but it does work if you need signedness that much.

January 2026

S M T W T F S
     123
45678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 7th, 2026 05:28 pm
Powered by Dreamwidth Studios