1 / 14

Back to Basics in CS1 and CS2

Back to Basics in CS1 and CS2. Stuart Reges University of Washington. In a Nutshell…. Major redesign of the CS1/CS2 courses at the University of Washington New CS1 emphasizes procedural programming, objects later

betty_james
Download Presentation

Back to Basics in CS1 and CS2

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. Back to Basicsin CS1 and CS2 Stuart Reges University of Washington

  2. In a Nutshell… • Major redesign of the CS1/CS2 courses at the University of Washington • New CS1 emphasizes procedural programming, objects later • New CS2 includes OOP concepts and traditional concepts (recursion, linked lists, binary trees) with a “collections” theme • Student satisfaction up; enrollment up; female admissions up

  3. I used to believe Programs with sophisticated graphics and GUIs would be more fun for CS1 students than console and file based programs I found: They were often less fun I now believe: Students enjoy writing complete programs Students prefer standard Java Graphics gets old fast Our “sophisticated” programs are fairly crude The problem solving challenge is more important than surface appearance

  4. Confession: I have them write a program that produces this (console output, ascii art): /**\ //**\\ ///**\\\ ////**\\\\ /////**\\\\\ +=*=*=*=*=*=*+ |../\..../\..| |./\/\../\/\.| |/\/\/\/\/\/\| |\/\/\/\/\/\/| |.\/\/..\/\/.| |..\/....\/..| +=*=*=*=*=*=*+ |\/\/\/\/\/\/| |.\/\/..\/\/.| |..\/....\/..| |../\..../\..| |./\/\../\/\.| |/\/\/\/\/\/\| +=*=*=*=*=*=*+ /**\ //**\\ ///**\\\ ////**\\\\ /////**\\\\\

  5. I used to believe • I could teach object oriented design in CS1 instead of procedural design • I found: • Java objects involve a lot of syntactic detail • There are no 50-100 line programs where OOD helps • Many object based assignments end up being “paint by numbers” rather than problem solving • Many students don’t get the object concept • I now believe: • A large number of mid-level students who can master procedural concepts (loops, conditionals, methods, parameters, arrays) struggle with the object concept • Therefore, it is better to start with procedural programming if you have a broad audience

  6. Confession: I have my students write code like this (with static methods): • public class DrawFigure { • public static final int SUB_HEIGHT = 3; • public static void main(String[] args) { • drawLine(); • drawTop(); • drawBottom(); • drawLine(); • } • // Produces a solid line • public static void drawLine() { • System.out.print("+"); • for (int column = 1; column <= (2 * SUB_HEIGHT); column++) { • System.out.print("-"); • } • System.out.println("+"); • } • ... • }

  7. A few more CS1 details • Students use objects early, define them later • We use a custom DrawingPanel to explore objects (Graphics, Color, …) • Scanner is helpful for console and file input: while (input.hasNextLine()) { String text = input.nextLine(); Scanner data = new Scanner(text); <process data> } • Input files make programs interesting

  8. Some objections • Stuart is guilty of crimes against Java • I’ve been in trouble before • Why not a procedural language like Python for CS1? • We’re using Java in CS2 and switching languages is tough for mid-level students • Why do you have to use the s-word so much? • Procedural Object Oriented Programming is a slippery slope (look what it spells)

  9. A few words about CS2 • Eliminated some useful but less fundamental topics (GUIs, junit testing, javadoc, streams) • Brought back emphasis on fundamentals (recursion, linked lists, binary trees) including recursive backtracking • Less emphasis on OO design, but basic OO concepts included (encapsulation, inheritance, interfaces) including a client view of data structures • Collections framework as a “case study”

  10. Results: student satisfaction

  11. Results: CS1 enrollment

  12. Results: female admission

  13. Conclusions • New courses are working for us • Impossible to tell which changes have helped the most • Too early to infer long-term trend (particularly with female admission) • We serve as an “existence proof” that back to basics can work

  14. For more information • http://www.cs.washington.edu/homes/reges • Building Java Programs by Stuart Reges and Marty Stepp, Addison Wesley, expected early 2007

More Related