How to Teach Java

{{jfunreport
 * title = Some Title
 * convenor = Yiannis Foukarakis
 * participants = Kim Tucker, Nikos Peltekis
 * summary =

Introduction
The discussion was primarily aimed at teaching Java to first year university students or high school, though we did touch on teaching kids Java.

We started with a "brain dump" to surface any aspect of this large topic for discussion. Some of these were discussed briefly as we went along and we took these notes which mainly link to resources of use to teachers and learners of Java.

Brain Dump

 * First make it fun :-).

There are many things to teach:


 * Object Oriented Programming
 * Language syntax
 * Basic Java Libraries for students with some background in C/C++
 * Using an IDE
 * Testing
 * etc.

Books

 * Thinking In Java
 * Effective Java
 * quite advanced
 * Head First Java
 * Absolute Java
 * Java How To Program

Tutorials
These tutorials also indicate the fundamental topics to be taught.


 * The Java Tutorials (with various trails)

IDEs

 * BlueJ
 * Eclipse
 * NetBeans
 * JBuilder
 * Early versions generated ugly code and reams of it (bad for students to see, and inflexible, difficult to customise)
 * Borland Together - UML <-> Java
 * IntelliJ IDEA (full version commercial, but community edition is good for the basics)
 * Nice for students to see debugging
 * Teaching should start without an IDE in order to introduce the students to java basics.

Editors

 * JEdit
 * Notepad
 * Notepad++
 * vi/emacs

Sites with Tests

 * Coding Bat
 * Codility (non-free)

Approach
Define your objectives:


 * By the end of this module students will be able to ...
 * Engage the students in coding activities - it must be fun
 * Understand the language (paradigm - OO, syntax, constructors, libraries, ...)
 * How to program in context - real world collaborative application development.

What is fun?


 * It is not fun to write programs that are of no use to anyone
 * avoid arbitrary exercises
 * some problem solving exercises can be interesting and fun
 * challenging but not too challenging

When in the curriculum to introduce Java?


 * Java may be introduced when OO is introduced.
 * Universities teach concepts rather than language specifics.
 * Teach generic language constructs (declarations, loops, recursion, ...)
 * Data structures
 * Objects
 * Classes, objects, messaging

How?


 * Learn by example (copy-modify)

Other related exercises:


 * CRC Cards - role playing
 * UML tutorials and exercises using tools such as
 * ArgoUML
 * Fujaba
 * ATL
 * In general. use real world objects like vehicles, parking lots, animals, musical instruments, etc. (inheritance, collections, ...) - and use the same example for many constructs

Self (or instructor) testing:


 * Use sites with tests to allow students try on their own.
 * RoboCode - most popular.

Design:


 * Patterns and idioms (but only after a certain level of familiarity with the language has been reached).

Further Resources

 * Alistair Cockburn's site - mostly to do with M ethodology.
 * Articles
 * Martin Fowler
 * Refactoring
 * Agile
 * Design
 * Become a Guru - free to be enhanced and shared :-)
 * Alice - a teaching tool for introductory computing.
 * Greenfoot - for teaching kids Java.


 * recommendations =

Freedom to teach in different ways for different students using the hints and resources above.

}}