Xref: utzoo comp.object:3580 comp.lang.c++:13645 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!uakari.primate.wisc.edu!sdd.hp.com!wuarchive!uunet!jarthur!petunia!kestrel.edu!gyro From: gyro@kestrel.edu (Scott Layson Burson) Newsgroups: comp.object,comp.lang.c++ Subject: Re: C++ and waitresses Message-ID: <1991May24.175143.17793@kestrel.edu> Date: 24 May 91 17:51:43 GMT References: <2325@media03.UUCP> Organization: Kestrel Institute, Palo Alto, CA Lines: 61 In article <2325@media03.UUCP> pkr@media03.UUCP (Peter Kriens) writes: >amount of time it takes to order a simple sandwich. They start asking you if >you want onions, or mustard, on the rye, with lettuce, without tomatoes. I >usually get confused because I am usually in a discussion while in a >restaurant. I just say a sandwich, but then the waitress will continue to >force me to chose me between an awfull lot of options. > >When I started studying C++ because I needed to teach it to a class, I got a >funny deja vu feeling, remembering the American waitress. You can do it >virtual, but you can also do it not virtual, but then you have problems >there. You can make it static, but static in that context means something >different in that context, you can use references or copying of values. It >keeps forcing you to make decisions which hardly have anything to do with the >problem domain, but are just a kind of goodies giving you certain >optimisations in certain cases. > >Am I alone in that fact that I do not like to chose all the time. I feel >distracted because I have to spent so much time choosing and then later >reworking because I made the wrong choice. The language does not seem to have >a natural concept. When you look at different implementations made by >different people they look completely different. From my experience in >Smalltalk I found that people tend to build the same kind of solutions to the >same kind of problems. It seems to me that that will hinder the reuse of >software. If you look at the NIHCL library, it is build in a structure that >is quite different from commercial available class trees. Will that not mean >that it will be very hard to reuse generic code. These are absolutely valid concerns. C++ is a strange beast indeed. I am very fond of its flexibility, but certainly was as bewildered as you when I first started to learn the language. I would go so far as to say that the community has not yet evolved a completely satisfactory sense of C++ style; perhaps some individuals have done so, but it certainly has not percolated out to everyone using the language. The thing to keep in mind about C++ is that even when you just want to write a program, you are forced to design a programming language to write your program in. C++ is so flexible that it really constitutes a metalanguage; well, as you point out, it's not just the flexibility but also the absence of high-level concepts which would create standard ways of doing certain things (e.g. built-in objects to represent classes). Don't get me wrong -- given the design goals of C++, which I agree with, I think it is very appropriate that it doesn't have things like builtin class objects, because a) it is not hard to implement them and b) it has been observed that different people who want class objects have different ideas about how they should work. In C++ as it stands, you can do it the way that best suits your particular problem. But you are quite correct that this makes the creation of generic code more difficult. There's the tradeoff. I think one answer is that there should be a definitive style guide for C++, one which is comprehensive enough that it comes to be considered as essential a desk reference as the reference manual itself. Does anyone know if someone is writing such a book? Perhaps I should. -- Scott Gyro@Reasoning.COM