JEP445 meets JEP459
Ian Darwin
ian at darwinsys.com
Tue Feb 6 16:54:58 UTC 2024
In JEP 445 you wrote:
> The changes we offer here are just one step in making Java easier to
> learn. They do not even address all the speed bumps in the above
> /Hello, World!/ program: The beginner may still be puzzled by the
> mysterious |System.out.println| incantation, and still needs to import
> basic utility classes and methods for essential functionality even in
> first-week programs. We may address these pains in a future JEP.
While experimenting with the String Template feature, it occurs to me
that a relatively simple expansion of String Templates would pave over
another of those speed bumps. Basically:
PRINT."Hello \{name}. Your balance is \{amount}";
Indeed, the beginner who hasn't yet met string templates can use the
degenerate case
PRINT."Hello world";
and then later "need not discard what they learned in the early stages,
but rather they see how it all fits within the larger picture."
This compares favorably with, e.g., Python 3's
print('Hello world') and
print(f'Hello {name}, your balance is {balance}')
This seems like a fairly obvious extension, so I ask: Do you already
have such a thing up your collective sleeves or, if not, do you think it
might be grounds for a JEP proposal?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20240206/ff04700a/attachment.htm>
More information about the amber-dev
mailing list