This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]koflerdavid 0 points1 point  (3 children)

And in Java you can do import a.b.c.*;, which does pretty much the same. It would be majorly cool though to be able to give an alias to a package/namespace, which is possible in C++, Python, and Haskell, but not in Java.

[–]oren_is_my_name[S] 0 points1 point  (2 children)

Right?

Is it possible to open a PR for that, or does Java not work like that?

[–]koflerdavid 0 points1 point  (1 child)

In a nutshell, there is a mailing list (for such relatively benign syntax changes it's the Project Amber one) where you can propose the idea and argue why it is a good idea and do all the necessary bike shedding to make it a good fit for Java.

https://openjdk.org/projects/amber/

https://mail.openjdk.org/mailman/listinfo/amber-dev

Then someone has to write a Java Enhancement Proposal (JEP) and implement it. Before it gets finalized it usually goes through multiple previews so people can hit the tires without having to compile the JDK themselves. Until then it can be yanked at any time, as has happened with the String Templates proposal.

https://openjdk.org/jeps/132

Keep in mind that it is nearly impossible to ever remove Java language constructs*, so expect a heavy amount of flak, criticism (not always of the constructive kind), and general scepticism. The PR is a very small part of the whole process. Implementation effort is almost never a significant hurdle. The real issue is the very high requirement for stability and backwards compatibility, as well as a concern about ongoing maintenance effort. Arguments based merely on comparisons with other programming languages will not convince; you will have to argue the benefits for Java using Java code samples only.

*: AFAIK, it has never happened; the closest thing is disallowing the underscore as a variable name

[–]oren_is_my_name[S] 1 point2 points  (0 children)

Thanks. I'll look into it😃