Hacker News new | past | comments | ask | show | jobs | submit login

Google recommends the opposite:

http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...

I prefer this since unsigned underflow (which is an easy bug) produces a value which is still a valid size and is not detected by IOC or -ftrapv. Also, it requires you to use unsigned loop indexes, which will simply lead to more bugs.

The fact that your program contains no individual objects whose size is > INT_MAX should be a sign that you should use int for their size.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: