9

Functional programming is just writing everything as a one liner!!!

Change my mind

Comments
  • 9
    Your rant has more than one line.
  • 1
    @Fast-Nop thanks for making me realise 🤭
  • 6
    No, its not, what you are referring to as one line is either method chaining or streaming, both of which are available in non-functional languages. Functional programming is a paradigm which works on immutable data without side effects and treats functions as variables.
  • 1
    Good way to start your devrant tho
  • 1
    let sumOfSquares = n => [...Array(n).keys()].map(x => x * x).reduce((x, y) => x + y);

    @yellow-dog not convinced!
  • 0
  • 0
    @piperguy yes, this is called streaming, what did you want to prove?
  • 5
    Just because you use map and fold it wont magically become functional
  • 2
    If you are able to do it in one line and that is a result of the syntax of the language you are using.
Add Comment