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

> It wouldn't produce an exception, it would not compile. The nice thing is that you can avoid range checking at runtime.

You're proposing a language where you cannot increment integers? I don't think that would be a very popular language.



You could increment integers so long as you make it clear what you will do in the overflow case. Either use bigints with no overflow, specify that you do in fact want modular behavior, or specify what you want to do when your fixed width int overflows upon increment. That seems eminently sensible, instead of having overflow just sit around as a silent gotcha enabled by default everywhere.




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

Search: