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

I switched over to using size_t for array indexes a few years ago, and found this a big improvement. And once I switched to size_t, most of my uses of unsigned went away - either you care about the size (and you want a uintN_t), or you don't (and you probably want size_t).


I think this works best if you pass a pointer to an error structure in the parameters. I've found people often use signed integer types with arrays so they can return a -1 to signal that something went wrong.




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

Search: