Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!ulysses!allegra!mit-eddie!ll-xn!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpcea!hpfcdc!hpldola!kens From: kens@hpldola.UUCP Newsgroups: comp.lang.c++ Subject: Re: Operator overloading considered harmful Message-ID: <11430004@hpldola.HP.COM> Date: 11 Jan 88 19:40:50 GMT References: <240@vsi1.UUCP> Organization: HP Elec. Design Div. -ColoSpgs Lines: 22 Posted: Mon Jan 11 14:40:50 1988 On the contrary, C++ operator overloading isn't powerful enough. My complaint about operator overloading in C++ is that it only allows redefinition of the existing operators, not the declaration of new operators (with potentially mixfix syntax). (I'm quite aware of the problems in parsing such languages; the difficulty does not make my point moot.) In most disciplines notations have evolved to make the concepts common to that discipline easy to express in an unambiguous manner. Some classic examples include vector algebra, the Einstein summation convention, and bras and kets from quantum mechanics. None of these notations may be expressed easily in C++, and all of them are desirable from an application standpoint. The use of existing notations can contribute not only to readability but to productivity through making simple semantic errors more apparent. I won't argue the point that the facility can be abused. This merely points out that software developers must agree on common notation for an application and document thoroughly the notation used. Ken Shrum hplabs!hpldola!kens