Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: Generating temporaries Message-ID: <6590107@hplsla.HP.COM> Date: 26 Apr 89 17:11:47 GMT References: <8904042239.AA07890@yahi.stanford.edu> Organization: HP Lake Stevens, WA Lines: 58 > **** flame on **** > Supposedly, we are using C++ to make our lives simpler so we are more > productive. This approach, as well as other binary operator > approaches, are simply not leading to that goal. > **** flame off **** > > Methods are simple, operators are hard. Therefore, forget the > operators, don't try to write code which looks like C, and then you > WILL see productivity improvements. There's a division of labor going on here, between a class writer, and the users of that class. Anyone who has used a language with larger "math objects" built in, such as matrices, vectors, or complex numbers, will certainly tell you what a pleasure and a godsend it is to be able to say: A = B + C*D; rather than: mat temp[ROWSIZE][COLSIZE]; matmpy(C,D,temp); matadd(B,temp,A); -- and how much more readable -- and likely to be right when normal math notation can be used! Certainly, if I had a one-off programming task, where the code is to be used once, then thrown away, I would not bother to used operators. Alternately, if I did not want to worry about speed, or storage requirements, writing classes with operators is not too hard. BUT, I do not see one-off, throw-away code as being the future of C++ or object oriented programming. I see the future of C++ and OOP being people willing to make the investment in truly world-class easy-to-use, "obvious" syntax foundation classes that extend the C++ [or other OOPL] to broader horizons than can be built into a general purpose compiler. So I believe it is worthwhile for a few dedicated souls to put in the effort to do a really super job on: strings, vectors, matrices, linked lists, trees, memory managers, etc -- and then make these widely available to the rest of us. So that their difficult effort makes our life much easier. Also, these programming tasks are only really difficult until someone finds a good solution. Then the rest of us can apply the same general principles in creating other "binary operator" classes.