Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning Difficulties in Computer Programming By Dr SC Li.

Similar presentations


Presentation on theme: "Learning Difficulties in Computer Programming By Dr SC Li."— Presentation transcript:

1 Learning Difficulties in Computer Programming By Dr SC Li

2 CS Curriculum Programming Information Processing Computer Systems Teaching Syllabus 1999 20% 60% 50%20%30%

3 Is Programming becoming obsolete in school curriculum?

4 Pros & 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

5 Pros & 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 Relatively little empirical support

6 Case Study Case Study  What is(are) the root(s) of the problems envisaged by the student?

7 Problem with teaching and learning programming  What are the problems of teaching and learning of programming in local context?

8 Problem with teaching and learning 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

9 Problem with teaching and learning programming  It is hard for students to make any meaning out of the programming skills they have learned.

10 Inert 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.

11 Inert Knowledge  Why?  Do mathematicians develop proofs in such an orderly, linear fashion?

12 Inert Knowledge  Mathematicians develop proofs in a nonlinear, search process.

13 Teaching Programming Textbooks syntax and semantics of constructs in a language focus

14 Teaching Programming Why should learning where to put a semicolon in Pascal lead to enhanced problem-solving ability? the lack of impact of programming on problem- solving Focus on instruction of the syntax and semantics

15 Teaching Programming Problem Solving theories, rules, operators, heuristics initial state: a set of symbols goal state Problem ProductProcessvs.

16 Teaching Programming Research Studies A lack of heuristic in composing and coordinating components of a program Learning difficulties

17 Problem-solving with Programming problem-solving skills ability to explore alternative ways (variability) of solving the same problem -- Soloway (1988)

18 How 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 programming

19 How variability is currently taught Variability FOR Loop Construct vs. WHILE Loop Construct TEXTBOOKSTEXTBOOKSTEXTBOOKSTEXTBOOKS

20  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 taught

21  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. radically  It does not require the students to think about the problem in “ radically ” different ways. How variability is currently taught

22 Variability in Novice Programmer Problem-solving poor solution better solution perturbation (local) (global)

23  To help novices break out of the local search (variation) to a global search of solutions: Variability in Novice Programmer Problem-solving Solution Evaluation Skills Variability Exploration Skills

24  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 Programmer Problem-solving

25  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 Programmer Problem-solving

26 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 first three phases

27 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 first three phases

28  The “ Rules ” Characterization  The “ Payoff Matrix ” Characterization  etc. Introducing variability in the 1st phase

29  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 1st phase

30  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 1st phase

31  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 1st phase

32  The “ Payoff Matrix ” Characterization Introducing variability in the 1st phase DrawPlayer 2 winsPlayer 1 wins DrawPlayer 2 wins DrawPlayer 2 wins rock paperscissors rock paper scissors Player 2 Player1Player1

33  The “ Payoff Matrix ” Characterization Introducing variability in the 1st phase 021 1 102 02 1 23 1 2 3 Player 2 Player1Player1

34  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 1st phase

35  The “ Rules ” Characterization   selection plan  The “ Payoff Matrix ” Characterization   formula plan  winning-player := (gesture1 - gesture2 + 3) mod 3; Introducing variability in the 1st phase

36  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 1st phase

37  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 1st phase

38 Introducing variability in the 2nd phases

39

40 Activity  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 2nd and 3rd phases


Download ppt "Learning Difficulties in Computer Programming By Dr SC Li."

Similar presentations


Ads by Google