Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!mcnc!unc!rentsch From: rentsch@unc.UUCP Newsgroups: comp.lang.misc Subject: Re: Teaching object-oriented paradigm to beginners? Message-ID: <623@unc.unc.UUCP> Date: Sat, 17-Jan-87 01:11:44 EST Article-I.D.: unc.623 Posted: Sat Jan 17 01:11:44 1987 Date-Received: Sat, 17-Jan-87 16:33:55 EST References: <4000001@nucsrl.UUCP> Reply-To: rentsch@unc.UUCP (Tim Rentsch) Organization: CS Dept, U. of N. Carolina, Chapel Hill Lines: 113 In article <4000001@nucsrl.UUCP> gore@nucsrl.UUCP (Jacob Gore) writes: > Suppose you wanted to convince the Computer Science faculty at your > university (or college or institute or whatever) that students should > be taught to think and program in the object-oriented paradigm from > the very beginning. What arguments would you use? > Or, if you are against this idea, and somebody else was introducing > it, what arguments would you use against it? > Basically, my feeling is that object-oriented programming is not an > "advanced" concept in the sense that one needs a lot of programming > experience to comprehend it. In fact, I think that it would be > _easier_ to teach to beginners, because it is very orthogonal and > consistent. But before I formally present this idea to people who > make decisions around here (many of whom have a very foggy (if any) > idea about what object-oriented programming is), I'd like to get some > opinions from the net folks. The question raised is more complex than it appears at first blush, and it has taken me some time to sort out in my own mind the various concerns. Now that I have had time to mull the question over for a few days, I have some hope of giving some sensible answers. The various concerns are herein addressed in the order of most important to least important. The unasked question is "Is teaching OOP first a good idea?", to which I answer yes. I say yes because it is generally accepted that the programming language (or: methodology) one learns first has the strongest influence, and I believe OOP is the best (well-understood) methodology now available for general purpose software writing. [But more about "well-understood" later.] This reasoning would be my primary argument that OOP should be taught first rather than later. I believe, along with the original poster, that OOP is comparatively easy to teach to beginners, although for different reasons than he gives. Objects in OOP have *intrinsic* behavior, which is somehow a "more natural" way of thinking than the extrinsic behavior exhibited by more conventional programming languages. The "more natural" aspect means not only that OOP will be easy to teach, but also that OOP will be a better model for expressing programmatic ideas. This (not very scientific) observation -- i.e., that OOP is "more natural" -- would be part of my second argument in favor of teaching OOP first. In any discussion of OOP, one must be careful to separate the understanding from the misconceptions, and this is far from trivial. I presented my ideas on this in great detail several years ago ["Object Oriented Programming", SIGPLAN Notices, September 1982], and I feel that paper is still good reading today. "Well-understood" does not mean "widely-understood", and it is sadly still true that OOP is not understood or is even misunderstood by a great many computer science professionals. If I were to argue *against* teaching OOP first, I would start by asking "Do we have someone who is really qualified to teach OOP as a first, and therefore the most important, programming discipline?" Before deciding what you should do, you should know what you do well, as this is crucial in fundamental courses. (These comments are not intended to reflect on any particular persons -- I merely state that the question should be asked.) Also, you should be careful to distinguish OOP as a principle and OOP as embodied in a programming language. In my experience, conveying the ideas of OOP depends a lot on having support for OOP in the language vehicle, more for example than communicating the ideas of structured programming depends on the particular language used. Even if you have a language which supports OOP directly, the questions of how purely the language presents OOP principles, and how much other stuff the language contains, will make the proposed course offering more or less attractive. The original poster mentions OOP being "very orthogonal and consistent". Try looking at C++. C++ definitely supports OOP, but is not very orthogonal and consistent. Now, I agree that orthogonality and consistency are desireable qualities, but some "OOP" languages have them and some do not. The decision of whether to teach OOP as a "first languge" cannot be made without also knowing which language would be used as the vehicle for presenting the ideas and principles of OOP. I note in passing that PASCAL is an existence proof of a language which can be successfully taught even though it was essentially unused outside the university environment. Furthermore, by virtue of being taught at many universities, PASCAL has become widely available outside the university environment. So, if someone says that OOP is not in demand "in the real world", you can point out that this is a non-argument, for which PASCAL provides the proof. (You might further ask the pointed question of whether the job of the university is to fulfill the demands of industry or to lead industry in the right direction in spite of itself. But that is another topic.) An argument against OOP is that, although many topics in Computer Science can be presented within the OOP style, not all can. So, you had better be prepared to do also some more conventional education along the way. This seems like a side issue to me -- every curriculum has courses designed to round out the various styles of programming presented. Some people, in arguing against OOP, say things like "it's too slow". Even if this were true (with which I disagree), it is not an argument against teaching OOP as a first programming language. For if it were, the logical conclusion is that the first language should be assembly language. (For those poor souls who *do* think we should start with assembly language, ask if we should try to learn sub-atomic particle physics by starting with the "Earth Wind Water Fire" physics model of ancient times.) Well, that seems like more than enough. Hope you got some good ideas. And good luck. cheers, Tim