What is functional programming?
Anonymous
Functional programming is a paradigm of programming putting functions, in the mathematical sense of the word, at the center. What that means is the following are key in a TRUE functional programming language (yes, Scala and JavaScript, I'm looking at you): 1. Referential transparency and explicit state: any function, given the same inputs, will give the exact same output, time and again. Like a mathematical function, f(x) for the same x is always the same. To that end, state is another parameter that must be passed to the function EXPLICITLY so... for the same paratmeters, the same outcome is guaranteed. 2. Function as first class citizens of the langauge: you can pass functions as parameters to other functions. Functions may return other functions as an outcome, you can assign a complete function to a variable (e.g. varA = f(x)) then call it (e.g. varA(y), which translates into f(y)!!!) 3. A declarative, rather than imperative, style of programming: you define what(!) you want the outcome to be and use as much builtin constructs as possible (or make some yourself) that do NOT require you to tell the program what to do next, rather let the program figure out what the next step is in order to achieve said required outcome.
Check out your Company Bowl for anonymous work chats.