3 ms·
> 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 closur
by twic 5y ago
> 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.
- nine_k 5y agoIndeed! 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.
- ngc248 5y agoJava 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.
- deleted 5y ago[deleted]
- matheusmoreira 5y ago> 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.
- pjmlp 5y agoApparently is too advanced for the Go crowd, so there is that.
- matheusmoreira 5y agoWell, Go was explicitly designed not to be too advanced. Here's quotes from its designer: https://news.ycombinator.com/item?id=16143918 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.