From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,a03ae7f4e53958e1 X-Google-Attributes: gid10a146,public X-Google-Thread: fac41,a03ae7f4e53958e1 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,8775b19e3c68a5dc X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,a03ae7f4e53958e1 X-Google-Attributes: gid1094ba,public X-Google-Thread: 1014db,a03ae7f4e53958e1 X-Google-Attributes: gid1014db,public X-Google-Thread: fa0ae,a03ae7f4e53958e1 X-Google-Attributes: gidfa0ae,public X-Google-Thread: 109fba,a03ae7f4e53958e1 X-Google-Attributes: gid109fba,public X-Google-Thread: 114809,a03ae7f4e53958e1 X-Google-Attributes: gid114809,public From: Joshua Waxman Subject: Re: Which language pays most? Smalltalk, not C++ nor Java. Date: 1997/12/30 Message-ID: #1/1 X-Deja-AN: 311413137 References: <199712121931.LAA25389@sirius.infonex.com> <67iipp$ktj$1@darla.visi.com> <882756127snz@genesis.demon.co.uk> <34A14C27.57C0@min.net> <67rjb3$pfb$1@brie.direct.ca> <34A50CAA.54AA@netup.cl> <685mee$5d4$1@sparcserver.lrz-muenchen.de> <34A812F9.C169A703@its.cl> Mime-Version: 1.0 X-Sender: jwaxman@acis.mc.yu.edu Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: Yeshiva University Newsgroups: comp.lang.fortran,comp.lang.c,comp.lang.c++,comp.lang.eiffel,comp.lang.java.programmer,comp.lang.smalltalk,comp.lang.perl.misc,comp.lang.ada,comp.edu Date: 1997-12-30T00:00:00+00:00 List-Id: On Mon, 29 Dec 1997, Guillermo Schwarz wrote: > very poorlanguage. You can't know how many bits does an int have. Or if long > is actually bigger > than int. You can't? How about sizeof(int) and if(sizeof(int) < sizeof(long)) > You can't ask an structure how many fields does it have. True. But structures in C++ tend to have a constant number of fields, no? > You can't tell an > structure to write itself into a file. Yes you can. You just have to include in the definition of the struction a function the does output. Most overload the << with the ostream operator. > You can't code an algorithm that works > with any > kind of numbers: int, double, big int, etc. Ever hear of template functions? > In C++ there is no way to handle overflow of integers. Check after each addition to see if you reversed signs, and act accordingly. > Ask in runtime how many classes do you have in your image. I'm interested what this means. What is an image that contains classes? > Or try to figure out which classes descend from which. I think it is possible to do this. RTTI. Also, can't you do a dynamic_cast and check if the pointer is null, if not then the class descends? > Try to make a single general program. What does this mean? > Try to create a Set of objects in C++. #include using namespace std; set h; set > k; > Try to create a Bag of objects in C++. ditto, just replace with multiset. > Try to create a SortedCollection of objects in C++. extend it from one of the base containers. > Convert one collection into another. (SortedCollection as Bag or whatever). The generic copy algorithm. > Put a Set inside another Set. set > k; or do you mean copy the contents? There is a copy. > Try to create a Dictionary of pairs of objects in C++ using hashing to index > the keys. Your speaking about the map type. Maps aren't actually implemented using hashes, I don't think, but in Stroustrup's book he shows how to quickly do this. > Then put a Dictionary and a Set inside a Dictionary with the Dictionary as > the key. Can do. > If you can do a single thing of what I wrote here you are a good C++ > programmer. Or a programmer who knows the Standard Template Library. > All this can be done in 10 minutes in Smalltalk (if lazy). > By all, do you mean that in 10 minutes you would have completed EVERY item, of that each item in turn could be completed in 10 minutes? In C++, most of the stuff you listed could be done in less than a minute each. The hash is a bit more complicated, and might take 1/2 an hour. For a more experienced programmer, possibly shorter. > I'm sorry if I hurt your feelings, but for the last 3 months I've been > Smalltalking more than > keeping up with the C crap. C++, you mean. And apperently you haven't. :) (C++ being the cream of the crap and Java being coffe you drink with cream). > > I mean no offense to other languages. Fortran had its time. C had it. C++ had > it. Java is having it. > Smalltalk deserves a little respect as the king of OOL. (Maybe CLOS guys will > not agree with > me), but trying to say that C++ object model is better than Smalltalk object > model is saying > GW BASIC is more structured than Pascal. And claiming you know C++ and > Smalltalk more > than me is something to prove, sir! > I don't know Smalltalk at all. C++ did I prove? Josh Waxman