News for hackers. Stuff that matters.
Re:Programming Paradigms for Dummies: What Every Programmer ... by rydel on Tuesday November 06, 2018 @08:15AM (#18390656)
It depends. As we know, FP is all about not having side effects. Having “for” loop requires to mutate the pointer of given iteration.
Re:Programming Paradigms for Dummies: What Every Programmer ... by pjmlp on Tuesday November 06, 2018 @01:52PM (#18393835)
As replied on another thread, you just killed a couple of FP languages with that definition.
Re:Programming Paradigms for Dummies: What Every Programmer ... by nybble41 on Tuesday November 06, 2018 @02:14PM (#18394034)
Those are not FP languages. They are, at best, "functional-first" multi-paradigm languages. (Common Lisp and Scheme are in this category.) Unfortunately, FP is more about what is excluded (side effects) than what is included (closures, continuations, sum types, etc.), so mixing FP with any amount of imperative/procedural code tends to result in an awkward and less efficient form of imperative programming without the primary benefit of FP (referential transparency).

The "function" in "functional programming" refers to mathematical functions, which are fixed mappings from inputs to results with no side effects. If your "functions" can have side-effects then they're not functions, they're procedures. Programs composed of effectful procedures are imperative, not functional.