1 / 51

The Structure and Interpretation of the Computer Science Curriculum

The Structure and Interpretation of the Computer Science Curriculum. Matthias Felleisen Northeastern University. SICP - We believe …. It’s a fantastic book. It has flaws. Let’s improve it. SICP was Great for the FP Community. Exposure to functional concepts complex, structured data

hutton
Download Presentation

The Structure and Interpretation of the Computer Science Curriculum

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Structure and Interpretation of the Computer Science Curriculum Matthias Felleisen Northeastern University

  2. SICP - We believe … It’s a fantastic book. It has flaws. Let’s improve it.

  3. SICP was Great for the FP Community • Exposure to functional concepts • complex, structured data • higher-order functions • streams • Exposure to Scheme, a (mostly) functional language

  4. SICP was great for CS1 Community • It destroyed the tyranny of syntax in CS1. • It showed the world that CS is an intellectually deep field. • It liberated CS1 from fashion …

  5. So what happened? • … or did it? • Why did the use of Scheme decline so rapidly? Why wasn’t it replaced by FPLs? • Why did SICP courses go away everywhere?

  6. Why did SICP fail? Was SICP just fashionable for a while? Is it the victim of the fashion-obsession in CS? Especially CS1? Was SICP flawed? Did it fail CS departments in other ways? Why does this matter?

  7. SICP: the Milestone • SICP is a milestone in international CS1 history … every decent CS1 author must justify a new book with a critique • If SICP failed, the F/D community must understand its problems and try to overcome them. Otherwise, we repeat history and lose.

  8. HtDP and DrScheme HtDP is a new text book. It uses Scheme. It is for CS1. Ergo, it needs a design rationale and a comparison to SICP. This paper is it.

  9. Part 2: The Structure of the CS Curriculum

  10. Introductory Programming and Computing • Sociological constraints • Timing constraints • Content constraints

  11. Introductory Programming and Computing Parents: “Newsweek writes about Java a lot. Why are they teaching my son Scheme? Student: “I know everything, and I know that Cobol is it!” CS 1 Introduction to Programming and Computing Industry: “Today we’re using C# v4.538. How come you’re not teaching that?” Colleague: “Everything in my world needs pointers. They better learn that in CS1.”

  12. Introductory Programming and Computing students who can program in some PL at similar skill level CS 1 Introduction to Programming and Computing students w/o any background students who “program” students with math. bg

  13. Introductory Programming and Computing the first summer life Timing Constraints: Students need something practial at those points.

  14. Introductory Computing and Programming • CS1 cannot satisfy all constraints • We must pick those that are compatible with a university’s promise to its students. • We must help instructors to develop the spine to stand up for the goals they adopt.

  15. Introductory Computing and Programming Thesis 1: The University’s goal is to produce effective software developers who can quickly adapt to current practice and who can survive in a software related profession for decades.

  16. Introductory Computing and Programming Thesis 2: A University’s CS curriculum should concentrate on principles for most of the time but it should accommodate “industrial” needs during the second semester and the fourth (last) year.

  17. Introductory Computing and Programming Thesis 3: The first year should start with an emphasis on principles and should then migrate to something that students can use in a first summer internship.

  18. The First Course

  19. Principles for the First Course • the first course does not exist in a vacuum; it must prepare for the second course • the second course should, and will, teach some form of class-based, object-oriented programming

  20. Principles for the First Course • What do we teach in the first course in Scheme (or some other F/D language) so that students like it and so that they are prepared for the second course? • What’s the strength of F/D in this context?

  21. Principles for the First Course • Students must learn to read problem statements. • Their reading must help them produce: • a description of the classes of data that matter • a concise purpose statement for the program

  22. Principles for the First Course • Students must illustrate abstract statements with • concrete examples, in particular, they must have • their classes of data • their purpose statement

  23. Principles for the First Course Students must be able to create a program organization based on their data descriptions. In an FP world, this usually means using an algebraic datatype. In an OOP world, this translate to a class hierarchy.

  24. Principles for the First Course Students must check their facts. That is, they must learn to test their programs and test them automatically.

  25. Principles for the First Course • FP helps because it is value-oriented. It naturally separates reasoning about classes from other OOP ideology. • Reasoning about classes of values and exploiting this reasoning for the systematic construction of programs is what FP is best at.

  26. Scheme is the best.

  27. Scheme is the best • No, it is NOT the Scheme from SICP. • Scheme, like any other language, is unsuitable for a first course. • But, Scheme has a number of advantages that we can exploit. • See our other publications on this topic.

  28. How SICP Fails Students and Departments

  29. SICP’s Failures: Professionals’ Views Jackson and Chapin, MIT: from an educational point of view, our experience suggests that undergraduate computer science courses should emphasize basic notions of modularity, specification, and data abstraction, and should not let these be displaced by more advanced topics, such as design patterns, object-oriented methods, concurrency, functional languages, and so on. They are primary SICP consumers.

  30. SICP’s Failures: Students’ Views “A few years ago, I was trying to hire MIT students as undergraduate research assistants, and I asked one undergrad why it seemed that most all MIT students wanted to code in Java and have nothing to do with Scheme after they passed 6.001 (the SICP course). He felt that students were turned off by a combination of the tools and the nature of the assignments. The default Scheme implementation, he claimed was painfully slow. … He also said something about students associating Scheme with unpleasant problem sets in what is understandably a challenging first-year course.

  31. SICP’s Failures: Students’ Views “… Some time later, when I asked him why MIT Scheme says "Happy Happy Joy Joy" when you exit, he said that was because exiting meant that your problem sets were done. ------------------------------------------------------------------ 1 ]=> (exit) Kill Scheme (y or n)? Yes Happy Happy Joy Joy. ------------------------------------------------------------------

  32. SICP’s Coverage functional progr. higher-order progr. data abstraction impl. objects stream-based progr. modules logic progr. primality interval arithmetic symb. differentiation representing sets digital circuits interpreters register machines, compilers Programming: Content Domain:

  33. SICP and Programming Knowledge • examples, examples, examples • exercises: • modify existing code • solve a very similar, related problem • students, now do it on your own Students must learn implicitly. SICP does not contain explicit program design knowledge.

  34. SICP Domain Knowledge • SICP covers two domains: • mathematical problems, with an EE flavor • meta-problems (problems about Computing) SICP fails to cover a broad range of “application flavored” problems.

  35. SICP in Summary • Whereas SICP covers a range of interesting programming techniques, and • whereas SICP covers a range of interesting math. problem domains, • SICP fails to state program design knowledge and • SICP does not hook students on FP. NOT SUITABLE FOR A FIRST COURSE

  36. How to Design Programs

  37. HtDP’s Starting Point • State design principles explicitly. • Make sure design principles scale to OO. • Use simple domain knowledge that doesn’t distract from program design. • Develop supplements that illustrate design in practial and interesting context.

  38. HtDP’s Design Recipes • problem analysis & data definition • contract, purpose statement, function header • examples of data, behavioral examples • function template • function body • tests

  39. HtDP: Data Definitions and OOP Dog name : String age : Number neutered : Boolean type Dog = struct{name:String, age:Number, neutered:Boolean}

  40. HtDP: Data Definitions and OOP Circle Posn radius : Number center : Posn color : String x : Number y : Number type Posn = struct{x:Number, y:Number} type Circle = struct{radius:Number, center:Posn, color:String} containment (has-a)

  41. HtDP: Data Definitions and OOP type Shape = Circle of … | Square of … | Line of … | … Shape Circle Square Line superclasses (is-a)

  42. HtDP: Data Definitions and OOP type Shape = Circle of … | Square of … | Union of Shape * Shape Shape Circle Square Union recursive data descriptions (mixing has-a/is-a)

  43. HtDP: Data Definitions and OOP type Shape = Circle of … | Square of … | Union of ShapeList and ShapeList = empty | cons of Shape * ShapeList Shape ShapeL mutual references

  44. HtDP: Data Definitions and OOP fun f_and_g(delta1, delta2) = fn s => … functional abs. fun f(s) = … fun g(s) = … f() { … } template and hook f() { … } g() { … }

  45. HtDP: Other Ideas • generative vs structural recursion -- or how insertion sort really differs from quicksort • accumulator-style functions don’t have to be tail recursive; they do accumulate • effects are orthogonal to the game; a disciplined story

  46. HtDP: Domain Knowledge • pairs, teachpacks, and partners • simple games • simple graphics • simple Web interactions • and more to come

  47. Conclusions

  48. Conclusions • The first course can, and ought to, teach principles. • The first course must prepare the second course. • The second course is, and will be, OOP.

  49. Conclusions • FP is great for the first course, because it helps students learn to reason about values and classes of values. • From class descriptions it is a short step to a schematic program organization that anticipates OO class hierarchies in the second course.

  50. Conclusions • HtDP is our attempt to turn this idea into reality. • It emphasizes program design knowledge. • It comes with a supportive PDE. • Soon, it will integrate exercises that are easy in FP and yet are extremely concrete and applied.

More Related