Article View: comp.lang.objective-c
Article #39Re: General OOP Question
From: Charles G. Bennett
Date: Wed, 09 Sep 1992 12:41
Date: Wed, 09 Sep 1992 12:41
129 lines
6919 bytes
6919 bytes
In article <1992Sep8.164922.11325@u.washington.edu> bungi@carson.u.washington.edu (Timothy J. Wood) writes: > ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson) writes: > >If you have some time, give this one a shot. > > Sure ... I will, however, keep my points to the realms of ObjC, C++, NeXT > and X since those are the OOPL/UIs that I am most familiar with. All of > this is IMHO. If your a C++/X lover, beware -- I'm not. Those who wish to > correct me by stating that X is not a UI but a graphics protocol may > refrain from doing so. I like Display Postscript anyway (which X is > attempting to use now ... snicker, snicker). > > > >Why would you rather develop a GUI application using OOP than using > >a structured language like C? > > First, note that OOP doesn't exactly imply non-structured. This is to say that a REAL programmer can write FORTRAN programs in ANY Language. :-) [munch] > > >What benefits/problems do you see in using OOP ? > > (1) The obvious: reusability of code in terms of both subclassing them > and being able to use them in lots of places due to the seperation > between interface and implementation. Seperation of client/server with > no fuss. > Second that. Ok... Show of hands. How many times have YOU (the net) written a Linked List handler? For me, there has usually been some reason to re-write it than to go and find the version that, almost, works like the one I need. In reality, I used to simply re-write. In the OBJ-C would, LIST is a basic class, I haven't written one since. But this kind of re-usability is not restricted to "basic" classes. I wrote (and sell) a Serial Class for the NeXT, that keeps someone from having to learn the UNIX IOCTLS in order to use the Serial Port's. I have testimonial letters from people who are CLUELESS about UNIX, describing how they used the object. (High end video deck controllers and virtial lab instruments to name a few.) My point is that not only do you get code re-usability ( I subclassed the Serial object to create a Mag-Card reader in less than 10 Min's) BUT you get "Complexity Hiding" and for the first time, once it's written YOU ARE DONE. [munch] > > (4) C++. Yuck. It doesn't even have an ANSI standard yet but everyone > and their anteater is using it. One might argue that ObjC isn't > standardized yet either, but then again, you can describe the differences > between ANSI-C and ObjC in 30 pages (this is how long the NeXT ObjC manual > was under 1.x/2.x ... haven't seen the 3.0 one yet but they haven't added > a whole lot). In comparision, my copy of 'The Annotated C++ Reference > Manual (ANSI Base Document)' (Ellis/Stroustrup) is 407 pages. And these > are all very *ugly* pages. The 2nd Ed 'The C++ Programming Language' > (Stroustrup) (*Why* is is using this title? He is not a K nor an R, but > an S!) quite a bit easier to read, but at the expense of an even longer > text. Multiple inheritence is evil. Protocols are *much* cleaner (NeXT > ObjC under 3.0) C++ doesn't have calltime binding of methods, or even a > generic object type. How could anyone expect to get much benifit from > object polymorphism without calltime binding? How many *compilers* (not > C++ -> C front ends) are there? One that I know of: g++. And I doubt > that even FSF implemented all the features of C++. I haven't heard of a > compiler *or* translater that implements templates. Of course this is > because they don't have a generic object type or calltime binding. > I guess that's enough flagellation of the deceased equine. > I'm very much relieved that FSF is finally getting their ObjC runtime > ready. Perhaps this will slow down (and even reverse?? Oh Please let it > be!) the spread of C++. At a minimum, it will force the C++ community to > clean up their language (wash their mouths out with soap, we will!) > Ok. That's really enough now. I think. Maybe. > No, No, PLEASE continue, and don't forget "Operator Overloading" and "Multiple Inhertiance" Truly the "goto's" of the 90's. Just think, now you can see a statment like A = B + C and not have the FAINTEST idea why it doesn't work :-) or even what Class it belong's to. There are several large programing shops around here that use C++ but do NOT allow the use of either of these "Features", since they don't feel that such code can be read or debugged. Let's see if I inherit from an Elephant and a Rhino.. I get an Elephino :-) The problems with C++ are legion, when it comes to doing truly object oriented programing. It is, however, good for doing operating system level stuff. but then again so is 'C' > >How do you feel the use of a UIMS (IB) helps ? [munch] > > (3) NO CODE! If you wan't to change your interface five times a day, no > problem. It only took you two minutes to set it up in the first place. > > Yea, and NO CODE.. With ALL other platforms, what you really have is a "Screen Painter" When your done, it justs barfs out code and away you go. OH, you need to change these buttons to check boxes? Well, if you have already put your own code in to handle the buttons, you are screwed. (You'll be doing it by hand from there on.) With interface builder, you are archiving and unarchiving the REAL, LIVE object that you'll be using (You CAN'T do this with C++) the "Target" of, say, a button is where you put your own code (really you give the button the id of your object and the name of the method to call which Interface Builder initializes when it un-archives the object.) That way you can "dink" with the user interface all day, and as long as you don't "break" the connection to your object, you don't have to do anything, if you do break it you have to hold down the control key while you drag a line from the button to an icon that represents your object. Yes Boss, this is HARD WORK.... NOT. I used to try and convert C++ people to "The Way" now I look on them with sadness and compassion, while I under bid them by 30% and eat THEIR lunch. They will evolve or become extinct as their lot has decreed. Chuck Bennett > Tim Wood > The Omni Group -- Chuck Bennett, BenaTong Consulting Harem Security (UNIX Consulting :-) ) cgb@count0.cmhnet.org
Technical Details
Message-ID:
<1992Sep9.124125.1555@count0.cmhnet.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!n8emr!uncle!oink!count0!cgbReferences:
<1992Sep8.164922.11325@u.washington.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!n8emr!uncle!oink!count0!cgb From: cgb@count0.cmhnet.org (Charles G. Bennett) Newsgroups: comp.lang.objective-c Subject: Re: General OOP Question Message-ID: <1992Sep9.124125.1555@count0.cmhnet.org> Date: 9 Sep 92 12:41:25 GMT References: <1992Sep8.164922.11325@u.washington.edu> Sender: cgb@count0.cmhnet.org Reply-To: cgb@count0.cmhnet.org Organization: BenaTong Lines: 129