3 ms·
> I wouldn't say there is any threshold where purely functional programming shines less. But what is the set of problems you are usually solving? Any problem s
by prewett 3y ago
> I wouldn't say there is any threshold where purely functional programming shines less.
But what is the set of problems you are usually solving? Any problem set that involves a lot of mutable set is not well-suited for functional programming, in my opinion. And maybe problems where efficiency is important, although I don't know enough to have an opinion on that. Some areas that come to mind are:
- systems programming (which you said)
- GUI programming
- games
- large simulations? Maybe if you can reuse the before and after buffers FP would work okay there.
GUI's have a surprising amount of state, which is why immediate-mode GUIs haven't really taken off. (Yes, there's Dear ImGUI, but it actually uses the name of the control to store retained-mode state under the hood) It sounds really good when you think about buttons and sliders, but then you come to text editing or list-box selection...
- myaccountonhn 3y agoGUI programming is fine in purely functional programming, see for example elm[0], where you have a Model - Update - View paradigm to build frontends. Another example of GUI programming in Pure FP is functional reactive programming[1]. [0] https://elm-lang.org/ https://elm-lang.org/ [1] https://en.wikipedia.org/wiki/Functional_reactive_programming https://en.wikipedia.org/wiki/Functional_reactive_programmin...
- nailer 3y agoFunctional reactive programming is very popular for graphical user interfaces. Functions handle state perfectly with scopes and closures.