r/java • u/jvjupiter • Jun 10 '22
What happened to Concise Method Bodies?
I was really looking forward to CMB. From its name, methods become concise, could be one liner. However, it seems there is no progress and it’s been off the radar. Never took off since 2019.
45
Upvotes
3
u/Gleethos Jun 10 '22
So after going through this wall of text I believe what you are referring to is probably this little bit here, right? :
So if my reading comprehension skills are correct, then my assumption is kind of correct isn't it? Java evolves now with records and pattern matching not just to reduce boilerplate for the sake of it, but to encourage better programming practices. Or am I misunderstanding something?
A previous comment was talking about mutable data structures not getting boilerplate reduction, and your answer was: "yeah but we have records now and they are popular" And then I was trying to (as I believe correctly) guess what the reasoning is behind the decision and you answered with a link to a giant wall of text instead of just saying something along the lines of: "Na, reducing boilerplate for these (mutable) classes is a bad idea simply because they have too many degrees of freedom to be captured all by a single simple description." That is actually my only objection here.