JEP 495 Question
Archie Cobbs
archie.cobbs at gmail.com
Thu Nov 7 21:05:02 UTC 2024
On Thu, Nov 7, 2024 at 2:47 PM Kenneth Fogel <kfogel at dawsoncollege.qc.ca>
wrote:
> I dislike Python because it is an untyped language, but we cannot ignore
> that:
>
>
>
> Python: loan = input("Loan: ")
>
> makes more sense to those starting out than:
>
> Java: var loan = Double.parseDouble(readln("Loan: "));
>
I perceive a disconnect here between the objective and the assumed
mechanism to achieve that objective.
If the objective is "Provide a friendly environment for people starting out
learning Java to get familiar with it", why does the mechanism have to be
"Make changes to the language" ?
For example, couldn't you use JShell to build a sufficiently "friendly
environment"?
$ cat friendly.jsh
double input(String prompt) throws Exception {
System.console().printf("%s", prompt);
return Double.parseDouble(System.console().readLine());
}
$ jshell friendly.jsh
| Welcome to JShell -- Version 23
| For an introduction type: /help intro
jshell> var x = input("Loan: ")
Loan: 123
x ==> 123.0
Etc.
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241107/4b985ddb/attachment.htm>
More information about the amber-dev
mailing list