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

> Functions that return types wrapping int instead of raw ints are a good thing. Error codes in particular really should be something enum like and not 32 bits of best of luck.

That's not what I described. I was talking about numbers without special meaning, and with types which require manual implementation of any conversion. One function might return a container whose length() function returns a wrapped integer, and a different container with the same function name returns a different wrapper. You can't combine those wrappers without explicitly defining a conversion. That's what inconsistency in return types means.

> In contrast, having some containers call it size and others call it length is indeed moderately unhelpful.

And now imagine it's not just two options, but literally every container returned by every function being special. That's what it means to be inconsistent. But as you can see in your example - even small bits of inconsistency (1 bit, if you want) are annoying and unhelpful.



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

Search: