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

Change my mind

  • 10
    Your rant has more than one line.
  • 1
    @Fast-Nop thanks for making me realise 🤭
  • 8
    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
    @uyouthe thanks
  • 1
    @piperguy yes, this is called streaming, what did you want to prove?
  • 6
    Just because you use map and fold it wont magically become functional
  • 2
    That what you believe? Is that opinion immutable?
  • 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