[2356] in java-interest

home help back first fref pref prev next nref lref last post

Re: main() routine

daemon@ATHENA.MIT.EDU (Chuck McManis)
Fri Sep 29 18:00:12 1995

Date: Fri, 29 Sep 1995 12:49:31 -0700
From: cmcmanis@scndprsn.eng.sun.com (Chuck McManis)
To: phil@bolthole.com
Cc: java-interest@java.Eng.Sun.COM


>So it is odd that you threw this simple bit of compatibility out.

I guess I didn't make myself clear, the Java paradigm for programming is
nothing at all like the one used in C and C++ programs. The Java "world"
is a bunch of classes, *anyone* of which can be instantiated by any other.
There are no applications, thus there is no use for this cruft from C.

The fact that the command 'java' instantiates my class and invokes main doesn't
mean that the StringBuffer class might also invoke the main method in my class.
(it doesn't of course but it could). Argv[0] in C represented the "containing"
environmental (program). After you've used Java for a while you'll figure that
out too and then (if we changed it) you would complain that everytime you declared
a static main method with an array of strings the system allocates some worthless
string in array element zero. 

In UNIX the power was:
% ls -l | sort | awk '{ ...}' |uniq | ...

That is constructing commands from the combination of other commands. In Java
this is replaced by:
System.out.print(new Uniqifier(new Awker(new Sorter(new FileLister("."), BYSIZE), "awker")));

The small collection of UNIX utilities becomes useful Java classes. Classes always know
their own name.

--Chuck
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post