Unsigned sizes: a five year mistake (c3-lang.org)
from sanitation@lemmy.radio to programming@programming.dev on 02 May 23:12
https://lemmy.radio/post/13124735

#programming

threaded - newest

calcopiritus@lemmy.world on 03 May 07:15 collapse

Lots of talk about the problems of implicit conversions. Which is known, and is the reason that rust does not have implicit conversions. But when it came to the heart of the article, the explanation of why unsigned is bad for sizes, it’s just:

  • One example about wrapping in ring buffers.
  • Saying “in the 90s there were a lot of problems”.
  • The lower boundary “0” being near “normal” numbers.

I can see how you can think the 3rd one is an issue. But then the answer should be the java one of just removing unsigned. Since that issue is not exclusive to sizes, every unsigned use case has it.

It seems like the real problem here is having implicit conversions.