5 ms·
From my vantage point as a unenlightened traditional developer, functional programming seems to be the opposite of Java. Java tried to genocide all verbs and m
by prewett 8y ago
From my vantage point as a unenlightened traditional developer, functional programming seems to be the opposite of Java. Java tried to genocide all verbs and make everything an object. It didn't work, we just got a bunch of verbose adjectives instead (Runnable.run, Comparable.compare). Functional programming, on the other hand, seems to ignore data: data is transient, just pass it around, but verbs live forever!
The problem is that computers fundamentally have both verbs and objects (data). And the real world has state. Managing state is a real problem when it is immutable and there is a lot of it. I'm guessing a functional programming network stack or image editor with undo would have a lot of performance-sapping copying going on.
So if you tend to have a lot of state, like UI, you probably want object-oriented programming. If you are munging through data once to get a result, maybe functional programming is better.
Or maybe your LISP enlightenment has been that you can run your data? I'm not FP expert, but it seems like that isn't the FP feature people people usually extol. I'm not even sure that FP languages besides LISP support it.
- mrkeen 8y ago> seems to ignore data Not even close.
- slifin 8y agoClojure under the hood isn't copying on every operation it's partitioning the same data structure to give immutability to the developer These data structures are called persistent data structures
- prewett 8y agoI was thinking more along the lines of a copy being necessary when you update a game state, or something like that. Is Clojure able to do something like that with partitioning? I think someone had tried doing a game in Clojure and run into problems with copies, and posted his findings to HN a number of years ago. Thanks for pointing out the use of persistent data structures, that is an interesting approach.
- YeGoblynQueenne 8y ago>> to genocide all verbs Haha. See what you did there.
- prewett 8y agoHa, nice! I'll try to do it on purpose next time :)