Gianni said:
Noah said:
However, the standard DOES provide tools to implement functional calls
and to override a single subscript operator.
Let's see:
double matrix[4][4];
Are you saying that the code requires some kind of extra "implementation" ?
That's clearly a language supported abstraction for a matrix IMHO.
<sarchasm>
Oh yeah, the language clearly supports *that* abstraction for a matrix:
double matrix1[4][4] = {{1,2,3,4},{5,6,7,8},{9,8,7,6},{5,4,3,2}}; // OK
double matrix2[4][4] = {{5,6,7,8},{1,2,3,4},{5,4,3,2},{9,8,7,6}}; // OK
double matrix3 = matrix1 * matrix2; // This doesn't compile! Why not?
// I thought C++ *clearly* supported
matrix abstractions!
// $!@%^&'n C++!
matrix3 = matrix1 + matrix2; // $!@%^&!!! This doesn't work either!
matrix3 = matrix1 / matrix2; // Nor this! $!@%^&!!!
matrix3 = 1 / matrix1; // $!@%^&!!! $!@%^&!!! $!@%^&!!!
</sarchasm>
No, C++ does *NOT* support matrix abstraction!
Gianni said:
Let me see.
Programmer says: I wanna change the entire code base to use (,).
Supervisor: Why do you want to do that ?
Programmer: Because it's far better ?
Supervisor: Oh, really ! OK, what's so much better ?
Programmer: Because It's a better abstraction.
Supervisor: Sure, sounds great, why is it a better abstraction ?
Programmer: Ummm, because ...... um, it's a personal preference.
Supervisor: Go look at the bug/feature list and find some real bugs to
fix and get back to me.
Anything wrong here ?
Hmmm... Well, I think we can all agree its foolish to change existing
syntax on a large project. The above conversation would be just as
foolish if the programmer wanted to change to code base from (,) to use
[][].
Anyway, that's not what I understood this whole thread to be about. I
thought the original question was more about deciding the better design
up front. I and many others believe there is sufficient evidence to
say that (,) is the better design decision. You (and I'm sure many
others) obviously disagree. So be it. We disagree.
I can accept that you and I don't see eye-to-eye on that. But on the
side topics (such as C++ natively supporting an abstraction for
matrices), I sharply disagree with many of your assertions.
Gianni said:
Noah said:
Gianni said:
Noah Roberts wrote:
At any rate, like I said...unless you are in the situation of dealing
with legacy code there is no need to worry about it. So why go to all
the trouble of forcing the [][] issue?
I think I am clearly on the side of C++ in that [][] has been used far
more than (,) and is the default syntax. You need to make an argument to
change it from [][] which is substantiated by more than just personal
preferences.
All you keep saying...and you keep saying it as if it will make it
true...is that your side is stronger and therefor should be the
default. You have yet to show it in any way.
I have:
double matrix[4][4];
...
Again, this is *NOT* a matrix!!! You may index into it like a matrix,
but the C++ standard doesn't allow you to do matrix multiplication,
inversion, addition, etc... with this type of "matrix".
- Kevin Hall