Teaching

Information about Teaching

Published on December 5, 2007

Author: Marian

Source: authorstream.com

Content

preparation :  preparation start drscheme set language level to Beginner open in Presentations length1.ss length2.ss icons.ss planets0.ss convert.ss add teachpack convert.ss How to Produce the Best OO Programmers: By Teaching Program Design :  How to Produce the Best OO Programmers: By Teaching Program Design Matthias Felleisen Rice University Houston, Texas Current Practice in Introductory Courses:  Current Practice in Introductory Courses teach the syntax of a currently fashionable programming language use Emacs or commercial PE show examples of code and ask students to mimic discuss some algorithmic ideas (BigO) Current Practice: Syntax and PEs:  Current Practice: Syntax and PEs wage_per_hour * number_of_hours = total_wage In you favorite C++ or Java programming environment: Current Practice: Design vs Tinkering/O:  Current Practice: Design vs Tinkering/O syntax: tinker until it works design: tinker until it works, too teaching standard algorithms doesn’t replace a discipline of design analyzing algorithms doesn’t say how we should design programs Lessons: The Trinity:  Lessons: The Trinity simple programming language programming environment for beginners a discipline of design: classes of data TeachScheme!:  TeachScheme! TeachScheme! is not MIT Scheme!:  TeachScheme! is not MIT Scheme! not MIT’s Scheme not MIT’s programming environment most importantly: not MIT’s non-design SICP fails the normal student SICP fails to convey the central role of design SICP has an outdated idea of OO programming Part I: The Programming Language:  Part I: The Programming Language Programming Language: Scheme:  Programming Language: Scheme Scheme’s notation is simple: (, operation, operands, ) Scheme’s semantics is easy: it’s just the rules of mathematics: 1+1 = 2 With Scheme, we can focus on ideas Programming Language: Scheme Again:  Programming Language: Scheme Again simple syntax simple semantics powerful PE rich language it’s a lie! more lies! do you believe this? so where are the GUIs? Syntax is a Problem:  Syntax is a Problem simple notational mistakes produce strange results -- without warning simple notational mistakes produce error messages beyond the students’ knowledge … and even in Scheme there are just too many features Programming Languages: Not One, Many:  Programming Languages: Not One, Many language 1: first-order functional PL function definition and application conditional expression structure definition language 2: local function definitions language 3: functions and effects higher-order functions set! and structure mutation begin Programming Languages:  Programming Languages arrange programming language in pedagogic layers put students into a knowledge-appropriate context focus on design ideas relative to this context Part II: The Programming Environment:  Part II: The Programming Environment On to the Programming Environment:  On to the Programming Environment one PE for all language levels the PE must allow instructors to supplement code at all levels --- even if the code does not conform to the level the PE must enable interactive exploration DrScheme: Beginner Level :  DrScheme: Beginner Level error message due to restricted syntax check syntax pictures are values [if time] teachpacks Part III: Design Recipes:  Part III: Design Recipes Program Design for Beginners:  Program Design for Beginners foster basic good habits the design is rational its steps explain the code’s structure the design focuses on classes of data the process is accessible to beginner Design Recipes:  Design Recipes IMPERATIVE: Teach Model-View Separation Design Recipes:  Design Recipes the programming environment must support extreme separation of view and model demonstrate temperature conversion The Basic Design Recipe:  The Basic Design Recipe data analysis and class definition contract, purpose statement, header in-out (effect) examples function template function definition testing, test suite development Design Recipes: Class Definitions:  Design Recipes: Class Definitions use rigorous language, not formalism naïve set theory basic sets: numbers, chars, booleans intervals on numbers (labeled) products, that is, structures (tagged) unions self-references vectors (much later) Design Recipes: Class Definitions (2):  Design Recipes: Class Definitions (2) (define-struct spider (name size legs)) A spider is a structure: (make-spider symbol number number) Design Recipes: Class Definitions (3):  Design Recipes: Class Definitions (3) A zoo animal is either a spider an elephant a giraffe a mouse … Each of these classes of animals has its own definition Design Recipes: Class Definitions (4):  Design Recipes: Class Definitions (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) Let’s make examples: empty (by definition) (cons (make-spider ‘Asterix 1 6) empty) (cons (make-spider ‘Obelix 99 6) (cons … …)) Design Recipes: Class Definitions (5):  Design Recipes: Class Definitions (5) (define-struct child (name father mother)) A family tree is either ‘unknown (make-child symbol a-family-tree a-family-tree-2) Many, if not most, interesting class definitions are self-referential. Design Recipes: Templates:  Design Recipes: Templates a template reflects the structure of the class definitions (for input, mostly) this match helps designers, readers, modifiers, maintainers alike Design Recipes: Templates (2):  Design Recipes: Templates (2) is it a basic class? is it a union? is it a structure? is it self-referential? “domain knowledge” case analysis extract field values annotate for recursion Design Recipes: Templates (3):  Design Recipes: Templates (3) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) … ) is it a union? Design Recipes: Templates (4):  Design Recipes: Templates (4) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ <<condition>> <<answer>> ] [ <<condition>> <<answer>> ])) what are the sub-classes Design Recipes: Templates (5):  Design Recipes: Templates (5) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) <<answer>> ] [ (cons? a-loZA) <<answer>> ])) are any of the potential inputs structures? Design Recipes: Templates (6):  Design Recipes: Templates (6) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) is the class definition self-referential? Design Recipes: Templates (7):  Design Recipes: Templates (7) A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) … ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Design Recipes: Defining Functions :  Design Recipes: Defining Functions templates remind beginners of all the information that is available which cases which field values, argument values which natural recursions are computed the goal of function definitions is to compute with the available values to combine the computed effects Design Recipes: Overview:  Design Recipes: Overview basic data, intervals of numbers structures unions self-reference in class description several different cases [all one recipe] mutual references generative recursion special attributes: accumulators effects abstraction of designs Design Recipes: Conclusion :  Design Recipes: Conclusion get students used to discipline from DAY ONE use scripted question-and-answer game until they realize they can do it on their own works well as long as class definitions are “standard” Part IV: From Scheme to Java :  Part IV: From Scheme to Java Training OO Programmers On to Java: What is OO Computing? :  On to Java: What is OO Computing? Scheme to Java: OO Computing :  Scheme to Java: OO Computing focus: objects and method invocation basic operations: creation select field mutate field select method via “polymorphism” structures and functions basic operations: creation select field mutate field recognize kind f(o) becomes o.f() Scheme to Java: OO Programming:  Scheme to Java: OO Programming develop class and interface hierarchy allocate code of function to proper subclass develop class definitions allocate code of function to proper cond-clause Scheme to Java: Class Hierarchy:  Scheme to Java: Class Hierarchy A list of zoo animals is either empty (cons animal a-list-of-zoo-animals) Scheme to Java: Code Allocation:  Scheme to Java: Code Allocation ;; fun-for-zoo : list-of-zoo-animals -> ??? (define (fun-for-zoo a-loZA) (cond [ (empty? a-loZA) ] [ (cons? a-loZA) … (first a-loZA) … … (rest a-loZA) … ])) Scheme to Java: Ketchup & Caviar:  Scheme to Java: Ketchup & Caviar abstract class List_Zoo_Animal { int fun_for_list(); } class Cons extends List_Zoo_Animal { Zoo_Animal first; List_Zoo_Animal rest; int fun_for_list() { return 1 + rest.fun_for_list(); } } class Empty extends List_Zoo_Animal { int fun_for_list() { return 0; } } Scheme to Java: Ketchup & Caviar:  Scheme to Java: Ketchup & Caviar abstract class List_Zoo_Animal { int fun_for_list(); } class Cons extends List_Zoo_Animal { Zoo_Animal first; List_Zoo_Animal rest; int fun_for_list() { return 1 + rest.fun_for_list(); } } class Empty extends List_Zoo_Animal { int fun_for_list() { return 0; } } Scheme to Java:  Scheme to Java the design recipes work step for step for the production of OO programs the differences are notational the differences are instructive Why not just Java first?:  Why not just Java first? complex notation, complex mistakes no PE supports stratified Java design recipes drown in syntax Part V: Experiences :  Part V: Experiences Experiences: Rice Constraints:  Experiences: Rice Constraints life-long learners accommodate industry long-time enable students to gain industry experience after two semesters no trends, no fashion oo programming components until recently: C++ now more and more: Java, true OOP Experiences: The Rice Experiment:  Experiences: The Rice Experiment beginners: no experience, up to three years of experience comp sci introduction: TeachScheme curriculum good evaluation huge growth many different teachers applied comp introduction: C/C++ curriculum weak evaluations little growth several teachers second semester: OOP, classical data structures, patterns Experiences: The Rice Experiment :  Experiences: The Rice Experiment Faculty with preferences for C/C++ state that students from the Scheme introduction perform better on exams and projects in second course than students from the C/C++ introduction Students with lots of experiences eventually understand how much the course adds to their basis Experiences: Secondary Schools:  Experiences: Secondary Schools trained nearly 80 teachers/professors 65 deployed the curriculum, reuse it better basis for second courses much higher retention rate especially among females Conclusion:  Conclusion training good programmers does not mean starting them on “currently fashionable” tools provide a strong, rigorous foundation in data-oriented, class-oriented thinking then, and only then, expose to current fashion Conclusion :  Conclusion training takes more than teaching some syntax and good examples training takes a simple, stratified language an enforcing programming environment a rational design recipe Teach Scheme! Slide57:  The End Credits :  Credits Findler Flanagan Flatt Krishnamurthi Cartwright Clements Friedman Steckler

Related presentations


Other presentations created by Marian

Manchester United 081204
14. 03. 2008
0 views

Manchester United 081204

lecture3
13. 04. 2008
0 views

lecture3

Session2 2 Yves
30. 03. 2008
0 views

Session2 2 Yves

20040820 RepICFA HN
27. 03. 2008
0 views

20040820 RepICFA HN

Cold War 2
18. 03. 2008
0 views

Cold War 2

rcc
12. 03. 2008
0 views

rcc

TGchapter8 Concepts
11. 03. 2008
0 views

TGchapter8 Concepts

Livingalive
04. 03. 2008
0 views

Livingalive

57351 1
28. 02. 2008
0 views

57351 1

SearchingtheInternet
26. 02. 2008
0 views

SearchingtheInternet

gopinath
24. 02. 2008
0 views

gopinath

landforms of canada
02. 10. 2007
0 views

landforms of canada

Power Point Colorado
03. 10. 2007
0 views

Power Point Colorado

Faults and Earthquakes
29. 10. 2007
0 views

Faults and Earthquakes

consumer360 2005 apples
05. 11. 2007
0 views

consumer360 2005 apples

group exercise
03. 12. 2007
0 views

group exercise

SWW3 Chilingaryan
02. 11. 2007
0 views

SWW3 Chilingaryan

Siranjeev 09 04 2006 WOII
13. 11. 2007
0 views

Siranjeev 09 04 2006 WOII

Competition Formats PP MT
16. 11. 2007
0 views

Competition Formats PP MT

tiger presentation
22. 11. 2007
0 views

tiger presentation

cecildb01
13. 12. 2007
0 views

cecildb01

VietnamWar
25. 12. 2007
0 views

VietnamWar

Peter Uvin conference paper
27. 12. 2007
0 views

Peter Uvin conference paper

Week 01 Introduction to IPE
28. 12. 2007
0 views

Week 01 Introduction to IPE

atividadefisica
29. 12. 2007
0 views

atividadefisica

f35 frosh sem cryptography
31. 12. 2007
0 views

f35 frosh sem cryptography

Kashmir presentation US India
01. 01. 2008
0 views

Kashmir presentation US India

ellis ed fc fdr
03. 01. 2008
0 views

ellis ed fc fdr

A 3 SMurphy
04. 01. 2008
0 views

A 3 SMurphy

THE COLD WAR
21. 12. 2007
0 views

THE COLD WAR

aquaculture
07. 01. 2008
0 views

aquaculture

brenda final
19. 11. 2007
0 views

brenda final

KS RuralEnvironment Tilden
28. 11. 2007
0 views

KS RuralEnvironment Tilden

05 25 Mayer PMC
29. 12. 2007
0 views

05 25 Mayer PMC

WinterManureApplppt
07. 01. 2008
0 views

WinterManureApplppt

CHEST2
04. 01. 2008
0 views

CHEST2

New AI
21. 11. 2007
0 views

New AI

airforce camp brief
18. 12. 2007
0 views

airforce camp brief

presentation ACFAS2 000
05. 11. 2007
0 views

presentation ACFAS2 000

eifert 9 15 07
03. 01. 2008
0 views

eifert 9 15 07

HowtoDoResearchonMov ies
19. 02. 2008
0 views

HowtoDoResearchonMov ies

item 633 12 Lacis labots
06. 11. 2007
0 views

item 633 12 Lacis labots

3022 office en
27. 11. 2007
0 views

3022 office en

6 3 Groundwater
09. 10. 2007
0 views

6 3 Groundwater

EAS303
21. 11. 2007
0 views

EAS303

20071103 DUSEL DC
17. 12. 2007
0 views

20071103 DUSEL DC

Its All Politics 1
04. 01. 2008
0 views

Its All Politics 1

Ernesto
01. 10. 2007
0 views

Ernesto

Barish EAC
18. 12. 2007
0 views

Barish EAC

conditional propositions
16. 11. 2007
0 views

conditional propositions

OpeningCreatImpr
05. 11. 2007
0 views

OpeningCreatImpr