Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've seen plenty of bugs due to misuse of unsigned types, mostly coming from beginners that are trying to fix type conversion during comparison compiler warnings. Then they go on and do some arithmetic with the loop index, which results in an underflow or two. We now have hard rules against unsigned usage if it is part of an arithmetic operation.

Where things get a bit more tricky is when working with data that has some native unsigned type - e.g. when reading an image from file, it will mostly consist of unsigned chars. There you also need conversion rules and everyone aligned on algorithms, APIs etc.

Mostly though it's a matter of maintainability - it's easier to wrap your head around signed integers (no pun intended), even for beginners.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: