Re: Enhancement request
On Sep 3, 9:38 pm, Lionel van den Berg <lion...@gmail.com> wrote:
On Sep 4, 2:31 pm, Tegiri Nenashi <TegiriNena...@gmail.com> wrote:
I'm programming java since 96 and can't remember myself ever using
main method with arguments. Does anybody have a different experience?
I've used them, mainly when running from commandline.
Now that I don't use these arguments, I never feel to make a
concentrated effort to remember them. Why bother remembering something
that I can easily copy over from somewhere else. However, after doingg
this same trick for 100 time, I ask why Java can't just be simplified
to allow
static void main() {
}
as a program entry point?
Considering you ownly write one main method for an application it is
hardly a common inconvenience, I therefore see no real reason to
support your suggestion.
I suggest the main method is used a lot more often than one per
application. I test every sophisticated method by invoking from the
main, e.g.
Class Topology {
...
public static void main( String[] args ) {
Cylinder c = new Cylinder("a",10,10,10,10);
Topology t = new Topology(c);
System.out.println(t.getOpenings());
}
}
Therefore, almost every class has it. With this usage scenario it is
unjustifiably verbose.
Next, the others mentioned that the return value of the method is
communicated via System.exit(). Wouldn't elementary consistency
suggest that input arguments should be passed in a similar venue?