
Transactions on Information and Communications Technologies vol 10, © 1995 WIT Press, www.witpress.com, ISSN 1743-3517 A first course in object-oriented programming using Oberon V. Mahnic, B. Vilfan Faculty of Electrical Engineering and Computer Science, University of Ljubljana, Trzaska 25, 61000 Ljubljana, Slovenia Abstract In the paper we describe the content of a new introductory programming course that attempts to expose students to the object-oriented paradigm in addition to the usual paradigm of procedural programming. Particular attention is devoted to the choice of programming language, and to the teaching methods for object-oriented programming concepts. The use of the Oberon language makes it possible to introduce object-oriented pro- gramming concepts in a simpler way, as extensions of well-known concepts of procedural programming. 1 Introduction All Computer Science students at the University of Ljubljana take the intro- ductory programming course, Programming I, in their first semester. The course has been based up to now on the course CS 1 [3]. The teaching language has been Pascal while the content of the course included the basic elements of Pascal (basic data types, expressions, statements), procedures, composite types, recursion, and dynamic data types. Experience of the last several years has shown that this course content is not suitable any more, and we have therefore decided to restructure it in a fundamental way. A more detailed analysis of the reasons that have led us to make this decision is described in Section Two. Section Three is devoted to the choice of programming language for the course, while Section Four contains a more detailed discussion of the dilemmas confronting the course designer with par- ticular emphasis on the appropriate approach for teaching object-oriented programming (OOP). Transactions on Information and Communications Technologies vol 10, © 1995 WIT Press, www.witpress.com, ISSN 1743-3517 330 Software Engineering in Higher Education 2 Factors that have influenced the change in the course design In the previous decade the Slovenian secondary school system has succeeded in significantly expanding Computer Science education. As a consequence most entering students had already been exposed to one of the procedu- ral languages, usually Pascal. In spite of the fact that the students had not mastered Pascal completely (the lack of knowledge is particularly evi- dent in the areas of file processing, set types, dynamic data structures, and recursion), they experience Pascal as a teaching language as a redundant effort. Additionally, it has become evident that secondary school program- ming education has certain adverse consequences that are frequently en- countered in the teaching of procedural languages: An excessive emphasis on syntax and implementation details with a concomitant insufficient em- phasis on the principles of "proper programming" characterized by readabil- ity, clear structure, modularity, etc. (Smallwood [7]). Within the present course we have attempted to alleviate this problem by a greater emphasis on the systematic approach, and on a certain discipline during the program design phase. However, the student's opinion has frequently been that it is a case of unnecessary pedantry on the part of the teacher. Thus, we have decided to restructure the content of the course with the aim of: • making the course more attractive for students; • adapting the content to their previous knowledge; • stressing the principles of "proper programming"; • including the contemporary programming concepts and paradigms with particular emphasis on OOP. It emerged that some of the goals would be better served by selecting a new programming language. Although Pascal was not excluded initially we paid special attention to identifying a language that would preserve the advantages of Pascal as a teaching language, and simultaneously be appropriate for the teaching of the new OOP paradigm. 3 The choice of programming language 3.1 Factors influencing the choice The choice of teaching language was made considering 5 criteria for a teach- ing language: availability, teacher knowledge, ease of teaching and learning, language utility, and structure appropriate for problem solving (Woodhouse [9]), as well as software quality criterion: The first programming language that is acquired by students should support the elements of good program- ming style that we wish to impart to them (Burgess & Jones [2]). In that case they are more likely to preserve that style in other languages that may be more prevalent but less appropriate for an introductory course. Transactions on Information and Communications Technologies vol 10, © 1995 WIT Press, www.witpress.com, ISSN 1743-3517 Software Engineering in Higher Education 331 We have additionally included the criterion of support for OOP, and of continuity between the concepts used in secondary school education and the proposed introductory course. 3.2 The decision to use Oberon We considered four languages for use in our course: Turbo Pascal (extension of standard Pascal with support for modules and separate compilation of modules, as well as with elements of OOP), C++, Smalltalk, and Oberon. Our choice was Oberon (Reiser & Wirth [6]), a language designed as a suc- cessor of Modula-2. Oberon has all the advantages of Pascal and Modula-2 as teaching languages that are necessary for the teaching of good program- ming style in addition to being inherently object-oriented. Paradoxically, in spite of having an extended functionality due to the addition of object- oriented features, Oberon actually has a more compact syntax than its pre- decessor languages. The object-oriented features of Oberon are introduced as simple extensions of Modula-2 (and Pascal) concepts. In that way the introductory programming course at the university may directly build on the existing foundation of knowledge possessed by the entry-level students. Oberon also satisfies the remaining criteria listed by Woodhouse: It is easily obtainable via anonymous ftp, and there is already a certain amount of local expertise on the language since a group of interested faculty mem- bers has been following the developments around Oberon for some time. Also adequate foreign language literature is available and Slovene literature is in preparation. The other language candidates have been judged less suitable for the following reasons: • Pascal (with extensions introduced by Turbo Pascal) has two prin- cipal drawbacks: the extensions are non-standard; and they are not joined to the language "seamlessly". This is particularly true for the object-oriented elements. In this respect there is a striking contrast between Oberon, which was designed from scratch with compactness of definition and object-orientation in mind, and Turbo Pascal, to which additional elements have been added as an afterthought. • C++ is admittedly widespread in industry, but its syntax is too com- plicated, and it does not support the acquisition of good programming habits. Therefore, it was not judged suitable for a first course in pro- gramming. • Smalltalk requires a different, more radical approach to the teach- ing of OOP, compared with Oberon, and therefore does not meet the requirement of building on an existing foundation of knowledge. Be- sides, experience has shown that the approach used by Smalltalk is considered unusual and less comprehensible by students (Mclaughlin & Lovegrove [4], Traxler [8]). Thus, Smalltalk is more appropriate to higher level courses in the context of subjects that deal with the comparison of different programming paradigms and styles. Transactions on Information and Communications Technologies vol 10, © 1995 WIT Press, www.witpress.com, ISSN 1743-3517 332 Software Engineering in Higher Education 4 Content of the course In the design of the introductory course we have chosen to combine two programming paradigms: the procedural paradigm, and the object-oriented paradigm. The procedural programming paradigm is the foundation upon which we develop the concepts of object-oriented programming. With regard to the detailed course design, we have encountered two problems: • Avoiding the pitfalls characteristic of many procedural programming courses (Smallwood [7]). • The most efficient integration of OOP concepts into the course. 4.1 Early use of procedures and modules The first problem is relatively easily solvable. Oberon's syntax is extremely simple and easily learnable. Besides this, we rely on the students' previous programming knowledge obtained in their previous schooling. Therefore, we do not devote time to detailed syntax presentation, and to the problems of coding; but rather immediately concentrate on the problem of good pro- gram structure. Since the students are already familiar with the concepts of declarations of constants, types, variables and of control flow, we can concentrate on the concepts of procedure and module. Through the use of more complicated examples, we may illustrate program design principles (particularly stepwise refinement), and the advantages of using modules (data abstraction). 4.2 Transition from procedural to object-oriented programming The second problem is harder, and to some extent similar to the dilemma be- tween the "purist" and the "pragmatic" approach to the teaching of object- oriented programming (Parsons [5]). In spite the fact that the choice of Oberon as a teaching language has already made the decision in favour of an incremental (i.e. "pragmatic") approach,
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-