4 ms·
In contrast, I really like the simplistic functional elements added to a language, like the Java 8 stream API, but I feel like banging my head against a wall us
by WatchDog 5y ago
In contrast, I really like the simplistic functional elements added to a language, like the Java 8 stream API, but I feel like banging my head against a wall using scala with effects systems.
- jerf 5y agoI actually like some of the things added; being able to write a map function that takes an already-existing function and applies it to an array con be more convenient than the for loop. Depends on the language, obviously. What I dislike are people who get on a high horse about it, as if they're programming "functionally" and it's better than what everyone else in the language is doing. They're not "programming functionally", because they can't be, the language doesn't support it. A single map call is convenient. Sometimes you can put a couple of them together. Huge piles of code in imperative languages written in functional paradigms is a mess, because most of the putative advantages of functional aren't present. The one that I notice the most is that the "functional" paradigm embedded in imperative languages creates a barrier against refactoring. Sometimes it is simply that all the noise and chaff prevents programmers from seeing through to the underlying essense, and simply not realizing that if you have a recurring pattern of mapping the same three functions over an array in multiple places that you can in fact refactor that into a function. Sometimes, though, it's just not possible to refactor properly through inner platform you've introduced. Sometimes, refactoring is possible, but requires bringing in yet more firepower to get around the inner platform, like defunctionalization. By the time you're defunctionalizing something (by necessity, not choice) because of your inner platform to do something that would have been 4 lines of code in the original core language if you'd just used that, you're in deep trouble. And what's worse, people will call this good programming. It's just the functional programming equivalent of frameworkitis that you see in languages like Java. "We need all this machinery to program properly!" No. You don't.