Date: Tue, 13 Nov 2001 16:31:37 -0800 (PST) From: mcguire@cs.ucsb.edu (Hugh W. McGuire) To: crawfordd@acm.org Subject: CACM Forum submission Cc: RDWestfall@csupomona.edu To the Editor, "Communications of the ACM": In his Technical Opinion, "`Hello, World' Considered Harmful" in your October 2001 issue, Ralph Westfall suggests clarifying the use of objects when teaching introductory Java by having |main()| explicitly instantiate a separate class which does the output. But the paraphernalia |static void main(String[] args)| remains; and the object's existence is so fleeting that students may still not get object-oriented from seeing this version. I suggest that instructors actually use `applets' instead of `applications' when teaching introductory Java. While admittedly not as explicit as the instantation using |new| in Westfall's version, instantiation of an applet class is done via HTML. A Web-browser's graphic presentation of the applet object clarifies to students that an object is present; and multiple instantiation could make instantiation even more clear. E.g.: import java.awt.*; import java.applet.Applet; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("hello, world", 10, 20); } }
another instantiation:
Hugh McGuire, Lecturer Department of Computer Science U.C.S.B. Santa Barbara, CA 93106 http://www.cs.ucsb.edu/~mcguire/ (805) 893-5412 mcguire@cs.ucsb.edu