3 ms·
Sure is. I'd go as far as to say that Java syntax is poor. Then again, the question with functional interfaces is whether or not functional programming is usefu
by dmos62 4y ago
Sure is. I'd go as far as to say that Java syntax is poor. Then again, the question with functional interfaces is whether or not functional programming is useful to you, or how useful.
- PaulHoule 4y agoThe creators of Java have always been influenced by the ML family of languages, for instance the Hotspot compiler and generational GC came out of efforts to develop very fast runtimes for the ML family. Also the lambda syntax in Java is as concise as can be, how can you beat x -> x*x ? Sometimes passing a lambda (or other function) as an argument is a simpler approach to specialization than defining a subclass. That I think is mainstream and accepted in Java today. More recently Java is also incorporating other ideas from the ML family such as switch expressions and algebraic types (records and sealed interfaces.) There is a lot more to "functional programming" than that, such as the use of persistent collections. In some cases (such as managing the symbol table in a compiler) those methods lead to good efficiency and great simplification, in other cases they are ways to make easy problems punishingly hard. pidove builds on top of ordinary Java Collections and doesn't push more exotic approaches as does http://www.functionaljava.org/ http://www.functionaljava.org/