teaching of computer programming

22
Teaching of Computer Programming Prof. Dr. M. A. Pasha Chairman Department of CS & IT University of Sargodha

Upload: marpasha

Post on 22-Apr-2015

396 views

Category:

Education


4 download

DESCRIPTION

Computer programming is the heart of computing education. It is a fundamental skill that all computing students are required to learn. However, programming courses are generally considered among the most difficult course and often have the highest dropout rates. The main concern is what concerns of computing faculty is to improve students’ motivation in getting involved in meaningful programming activities. This requires special skills to teach programming. A teacher training workshop was arranged at Directorate of Staff Development for newly inducted Computer Science teachers. The workshop covers various approaches proposed in literature for teaching computer programming. Some useful guidelines have also been suggested. These are the slides of this workshop.

TRANSCRIPT

Page 1: Teaching of  computer programming

Teaching of Computer Programming

Prof. Dr. M. A. PashaChairmanDepartment of CS & ITUniversity of Sargodha

Page 2: Teaching of  computer programming

Computer ProgrammingComputer programming is not just

programming language syntax and using a development environment. At its core, computer programming is solving problems.

Key Objectives should be:Making students able to apply an appropriate

problem-solving method for developing an algorithmic solution to a problem.

Making students aware of some of the basic ethical issues confronting computing professionals.

Page 3: Teaching of  computer programming

Phases of Problem Solving

Page 4: Teaching of  computer programming

Phases of Computer ProgrammingProblem-Solving Phase

1. Analysis and Specification. Understand (define) the problem and what the solution must do.

2. General Solution (Algorithm). Specify the required data types and the logical sequences of steps that solve the problem.

3. Verify. Follow the steps exactly to see if the solution really does solve the problem.

Implementation Phase1. Concrete Solution (Program). Translate the algorithm (the general solution) into a programming language.2. Test. Have the computer follow the instructions. Then manually check the results. If you find errors, analyze the program and the algorithm to determine the source of the errors, and then make corrections.

Maintenance Phase1. Use. Use the program.2. Maintain. Modify the program to meet changing requirements or to correct any errors that show up while using it.

Page 5: Teaching of  computer programming

ExampleProblem: Calculate volume of a box of given dimensions

(width, length, height). The first step to solving any problem is to decompose the

problem description (syntactic analysis)Identify all of the nouns in the sentence (Determine the

volume of a box of given dimensions (width, length, height).Eliminate redundant or irrelevant information ( box,

dimensions). Rule of Thumb: eliminate the most general items.

Divide the remaining nouns into two categories; Input and Output Inputs: width, length, height Output: volume

Identify all of the verbs in the problem statement (processes). Calculate

Page 6: Teaching of  computer programming

Example (cont.)Link your inputs, processes, and output

Input Processing Outputwidth length Calculate volumeheight 

Use external knowledge to complete your solutionVolume = width * length * height

Page 7: Teaching of  computer programming

Example (Cont.)

Algorithm Development using Pseudo code

Get length, width, heightCompute volumevolume = length * width * heightStore volumeDisplay volume

Page 8: Teaching of  computer programming

Example 2 (Decision Making)

Page 9: Teaching of  computer programming

Example 3: Looping

Page 10: Teaching of  computer programming

Convince students not to Adopt Shortcut

Page 11: Teaching of  computer programming

Types of Programmers Types of Students:

Stoppers: In problematic situation, simply stop and abandon all hope of solving the problem on their own

Movers: In problematic situation, keep trying, modifying their code and use feedback about errors effectively

Tinkerers: they are extreme movers. They cannot track their program, make changes more or less randomly, and like stoppers do not progress very much in their task.

Page 12: Teaching of  computer programming

Characteristics of Novice Programmers (Cont.)

Limited to surface knowledge of programs and generally approach programming "line by line" rather than at the level of bigger program structures.

Spend little time in planning and testing code, and when necessary, try to correct their programs with small local fixes instead of more thoroughly reformulating programs.

The knowledge of novices tends to be context specific rather than general , and

Often fail to apply correctly the knowledge they have obtained.

Page 13: Teaching of  computer programming

Where Lies the Problem?

The main source of difficulty does not seem to be the syntax or understanding of concepts, but rather basic program planning.

A student can explain what does a pointer do, but still fails to use it appropriately in a program.

Students may know the syntax and semantics of individual statements, but they do not know how to combine these features into valid programs.

Page 14: Teaching of  computer programming

Approaches to Teaching Programming

Bottom-up: predominantly focuses on teaching of the details of syntax and implementation of data structures concepts. (Stereotype approach)

Top-down: focuses on understanding the abstractions of classical data structures regardless of their physical implementation. Hard for stereotype teachers to think about the abstract

behavior of the implemented structures.Uses components rather than their implementation enable

students to do “interesting” things much earlier than they can in the B-Up-Approach.

A program is a collection of large components interacting with each other rather than a single very long sequence of basic instructions.

Page 15: Teaching of  computer programming

Four Approaches to Teaching Computer Programming

1. Code Analysis 2. Building Blocks 3. Simple Units4. Full systems

Page 16: Teaching of  computer programming

Code Analysis

Learners learn to analyze and understand existing code prior to producing their own.

Learners read and understand programming logic before writing their own. This approach is based on the use of pseudocode so it is not programming language dependent.

The ability to explain programming logic and code appears to be a prerequisite for the ability to write code. ( Campbell and Bolker, 2002); Kölling and Rosenberg, 2001)

Page 17: Teaching of  computer programming

Building Blocks

Learning syntax and semantic before developing serious application.

Learners develop an understanding of individual pieces before combining the pieces to create meaning.

Language constructs are introduced and understood one at a time, in isolation, before combining them.

By combining basic constructs into simple units that solve small well-defined problems, learners can create toolboxes of useful and reusable code fragments.

Page 18: Teaching of  computer programming

Simple Units

Learners master solutions to small problems before applying the learned logic to more complex problems.

The simple units approach is analogous to learning to speak a language from a phrase book with a limited vocabulary.

Page 19: Teaching of  computer programming

Full systems

Learners design a solution to a non-trivial problem and the programming concepts and language constructs are introduced only when the solution to the problem requires their application.

For example, a 2-player game of tic-tac-toe could serve as an introductory problem. To produce this, learners would need to demonstrate skills in decomposition (understanding the problem), handling inputs from the keyboard, displaying outputs in some format, tracking turns (variables/ assignments), determining availability of position (selection/conditional), and identifying a winning move (repetition). The language constructs would be introduced only when that part of the problem needs to be solved. (Duke, et al, 2000; Sattar & Lorenzen, 2009).

Page 20: Teaching of  computer programming

What is Required?The art of programming includes

knowledge of programming tools and languages, problem-solving skills, and effective strategies for program design and implementation. Visualization: Programmers can build solutions both in their

minds and on a computer. Skills: code analysis (tracing and explaining), in

understanding block behaviours (tracing and explaining), in constructing simple units (writing), in combining simple units to create full systems (writing), debugging.

Constructivism (Ben-Ari , 1998), Learning theory and pedagogical methods support this idea.

Page 21: Teaching of  computer programming

Pedagogical GuidelineTeacher-centred learning: the teacher transmit

knowledge and students are passive recipients; teachers put more emphasis on the knowledge itself rather than developing students’ learning skills.

Student –centered learning focuses on the students’ learning; knowledge is constructed by students and the teacher is only a facilitator (Harden and Crosby 2000).

Peer learning methodsGroup workPeer tutoringE-learning

Page 22: Teaching of  computer programming

Any Question Please