4 ms·
> I can write a program with side effects, state mutations, assignments, iterations and conditional statements in OCaml or Scala without issues. That's only be
by petilon 5y ago
> I can write a program with side effects, state mutations, assignments, iterations and conditional statements in OCaml or Scala without issues.
That's only because those languages are not purely functional. If you have state mutations and side effects you're not doing FP at all. Just because a language is known as a "functional language" doesn't mean anything and everything you are able to do in that language qualifies as FP.
- Zababa 5y agoYou're mixing function programming and pure functional programming. > That's only because those languages are not purely functional. If you have state mutations and side effects you're not doing FP at all. You can be doing functional programming with state and mutations. Functional programming is about having first-class functions and using them, and often takes the form of function composition and higher-order functions. > Just because a language is known as a "functional language" doesn't mean anything and everything you are able to do in that language qualifies as FP. That is true. But you can have an impure codebase and still be doing FP without issues.
- petilon 5y ago> You're mixing function programming and pure functional programming. I am glad you said "function programming", as in, programming with functions. That's what you're doing. Don't confuse it with Functional Programming!
- Zababa 5y agoThat was a typo. Please define functional programming, as every source I've seen define it as precisely that, programming with functions.