News for hackers. Stuff that matters.
Re:Printf(“%s %s”, dependency, injection) by twic on Tuesday October 19, 2021 @06:01AM (#28916509)
> Hence you can't have function composition

No, the thing that stopped Java having function composition was the lack of (ergonomic) closures. But it got closures in 2014, and now you can do function composition. Despite the fact that it still doesn't have top-level functions.

I still don't really understand where all the XML came from, or the wave of equally unnecessary annotation-based dependency injection that came afterwards. There has been a dream of "write reusable components, then compose them to form applications" that has been very strong in Java right from the outset, and i tentatively think that people just didn't get that you could do the composition in code.

Re:Printf(“%s %s”, dependency, injection) by matheusmoreira on Tuesday October 19, 2021 @08:48AM (#28917494)
> people just didn't get that you could do the composition in code

Yeah, Java does that to people. It's such a limited language that it becomes impossible to conceive of better ways to solve problems.

Apparently it's come a long way since Java 6, it's even broken backwards compatibility, never expected that to happen. It's adopted many functional concepts in the usual insanely verbose Java style. Still a very limited language though, especially when compared to real functional and object-oriented languages. It's limited even when compared to C.

Re:Printf(“%s %s”, dependency, injection) by pjmlp on Tuesday October 19, 2021 @02:44PM (#28921808)
Apparently is too advanced for the Go crowd, so there is that.
Re:Printf(“%s %s”, dependency, injection) by matheusmoreira on Tuesday October 19, 2021 @05:31PM (#28924009)
Well, Go was explicitly designed not to be too advanced. Here's quotes from its designer:

https://news.ycombinator.com/item?id=16143918

> The key point here is our programmers are Googlers, they’re not researchers.

> They’re not capable of understanding a brilliant language

> So, the language that we give them has to be easy for them to understand

It's pretty insulting in my opinion. Imagine being a programmer at Google, likely one of the best jobs in tech, and reading this.

Re:Printf(“%s %s”, dependency, injection) by ngc248 on Tuesday October 19, 2021 @06:23AM (#28916624)
Java is an amazing language ... but somehow all the ills of J2EE are blamed on Java. Back in the 2010s itself there were a lot of frameworks which were supporting both declarative and code as config. But, it is fashionable to shit on Java.
Re:Printf(“%s %s”, dependency, injection) by nine_k on Tuesday October 19, 2021 @08:43AM (#28917458)
Indeed! No functions, no closures, and no support for either on the JVM bytecode level.

Now you can have lambdas, and they go to a generated class as methods, so that the JVM could execute them.

Where XML came from: how do you configure WebSphere in 2000? XML was all the rage since mid-1990s. It had a ton of advantages, back when you did not have JSON, YAML, or TOML.