Ashort Cupof Java

Interesting OrphanPage last edited September 6, 2003

This is a wiki page for a two day course on Java for young gifted students (11 - 12 years old).

It is planned to introduce students to Java by looking at:
Here is my suggestion: First Logo, then Smalltalk, then Lisp, then Prolog and finally Haskell. -- GuillermoSchwarz
Why waste the kids' energy on Java? Why not some higher-level dynamically typed language that would provide faster successes?

There is an excellent SqueakSmalltalk system designed for kids. The name escapes me now, but it is available from http://www.squeak.org.

Languages like PythonLanguage (and RubyLanguage even more so) would be great first-languages to teach. They are nearly as good as SmalltalkLanguage (HaHaOnlySerious) but can do things like mungeing some text files in a few lines of script - the sort of immediate 'Real World Action' that learners like (in my experience.)

There is one great thing about SmalltalkLanguage though: the fact that its method names are split up. So in every other language I know you still have to do some variant of

   membershipMap.moveMember(member, newLocation);

Smalltalk syntax would be

   membershipMap moveMember: member to: newLocation.

I find this improves code readability immensely (small brain I suppose) and teaching about readability should be a major part of teaching programming.


As much as its users may sing the praises of Smalltalk, I can't imagine using it to teach new programmers: the examples I've seen on the wiki look horribly cryptic (though assuredly "elegant"), and WhoUsesSmalltalkTheseDaysAnyway??

That said - I strongly recommend against teaching Java to those who have not previously used C or C++. My rationale is that eventually the student will want or need to know all three, and from my experience as a university student - having been taught C then C++ then Java in my program, while knowing others in a slightly different program who had it the other way around - it is much easier to do C first and Java last. It's because of the differences in language idioms - the Java way of thinking about things makes it harder to understand stuff like pointers (the need for malloc() and how to keep track of what's pointing where and what null is good for and the need to do your own GC and...) later on; whereas "good coding practice" for C to keep things organized naturally evolves into OO thinking. I'm no longer so sure of this, actually. Maybe the correct order is Java, then some form of assembly language, then C, then C++.

Then again, I've heard that in the other program, they somehow manage to teach Java without teaching any OO concepts; just using it as a higher-level alternative to C. I really don't know how they manage that. Presumably they use only static methods in the "provided code" and pretend that the class names are namespaces, and tell the students that "public class <filename> {}" surrounding their main file are just magic words to keep javac happy. -- KarlKnechtel


Despite Java's numerous faults for this exercise, there is the advantage that there is a huge body of documentation and open source software to study. I would be careful not to underestimate those benefits, as there is a huge pool for an inquisitive mind to drink from.


I would strongly suggest having a look at the PythonLanguage for this purpose. There are several tutorials for absolute beginners out there, it's pleasantly high level, looks very clean, and was strongly influenced by a "teaching/learning language", ABC. See http://www.python.org/doc/Newbies.html

Seconded.

I have done this also. Personally, I much prefer Python and it leads very nicely into PyGame.

EditText of this page (last edited September 4, 2006) or FindPage with title or text search