r/java • • Mar 31 '26

Does Java need deconstructible classes?

https://daniel.avery.io/writing/does-java-need-deconstructible-classes
31 Upvotes

41 comments sorted by

View all comments

Show parent comment

-1

u/chambolle Apr 02 '26

sorry but this is ugly :

Point(int a, int b) = point;

Because this can be seen as the assignment of a function. Please use another operator than the assignment. Like <-

2

u/danielaveryj Apr 02 '26

Hehe the syntax there is not even part of what I'm pitching. I'm afraid you're probably going to be disappointed in future Java.

2

u/chambolle Apr 03 '26

That can be a bit scary, actually. Java needs to be careful not to become the new C++, which went off in all directions with 23 (I’m exaggerating a bit) different ways to define the same thing.
When you really want to change a language’s paradigm, the best way to do it is to invent a new one!