News for hackers. Stuff that matters.
Re:The Modern Java Platform – 2021 Edition by lmm on Wednesday March 17, 2021 @10:08PM (#26499072)
If Java had had first-class functions to start with, things like Spring would probably have never got off the ground. Up until Java 8 you couldn't even pass a reference to a constructor as an argument without defining a whole class to carry it around in.
Re:The Modern Java Platform – 2021 Edition by cryptos on Thursday March 18, 2021 @02:51AM (#26500218)
But first-class function is a completely different thing than dependency injection (DI). Supporting functional programming is a an aspect of the programming language itself, while DI is part of the infrastructure.

I agree with you, that Java should have had first-class function from day one. Ironically this was considered by the language designers, but they decided that it would be too exotic for the average Joe. OOP was a hype back then ...

Re:The Modern Java Platform – 2021 Edition by lmm on Thursday March 18, 2021 @04:57AM (#26500743)
DI is a design technique, you don't have to use a framework to implement it. Reflection-based frameworks became a popular way of doing it in Java because doing it in plain Java is cumbersome, and that's due to the limitations of Java as a language.