JEP 445: Unnamed Classes and Instance Main Methods - don not move forward!

Pedro Lamarão pedro.lamarao at prodist.com.br
Mon Sep 18 12:54:47 UTC 2023


Em dom., 17 de set. de 2023 às 17:08, Remi Forax <forax at univ-mlv.fr>
escreveu:

> *From: *"Arne Styve" <arne.styve at ntnu.no>
> *To: *"amber-dev" <amber-dev at openjdk.org>
> *Sent: *Friday, September 15, 2023 5:08:04 PM
> *Subject: *JEP 445: Unnamed Classes and Instance Main Methods - don not
> move forward!
>
>

> This JEP is really about Java enboarding, i.e. how it is easy to use Java
> in the small.
>

(...)


> Having an unnamed class is not only important for teaching, it's also
> important for scripting. Scripting in Java is great and not so great at the
> same time. It's great because the script will work the same way on all
> major platforms even Windows and not so great because there is the
> unecessary ceremony of creating a class when what you really want is write
> a small script.
> I think that people should be albe to write their scripts in Java. That
> why we have added the support of shebang in JEP 330. That's why there is a
> JEP in draft to allow to split a script into several files [1]. And that's
> why there is this JEP, that simplify the creation of scripts.
>


This is the kind of benefit I envision for my team. We frequently do small
tools, Picocli based, where a single class is enough. In the definition of
these tools, packages and classes, public vs. private, static vs. instance,
are distractions to my junior team of maintainers. I expect to move the
practice of small tools to the new syntax as soon as we upgrade the runtime
in each case.

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230918/8a5aed0d/attachment.htm>


More information about the amber-dev mailing list