Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!sdl!adk From: adk@sdl.scs.com (Ajay Kamdar) Newsgroups: comp.lang.c++ Subject: Re: Overloaded operator dot? Message-ID: <1991Apr12.175341.995@sdl.scs.com> Date: 12 Apr 91 17:53:41 GMT References: <12193@pasteur.Berkeley.EDU> <4610@lupine.NCD.COM> <71650@microsoft.UUCP> Distribution: usa Organization: Mentor Graphics Corp. - Warren, NJ Lines: 67 This is a little digression from the regulary scheduled arguments for and against overloading operator-dot. In article <71650@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: >In article <4610@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: >|Horse pucky! Prove it! > - Arguments and counter arguments deleted - > >If some C++ programmers consider overloading operator-dot a "bad" idea -- >**** THEN DONT DO IT! **** > That is a supercilious argument. If Ron is right, and if overloading operator-dot is indeed a "bad" idea, advice to not do it just doesn't cut. Most people who have had to support(work with) somebody else's badly written code will testify to that. >Why is it necessary to force your prejudices of what constitutes "good >programming" onto others? Are you really asking that? If you want a simple example of people's prejudices of what constitutes "good programming" and how it affects somebody else's work, read on. Consider the case of function prototypes. I prefer that parameters in function prototypes be named. Some others perfer otherwise. I consider it "bad programming" to not name the function parameters. Some others don't. Now assume that I am the consumer of a class library developed by somebody else, and I just have the object code and some header files. Assume that a .h file has the following prototype for a function: void do_something(int, int); Notice that the function prototype does not have parameter names. If I need to use the function, how do I figure out what arguments it takes? Maybe I can figure out from the context that it takes the arguments something_1 and something_2. But how do I figure out in what order? If I am lucky, the function definiton is in the header file, and I can look at it. But what if it is not? In fact, even if the function definition is available, it is irritating to have to look at the function definition to figure such details out. This is a very simple example of a common problem. The problem becomes really serious when one encounters such situations with complex libraries. Sigh... One can continue ad nauseum with similar examples. Anyway, back to the regularly schedule programming. - Ajay -- Standard disclaimers apply. Ajay Kamdar Mentor Graphics, IC Group Email : ...uunet!sdl!adk