4 ms·
Because signed is default for some reason in most languages, and most developers aren't taught to think critically about how decisions like simple datatypes mig
by Inityx 9y ago
Because signed is default for some reason in most languages, and most developers aren't taught to think critically about how decisions like simple datatypes might affect scalability.
- koolba 9y agoNot just the default, it doesn't even exist in some languages.
- libria 9y agoThe problem is momentum. I could use unsigned int everywhere, but then I have to constantly typecast to int and back anywhere I use a library expecting signed ints. If we all switched to unsigned int by default, then everything would make more sense but we'll all live in typecasting hell during the migration.
- astrange 9y agoUnsigned by default doesn't make more sense than signed by default. The behavior near 0 is surprising; if you underflow you either get a huge value (anything not Swift) or you crash (Swift). It was a mistake to use them for sizes in C++. Google code style requires using int64 to count sizes instead of uint32 for good reasons.