New candidate JEP: 463: Implicit Classes and Instance Main Methods (Second Preview)

David Alayachew davidalayachew at gmail.com
Wed Nov 1 22:07:54 UTC 2023


Hello,

Thank you for the response!

> > 1. In the name of simplifying things for beginners

>
> Any line of thinking that starts this way is dangerous,
> because it often leads to what ends up being a
> "beginner's dialect of Java", which means things to
> unlearn once the student graduates to "full programs"

Touché. In this case, the unlearning (or rather, relearning) would be that
the rest of the world uses main and that run is nothing more than an alias
that is for beginners. Hence the dialect. That makes sense.

> > 2. Alternatively, could we have the name be
> > irrelevant if it is the only method in the class?
>
> If we did this, as soon as someone refactored their
> program to add a second method, we wouldn't know
> how to launch the program. This is falling off the
> onramp before you get to the highway!

Also fair. I had visualized it as whoever was teaching them that you can
have more than one method would also teach them to disambiguate. But the
way you described it is better. If we make the initial lift a little
heavier by telling them that execution must start with a main method, then
the student does not need to disambiguate. Furthermore, like you said, the
act of adding another method does not affect/taint what is already there,
whereas my suggestion does.

Thank you for the help!
David Alayachew

On Wed, Nov 1, 2023 at 5:54 PM Brian Goetz <brian.goetz at oracle.com> wrote:

>
> 1. In the name of simplifying things for beginners
>
>
> Any line of thinking that starts this way is dangerous, because it often
> leads to what ends up being a "beginner's dialect of Java", which means
> things to unlearn once the student graduates to "full programs".  Instead,
> what we want is for irrelevant details to fade into the background until
> they are needed.  Learning "a program begins with a main method" seems
> reasonable to put on the beginner's radar, in ways that the static-instance
> distinction does not.  The onramp should match speed and direction with the
> highway.
>
> 2. Alternatively, could we have the name be irrelevant if it is the only
> method in the class?
>
>
> If we did this, as soon as someone refactored their program to add a
> second method, we wouldn't know how to launch the program.  This is falling
> off the onramp before you get to the highway!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20231101/456c957d/attachment-0001.htm>


More information about the amber-dev mailing list