10 likes | 146 Views
Why Johnny and Jenny (CS Students) Can’t Program in C. (and why their parents could). Eric Freudenthal <efreudenthal@utep.edu>, Brian A. Carter, Alexandria N. Ogrey <{ bacarter,anogrey }@ miners.utep.edu >. What Changed. Observations. Hypotheses.
E N D
Why Johnny and Jenny (CS Students) Can’t Program in C (and why their parents could) Eric Freudenthal <efreudenthal@utep.edu>, Brian A. Carter, Alexandria N. Ogrey <{bacarter,anogrey}@miners.utep.edu> What Changed Observations Hypotheses • OO-programming and machine organization taught separately. • Semantics of Procedural languages are more similar to underlying hardware than OO languages. • C introduced in a language survey course where semantics are disconnected from implementation. • Students graduate without: • Proficiency at procedural languages and explicit memory management (in C) • Deep understanding of high level languages’ implementations • Language shift: • Before: Introduction to programming and most assignments in procedural languages. • Upper-division students and graduates were able to easily gain proficiency in C or other procedural languages. • After: Introduction to programming and most assignments in O-O languages (generally Java) • Upper-division students and graduates find C arcane and difficult to master. • Students knowledge is compartmentalized • The distance between OO and machine language abstractions is too large. • Combining introduction to computer organization and procedural languages will integrate knowledge and increase student competency at programming in procedural languages. And our intervention…. A reform to a Junior-level Course in Computer Organization • Interleaved introduction to C and machine language/assembly. • Addressing modes: C’s abstractions for addressing memory including pointers, arrays, and structs are used to motivate addressing modes • Control flow: Students first reduce control-flow structures to “goto C” and which then directly translates to assembly language. • Arithmetic expressions: Students manually construct parse-tree to identify temporary variables and evaluation order. • Subroutine linkage: C-calling convention used, students write programs with routines in both languages • Interrupts: First level handler in assembly calls C 2nd level handler • Structure of many projects… • First design it in C • Translate components to assembly (when necessary) • Initial results: • Tests: students understand relationship between C abstractions and implementation in assembly language • Also: Students may gain a deeper understanding of relationship between C abstractions and implementation in assembly language • The course • Lab manual available on the web • Class notes available on student amended wiki • Great cheap education kit • $20 USB pluggable device • GCC support • Small orthogonal instruction set • Students learnUNIXtools • Emacs, gcc, svn, make • Assignments and projects are turned in using SVN Let us know if you would like to help evaluate/tune this course!