Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Teaching Programming to Beginners

Paul Fischer IMM, DTU

Teaching Programming to Beginners p. 1/13

What is the goal of a programming course?


Is the goal to teach the students to write or maintain programs in some language? to solve problems with a computer? The question is whether to only teach one or more programming languages or programming techniques.

Teaching Programming to Beginners p. 2/13

My opinion
I think programming techniques are essential. Many tasks previously performed by mechanical devices are now performed by computers. An engineer has always been taught to evaluate dierent designs of mechanical objects. He knows when to use rivets, when to use nuts and bolts and when to weld. Likewise should he know and be able to evaluate alternatives when it comes to software solutions.

Teaching Programming to Beginners p. 3/13

Programming language courses


Teaching a programming language means teaching syntax and semantics Data types and their features. Assignments and other operations. Control structures. Langauge specic concepts: Inheritance, pointer accessability, memory management, dirty tricks. Distribution specic elements: Libraries.

Teaching Programming to Beginners p. 4/13

Programming techniques courses


Teaching programming techniques means teaching general concepts and techniques such as Encapsulation, message passing. Recursion, inheritance. Concurrent/parallel programming. Program design patterns: Model-View-Control structure. Algorithm design patterns: Divide-and-Conquer, Dynamic Programming. This might be part of other courses.

Teaching Programming to Beginners p. 5/13

Role of the language


When teaching programming techniques, the programming language is only a means to introduce and exemplify general programming concepts. These concepts should be introduced as independent of the language as possible. Especially dirty tricks or put-all-in-one-statement programming should be avoided when demonstrating the concepts. These things should be banned to a language course

Teaching Programming to Beginners p. 6/13

Choice of the programming language 1


An unknown language like SCHEME or MAPLE levels the start conditions: + Students without any programming experience do not get the feeling of being way behind others. + Students with highly developed hacker skills in some other language can be motivated to re-think their programming approaches. Limited instructional material. Cryptic error messages, clumsy syntax, causes frustrations. Fun things are not (well) supported.

Teaching Programming to Beginners p. 7/13

Choice of the programming language 2


Using a standard language like C, C++, Java leads to big dierences amongst the beginners. Students without any programming experience become frustrated easily. Students with large programming experience, get bored when concepts they (believe to) know are repeated and loose interest in the general principles. + Large amounts of instructional material. + Comfortable development environments. + Large number of libraries.

Teaching Programming to Beginners p. 8/13

Personal opinion
Even when teaching programming techniques, one should choose a language which is not too exotic or abstract. The problem with an unusual language is that people might think that the programming paradigms they learned can only be used with that language and are not supported by more common languages.

Teaching Programming to Beginners p. 9/13

Instructional means I
Show the skilled programmers that they do not know everything: Transform boolean conditions, e.g., change between WHILE(cond) and REPEAT . . . UNTIL(cond).

Use advanced data structures (trees, maps, tables), and components (iterators, comparators). Wrong use of recursion (Compute Fibonacci(40)). Small (voluntary) competitions.

Teaching Programming to Beginners p. 10/13

Instructional means II
For the less skilled programmers: Structured presentation Abstract programming concept. Examples for appropriate use. Implementation. Show alternatives and discuss when to use which one. Example: Encapsulation and inheritance support dierent implementations of an abstract data type.

Teaching Programming to Beginners p. 11/13

My criteria for the programming language

Powerful enough to demonstrate the programming concepts. Easy to learn (rather restrict to a part of the language than to drop important concepts). Not error-prone: Get running programs fast. Good documentation, suciently many good books. Easy to use development tools. Well supported fun things: Graphics, accessing the web.

Teaching Programming to Beginners p. 12/13

The role of graphics


Graphical components provide an excellent mean to demonstrate programming concepts. For example Recursion can be demonstrated by constructing and displaying a directory tree. Applications with graphical interfaces are complex enough to demonstrate the advantages of a structural approach (inheritance, model-view-control). The need for parallel processes can be demonstrated.

Teaching Programming to Beginners p. 13/13

You might also like