Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    What you are doing with dispatch[processingType](data) has nothing to do with functional programming. This is just a hashmap with syntactic sugar to call a defined method on the underlying value. Languages which support functions as first-class citizens is what you are looking for. You can do the same thing in C# and C++ and these languages are by no way functional in nature. Commented Oct 9, 2021 at 22:03
  • 2
    I have changed my description as suggested because it is more precise. However, I must say that there is no precise definition for what is functional programming. Many would accept the only requirement is functions as values, since that opens the door of high-order programming. Others might require more: immutability, recursion (as in recursive style, tail recursion, recursive data structures), laziness, mathematical syntax, pure functions, etc. Languages like C++, C# and Java have ways to provide functions as values, so some might debate they are functional programming languages. Commented Oct 10, 2021 at 15:44
  • @bash0r, odd statement there. C# supports functions as first-class citizens, has recently added tuples, records, pattern matching and natural function types to the language and work is underway in discriminated unions for a future release. Yet still some folk like yourself claim it is "by no way functional in nature". In my view, you are mistaken and C# is well on it's way to being a true multi-paradigm language. Commented Oct 11, 2021 at 9:21