Women in Technology

Hear us Roar



Article:
  Rethinking the Java Curriculum: Goodbye, HelloWorld!
Subject:   Print out the System Properties
Date:   2002-08-27 07:20:40
From:   bayard
I long ago dumped Hello World in favour of the following snippet:



package test;


import java.util.Properties;


public class ShowProperties {


static public void main(String[] args) {
Properties props = System.getProperties();
props.list(System.err);
}


}


It can start very small [without the import and without the package. Just declaring java.util.Properties direct] and can grow larger by switching to an instance of of ShowProperties, then waking over the Properties instead of using list(OutputStream) etc.


One of Hello World's great problems is that it doesn't scope. You do it on the command line. You do it in a GUI. On a webpage. But there's no easy continuation of the lesson, you just throw it away.


A Properties outputter gives you a nice timeline into many of the core Java concepts.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Print out the System Properties
    2002-08-28 16:50:48  amuys [View]

    >One of Hello World's great problems is that it
    >doesn't scope. You do it on the command line. You do
    >it in a GUI. On a webpage. But there's no easy
    >continuation of the lesson, you just throw it away.

    When the language in question (as it is here) is Java I must agree. However when teaching other languages, I have progressed from HelloWorld thus:

    1) console based hello-world.

    2) GUI label.text = "" based hello-world.

    3) button with command=quit based hello-world.

    4) button with command->change label -> quit

    5) Basic GUI adder (two text boxes, one button, and a label for the result)

    6) String copier using two text area's (on-click copy text from one area to the other).

    At this point you have enough basic GUI components to allow a switch to traditional lessons, introducing fuctional decomposition, data-structures, and basic algorithms. OTOH, you also have given the students the perception of signifigant progress. I have generally found the resulting morale boost leads to spontaneous experimentation and self-directed learning.

    Still there is nothing magical about "HelloWorld", the properties example could be structured in a similar way.

    With Java, the lack of a syntactially clean analogue for lisp/python closures, smalltalk blocks, or tcl eval(), C/C++'s function pointers, etc. There is a substantial barrier to introducing GUI programming that early.

    Note that this is an issue with using Java as a *FIRST* language only. Once a student has learnt basic programming skills, the learning barrier is substantially reduced.

    Andrae Muys