3 ms·
So the problem with C++ is that you need to write one of foo[a][b] foo[{a,b}] foo(a,b) for multidimensional data instead of foo[a,b] ? Doesn
by jhasse 8y ago
So the problem with C++ is that you need to write one of
foo[a][b]
foo[{a,b}]
foo(a,b)
for multidimensional data instead of
foo[a,b]
? Doesn't sound like that big of a deal to me.
- std_throwawayay 8y agoIt's one of those many tiny things that add up. There's good reasons why C++ gets so much hate and there's good reasons why it's used in so many applications. I see no good reason to not have multiple array indices.
- jhasse 8y ago> I see no good reason to not have multiple array indices. It would add a little bit complexity to the language with only a very smal benefit: The same can be achieved with just a few characters more or () instead of [].
- std_throwawayay 8y agoUsing Matrix[i,j] is the most intuitive way for most people. It's what you'd use if you don't know anything and it's what you'd understand immediately. That's the benefit for the user.
- AndrewGaspar 8y agoAnd to be honest, in the list of things that the C++ folks seems to think is important, multi-index index operators seems like it would rank substantially higher than a lot of the other things in the list in terms of value, and a lot lower in-terms of additional complexity.