3 ms·
Functional doesn't really have a consistent definition, and you end up always with "yeah but"s in any discussion e.g. haskell isn't functional because C ffi and
by JoelMcCracken 5y ago
Functional doesn't really have a consistent definition, and you end up always with "yeah but"s in any discussion e.g. haskell isn't functional because C ffi and unsafePerformIO.
Point being, its very hard to say "X is or is not functional", as there isn't an objective consideration.
(FYI, I love Haskell and use it daily and write it professionally)
- ltbarcly3 5y agoThis language has mutable strings. This is in some sense the opposite of functional style.
- JoelMcCracken 5y agoSo for me the primary qualifier is “are functions first class”; then “can functions be defined like data” (lambda); then “does it have a rich library of functionality that allows one to program functionally with it”; then “Is fp style idiomatic” ; then probably “does it have a good method to control mutability”; then “does it control side effects” There may be some other examples in there. Personally I like things with controlled side effects. But it’s just my preferred set of trade offs. Anyway I mean its just tough to be dogmatic about it. I get what you’re saying but why is that the dividing line?
- ltbarcly3 5y agoFunctional style does not allow for 'evolving' a value in multiple steps. In some sense this is the heart of the difference between functional style and other styles of programming. Language features which are only possibly used in a non-functional style make me want to say that describing the language as 'functional' is either wrong or saying a language is 'functional' is a meaningless claim. If every language is functional, saying it is completely redundant. I like your idea of saying FP style is idiomatic in that language might qualify the language as being described as 'functional', which I think agrees with my intuition that mutable strings being built in is evidence that calling that language 'Functional' is misleading or silly.