learning difficulties in computer programming by dr sc li

40
Learning Learning Difficulties in Difficulties in Computer Programming Computer Programming By Dr SC Li By Dr SC Li

Upload: morris-gilbert

Post on 18-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

Is Programming becoming obsolete in school curriculum?

TRANSCRIPT

Page 1: Learning Difficulties in Computer Programming By Dr SC Li

Learning Difficulties in Learning Difficulties in Computer ProgrammingComputer Programming

By Dr SC LiBy Dr SC Li

Page 2: Learning Difficulties in Computer Programming By Dr SC Li

CS CurriculumCS Curriculum

ProgrammingProgrammingInformation Information ProcessingProcessing

Computer Computer SystemsSystems

Teaching SyllabusTeaching Syllabus

199920% 20% 60%

50% 20% 30%

Page 3: Learning Difficulties in Computer Programming By Dr SC Li

Is Programming Is Programming becoming obsolete in becoming obsolete in school curriculum?school curriculum?

Page 4: Learning Difficulties in Computer Programming By Dr SC Li

Pros & ConsPros & Cons

(+) Programming is a job skill, and that programming instruction should not be included in a general school curriculum

(-) Programming is a subject where one can learn effective problem solving skills

Page 5: Learning Difficulties in Computer Programming By Dr SC Li

Pros & ConsPros & Cons

(+) Programming is a job skill, and that programming instruction should not be included in a general school curriculum

(-) Programming is a subject where one can learn effective problem solving skillsRelatively little empirical support

Relatively little empirical support

Page 6: Learning Difficulties in Computer Programming By Dr SC Li

Case Study

What is(are) the root(s) of the What is(are) the root(s) of the problems envisaged by the problems envisaged by the student?student?

Page 7: Learning Difficulties in Computer Programming By Dr SC Li

Problem with teaching and Problem with teaching and learning programminglearning programming

What are the problems of What are the problems of teaching and learning of teaching and learning of programming in local programming in local context?context?

Page 8: Learning Difficulties in Computer Programming By Dr SC Li

Problem with teaching and Problem with teaching and learning programminglearning programming

The root of this problem lies in the beliefs that:

syntax is is the most important thing to learn in a programming course

student has had to waste the majority of his/her patience, concentration, and effort on keeping the syntax of my programs straight, leaving barely enough of these qualities to devote to solving the problem

Page 9: Learning Difficulties in Computer Programming By Dr SC Li

Problem with teaching and Problem with teaching and learning programminglearning programming

It is hard for students to make any meaning out of the programming skills they have learned.

Page 10: Learning Difficulties in Computer Programming By Dr SC Li

Inert KnowledgeInert Knowledge Example:

Geometry students typically understand each step in a proof, as the teacher puts it on the board, line by line.

They see their teacher develop a proof line by line, and not surprisingly, they think they should be able to do the same.

However, when attempting to do a proof for homework, students often have no idea where begin.

Page 11: Learning Difficulties in Computer Programming By Dr SC Li

Inert KnowledgeInert Knowledge

Why? Do mathematicians develop proofs in

such an orderly, linear fashion?

Page 12: Learning Difficulties in Computer Programming By Dr SC Li

Inert KnowledgeInert Knowledge

Mathematicians develop proofs in a nonlinear, search process.

Page 13: Learning Difficulties in Computer Programming By Dr SC Li

Teaching ProgrammingTeaching Programming

Textbooks Textbooks

syntax and semantics of constructs in a language

focusfocus

Page 14: Learning Difficulties in Computer Programming By Dr SC Li

Teaching ProgrammingTeaching Programming

Why should learning where to Why should learning where to put a semicolon in Pascal lead to put a semicolon in Pascal lead to enhanced problem-solving enhanced problem-solving ability?ability?

the lack of impact of programming on problem-solving

Focus on instruction of the syntax and semantics

Page 15: Learning Difficulties in Computer Programming By Dr SC Li

Teaching ProgrammingTeaching ProgrammingProblem Solving

theories, rules,

operators, heuristics

initial state:

a set of symbolsgoal state

Problem ProductProcess vs.vs.

Page 16: Learning Difficulties in Computer Programming By Dr SC Li

Teaching ProgrammingTeaching Programming

Research StudiesResearch Studies

A lack of heuristic in composing and coordinating components of a program

Learning difficultiesLearning difficulties

Page 17: Learning Difficulties in Computer Programming By Dr SC Li

Problem-solving with ProgrammingProblem-solving with Programming

problem-solving skillsproblem-solving skills

ability to explore alternative ways (variability) of solving the same problem

-- Soloway (1988)

Page 18: Learning Difficulties in Computer Programming By Dr SC Li

How variability is currently taughtHow variability is currently taught

Nice, clean, straightforward “step-wise” refinements of problem

students nod their heads at every step in the transformation but don’t see - because they are not shown - the myriad of design decisions that have been left out.

Textbook shows that only one decomposition is needed to derive a program, students believe that they too should only do one decomposition.

Structured programmingStructured programming

Page 19: Learning Difficulties in Computer Programming By Dr SC Li

How variability is currently taughtHow variability is currently taught

VariabilityVariability

FORFOR Loop Construct vs. Loop Construct vs. WHILEWHILE Loop Construct Loop Construct

TTEEXXTTBBOOOOKKSS

Page 20: Learning Difficulties in Computer Programming By Dr SC Li

What is the student supposed to learn from this variability? When is one more appropriate than the other?

Students: Why then textbooks show both? Why

should I learn both structures when one is equivalent to the other?

How variability is currently taughtHow variability is currently taught

Page 21: Learning Difficulties in Computer Programming By Dr SC Li

In sum, the little variability that is explicitly shown in the majority of textbooks actually gives students the wrong idea of why variability is important: textbooks focus on the twiddles at the construct level.

It does not require the students to think about the problem in “radicallyradically” different ways.

How variability is currently taughtHow variability is currently taught

Page 22: Learning Difficulties in Computer Programming By Dr SC Li

Variability in Novice Programmer Variability in Novice Programmer Problem-solvingProblem-solving

poor solution

better solution

perturbation

(local)

(global)

Page 23: Learning Difficulties in Computer Programming By Dr SC Li

To help novices break out of the local search (variation) to a global search of solutions:

Variability in Novice Variability in Novice Programmer Problem-solvingProgrammer Problem-solving

Solution Evaluation SkillsSolution Evaluation Skills Variability Exploration SkillsVariability Exploration Skills

Page 24: Learning Difficulties in Computer Programming By Dr SC Li

Solution Evaluation Skills Novices need better evaluation skills so that

they can better characterize and differentiate “poor” solutions from “better” solutions.

Variability Exploration Skills Novices need to understand the sources of

variability that precede simple twiddling with language constructs, for the ability to generate “radically” different solutions resides lies in the skill of exploring alternatives in those earlier problem-solving phases

Variability in Novice Variability in Novice Programmer Problem-solvingProgrammer Problem-solving

Page 25: Learning Difficulties in Computer Programming By Dr SC Li

Phases in the Novice Program Generation Process

Understand problem specification Decompose problem into programmable

goals and objects Select and compose plans to solve problem Implement plans in language constructs Reflect - Evaluate final artifact and overall

design process

Variability in Novice Variability in Novice Programmer Problem-solvingProgrammer Problem-solving

Page 26: Learning Difficulties in Computer Programming By Dr SC Li

Rock-paper-Scissors Problem: Rock-paper-Scissors is a two player game.

Each player simultaneously makes one of three possible gestures, signifying either rock, paper, or scissors. The winner is determined by the following rules:

1. Paper covers rock paper wins 2. Scissors cut paper scissors win 3. rock breaks scissors rock wins 4. Same gesture draw

Introducing variability in the Introducing variability in the first three phasesfirst three phases

Page 27: Learning Difficulties in Computer Programming By Dr SC Li

Rock-paper-Scissors Problem: write a program that takes as input the two

players’ gestures and determines who the winning player is, player 1, player 2, or neither. The input should be encoded as follows: 1=rock, 2=paper, 3=scissors. Your program should also ask for how many games to play and then play that many games, keeping track of the number of player 1 wins, player 2 wins, and draws. Print out the over-all results after all games have been played.

Introducing variability in the Introducing variability in the first three phasesfirst three phases

Page 28: Learning Difficulties in Computer Programming By Dr SC Li

The “Rules” Characterization The “Payoff Matrix” Characterization etc.

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 29: Learning Difficulties in Computer Programming By Dr SC Li

The “Rules” Characterization 1. If the two gesture are paper and rock, THEN

the winning gesture is paper. 2. If the two gesture are scissors and paper,

THEN the winning gesture is scissors. 3. If the two gesture are rock and scissors , THEN

the winning gesture is rock. 4. If the two gesture are the same, THEN neither

gesture wins.

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 30: Learning Difficulties in Computer Programming By Dr SC Li

Encoded Rules 1. If the two gesture are 2 and 1, THEN 2 wins. 2. If the two gesture are 3 and 2, THEN 3 wins. 3. If the two gesture are 1 and 3, THEN 1 wins. 4. If the two gesture are the same, THEN neither

gesture wins.

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 31: Learning Difficulties in Computer Programming By Dr SC Li

Object: Gesture 1 = rock is the gesture 2 = paper is the gesture 3 = scissors is the gesture

Object: Winning-gesture 0 = neither gesture wins 1 = rock is winning gesture 2 = paper is winning gesture 3 = scissors is winning gesture

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 32: Learning Difficulties in Computer Programming By Dr SC Li

The “Payoff Matrix” Characterization

Introducing variability in the Introducing variability in the 1st1st phase phase

Draw Player 2 wins Player 1 wins

Player 1 wins

Player 1 wins DrawPlayer 2 wins

Draw Player 2 wins

rock paper scissors

rock

paper

scissors

Player 2

Player 1

Page 33: Learning Difficulties in Computer Programming By Dr SC Li

The “Payoff Matrix” Characterization

Introducing variability in the Introducing variability in the 1st1st phase phase

0 2 1

1

1 02

0 2

1 2 3

1

2

3

Player 2

Player 1

Page 34: Learning Difficulties in Computer Programming By Dr SC Li

Object: Winning-player 0 = neither player wins 1 = player 1 is the winning player 2 = player 2 is the winning player

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 35: Learning Difficulties in Computer Programming By Dr SC Li

The “Rules” Characterization selection plan

The “Payoff Matrix” Characterization formula plan winning-player := (gesture1 - gesture2 + 3) mod 3;

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 36: Learning Difficulties in Computer Programming By Dr SC Li

Even a novice who knows how to generate alternate alternative characterizations might stop after generating the first unless they are explicitly instructed.

The alternative characterization might lead to a “worse” solution, but even then it would be an opportunity for the novices to improve their plan evaluation and differentiation skills.

Generating alternative characterizations puts the student in a position to make informed judgements in identifying the advantages and disadvantages of alternative plans.

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 37: Learning Difficulties in Computer Programming By Dr SC Li

For instance: The payoff matrix characterization leads to a

formula plan that is very concise, but may be hard to understand because it is so concise.

The rule characterization leads to a less concise selection plan, but it may be easier to understand because it is similar to our common-sense intuitions about how people actually play the game.

Introducing variability in the Introducing variability in the 1st1st phase phase

Page 38: Learning Difficulties in Computer Programming By Dr SC Li

Introducing variability in the Introducing variability in the 2nd 2nd phasesphases

Page 39: Learning Difficulties in Computer Programming By Dr SC Li

Introducing variability in the Introducing variability in the 2nd 2nd phasesphases

Page 40: Learning Difficulties in Computer Programming By Dr SC Li

ActivityActivity With regard to the rule characterization of

the RPS problem, generate multiple approaches to problem decomposition (phase 2) and selection and composition of plans (phase 3) to solve the problem.

Introducing variability in the Introducing variability in the 2nd and 3rd2nd and 3rd phases phases