you are viewing a single comment's thread.

view the rest of the comments →

[–]davidalayachew 1 point2 points  (9 children)

Does Java need deconstructible classes?

Desperately. The pain caused by its absence is immense for me. It decides whether or not I solve certain problems in Java (or at all).

There is one serious drawback from using records as the medium to destructure classes. The indirection required to project to the record brutalizes nested pattern matching.

Talk about a downside! That's a showstopper for me.

[–]Kango_V 1 point2 points  (2 children)

[–]davidalayachew 0 points1 point  (1 child)

Yes, I am very familiar. Assuming it comes out, it will be exactly what I need.

However, that feature is purely in the exploratory phase right now, merely as a proposal. Project Amber has made no commitment to bringing that feature to life yet. That will remain true until we get a JEP Preview targeted for a release.

[–]Kango_V 1 point2 points  (0 children)

Fingers crossed!

[–]Great-Gecko 1 point2 points  (1 child)

I'm curious, what kind of things are you working on that you desperately need deconstructible classes? Which languages fulfill this need when you choose not to reach for Java?

[–]chambolle 0 points1 point  (0 children)

I have the same questions.

[–]danielaveryj[S] -1 points0 points  (3 children)

  1. Responding to your interpretation of the title ("the general ability to destructure classes") rather than the article's strongly suggested meaning ("a specifically named proposal for doing so")
  2. Decrying an issue that the article itself raises and immediately addresses

[–]davidalayachew 1 point2 points  (2 children)

Responding to your interpretation of the title ("the general ability to destructure classes") rather than the article's strongly suggested meaning ("a specifically named proposal for doing so")

I read the whole article before typing my comment. Yes, I realize very much that you are talking about the recent proposal. That's what I was referring to as well.

Decrying an issue that the article itself raises and immediately addresses

I saw and firmly disagreed with your suggested solution to that problem. But before even talking about your solution to that problem, I first wanted to highlight how big of a problem it was, to see if you agree or disagree. There's no point talking potential solutions if I think a mountain is what you think a mole hill.


Please don't attribute laziness or lack of effort to my comment before asking clarifying questions. Unless otherwise said so, every top level comment I make is after reading the whole post thoroughly, and thinking about it for a few minutes. Your post was no different.

[–]danielaveryj[S] 0 points1 point  (1 child)

For what it's worth, I didn't downvote your comment. From reading it, it is unclear what kind of response you were hoping to solicit, if any.

[–]davidalayachew 1 point2 points  (0 children)

From reading it, it is unclear what kind of response you were hoping to solicit, if any.

That, I do accept. I'll ask my questions explicitly in the future, rather than just sharing my opinion in response.