C++ is gaining more and more functional features, and this is quickly becoming the predominant style.
C++ is gaining more and more functional features, and this is quickly becoming the predominant style.
Most go programming I've seen is like python where you are slinging around maps that are getting modified all over the place. Very antithetical to functional programming.
You are confusing functional programming for pure functional programming. This is like confusing Smalltalk-style OOP with OOP in general and then complaining about C++.
Mutability and functionalness are orthogonal, although the immutable style lends itself well to functional programming and mutability is more kludgy in FP.
But given that both Rust and Go have first class closures, they qualify as a functional programming language. The definition of FP is that functions are data. Python, Rust, Go, etc all fit this definition. Modern c++ does as well.
There is no reason not to include these languages, not only they support functions as data, they also support higher order functions (functions that take callbacks accepting callbacks accepting callbacks, ad infinitum).
JavaScript isn’t a functional language, neither are Rust nor Go (and Go in general is probably one that the least bets on functional patterns all around), they all just provide constructs from functional languages like mapping arrays.
It's true that JS, Rust and Go are multi-paradigm languages (so is Haskell and other FP BTW), but FP is one of those paradigms.
But i also find myself writing in a more functional style too, limiting the amount of side effects, pure functions when i can manage it. It makes testing so much easier when you don't have to have a bunch of set-up and teardown logic to get your object into the right state before running a test.
This logical grouping is what Rich Hickey called the attractive thing about objects. So a namespace in Clojure does exactly that: lets you refer to “a logical grouping of data and the functions specific to acting upon it” with a meaningful name. (It also handles the specifying of dependencies, and seems like the right place to do that, but that’s not relevant here.)
Clojure also supports private functions with “defn-“ but oddly requires using metadata for binding ns-private vars. I wonder how many folks have written their own “def-“ macro to do this. It’s never come up for me, but I haven’t written production code with it either.