Using hands-on activities for motivating students with OOP concepts before they are asked to implement them

Teaching Object Oriented Programming (OOP) to novices is problematic. One of the most important instructional problems that are related to OOP is the fact that the object-oriented technique for the development of programs is difficult for students, since it is more abstract than the technique for structured programming and more exacting in the processes of analysis and design. Furthermore, students are not – usually motivated through the use of concepts before they are asked to consider their implementation. What is needed, in order to alleviate the problem, is to design hands-on activities for motivating students with OOP concepts before they are asked to use these concepts for implementing programs. In this paper we make some suggestions for designing hands-on activities. These suggestions are based on our experience from using the hands-on activities of the didactic microworld objectKarel [1]. Using direct-manipulation for interacting with objects of existing classes. In a programming course that uses the OOP paradigm, we consider that one should start directly with the concept of objects. Although there are no relative research results, up to know practice has shown that such an introduction is more successful to one which is based on structured programming and at a later stage presents the concept of objects. Of course, teaching objects as the first basic concept of a programming language is not always easy with traditional programming environments, since students must write a large number of complex for them statements. However, the goal can be achieved without writing programs. Instead the students can just click buttons for creating objects of an existing class that are depicted and buttons for sending messages to the available objects and watching how they respond to them. Moreover, students may be presented with the syntax of the corresponding statements in the programming language, so as to associate the syntax with the semantics of the statements. Of course, this means that the teacher must devote much time for preparing a simple class and a plain GUI for this purpose. In order to avoid this, the teacher can use an existing microworld such as objectKarel that incorporates such an activity, no matter what the taught language is. We believe that this is the most natural way to present the concept of objects/messages since commands are not just written statements but “natural” operations on the depicted objects. Using a familiar program for familiarizing students with common syntax, logic and execution errors. One of the most difficult and frustrating phases in the process of programming is the phase of debugging a program. Unfortunately, students find it difficult to associate the error messages with their source and correct them. The teacher can help students by using a familiar program for making changes that cause common syntax, logic and execution errors that usually appear in students’ programs. This helps students become accustomed with the most common errors and also the special characteristics of the compiler they use regarding error handling. Using specially designed problems for presenting the essence of OOP concepts and not just the concepts. The most common method for presenting an OO concept is through an example. Specifically teachers give the specification of a problem and present a well-designed program that makes use of the taught concept. Students’ attention is concentrated on the implementation of the OO concept presented to them. We believe that it would be better to give students a problem that can not be solved or it is clearly difficult to be solved with the already known concepts and discuss about its solution with them. For example, in order to present the concept of inheritance we can give students a problem that seems to be easy and can be solved with a familiar class, but the program consists of a very large number of statements (i.e. 100 or even more). Students themselves realize that the size of the program makes it difficult to understand, debug or modify it in order to solve a similar problem, although the problem is easy. Through discussion the significance of information hiding, abstraction, creation of new classes, or in other words the significance of inheritance is identified by students. The presentation of a program for the same problem that makes use of these concepts validates their essence in students’ mind. Using program animation for exploring well-designed programs. Program animation can assist students in understanding the semantics of OOP concepts and control structures and also reveals the dynamic nature of program execution. Exploring welldesigned programs with the use of program animation should always precede the development of programs by students. Finally, the teacher should design activities for using and extending existing classes before students start creating new classes from scratch.