News for hackers. Stuff that matters.
Re:How I Program in 2024 by AdieuToLogic on Sunday August 04, 2024 @11:54PM (#41158069)
> have you worked with java or C#? both are where types sometimes become a burden.

> No, you cannot just do something like this: > ``` return { data, message: "OK" }; ```

Yes, in Java you can:

  return new Object() {
    String message = "OK";
    Object data = itsValue;
    };
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.
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.