Re:How I Program in 2024
by dasyatidprime on Monday August 05, 2024 @03:37AM
(#41158929)
And how does the caller extract those fields?
Re:How I Program in 2024
by AdieuToLogic on Saturday August 10, 2024 @01:18AM
(#41207503)
> And how does the caller extract those fields?
The same way one would when returning an anonymous map in JavaScript - via reflection and the assumption of what was returned.
While JavaScript makes the use of reflection less burdensome, it has the same collaboration fragility as a Java version. Just with less ceremony.
> No, you cannot just do something like this: > ``` return { data, message: "OK" }; ```
Yes, in Java you can:
There are many reasons to dislike Java and it is nowhere near my programming language of choice. The specific semantic deficiency you chose happens to be an invalid one.