Using graphics to support the teaching of fundamental object-oriented principles in CS1

Teaching object-oriented programming in CS1 is hard. Keeping the attention of CS1 students is perhaps even harder. In our experience the former can be done successfully with very satisfying results by focusing on the fundamental principles of object-orientation, such as inheritance, polymorphism and encapsulation. The latter can be done by having students create graphical event-driven programs. Care must be taken, however, since teaching graphics can easily distract students and certainly takes time away from the fundamentals being taught. We use Java as a vehicle for OO instruction, but rather than expose CS1 students to the intricacies of Swing we employ an elegant and small graphics package called NGP. NGP allows students to create event-driven graphical programs using only inheritance and method overriding. We describe how we use NGP to enhance rather than detract from our teaching of fundamental OO principles.