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

It’s a bit of a non-issue really. Once you’ve worked with the non-overloaded version for a while you quickly get used to it. The overloaded version is also superficially simple but loses information. For example, multiply versus multiplyScalar versus applyQuaternion on a vector which might all be represented by overloads of the multiply operator.


Why include the infix operators at all then? If it's just as clear without them maybe even machine native types don't need them.


They’re only operating on scalar values. In some languages differing types and unsafe coercion rules mean it’d probably be clearer if they weren’t used.

And I don’t believe I said they were just as clear, just that it’s no big deal to get used to and gave an example where overloading muddies the waters.




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

Search: