3 ms·
So are a+b and b+a. ;)
by mlyle 6y ago
So are a+b and b+a. ;)
- huhtenberg 6y agoUnless one of them is a sneaky macro. Ha!
- Inityx 6y agoSure, but addition is commutative everywhere...
- mlyle 6y agoSure... I'm just pointing out that reordering operands on a commutative operation doesn't really count as "multiple ways to do things."
- int_19h 6y agoThe gotcha is that the operation is commutative on type system level. C could - as many languages do - restrict the type of the left operand of [] to "something indexable".
- mlyle 6y agoOh, sure, I'm not arguing that 0[a] isn't "weird". I just don't think it's an example of multiple ways to do something.