My hands-on introduction to Functional programming has been OpenSCAD, building a 3D model of our house and land. Diving in, and my first realisation and introduction to the fact that it was Functional, was when I set a variable, and changed its value later, but found it had the latter value before I'd set it ... when it was used above that, when I expect it to have the first value set. Took a step back and whooooaa, did some reading and learned some. Then I remember well the next hurdle was that I couldn't write a loop, no iteration ... well, because containers are immutable (not variables per se at all) and so there is no for i ... as i has one value and one value only. So every thing you would instinctively do in a loop demands a recursive solution - and recursion takes on a whole new role, no longer a semi risky thing (of an overflowing a stack) but a central mechanic for solving any sort of repetitive problem.
It sure takes some getting used to, I'll grant that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My hands-on introduction to Functional programming has been OpenSCAD, building a 3D model of our house and land. Diving in, and my first realisation and introduction to the fact that it was Functional, was when I set a variable, and changed its value later, but found it had the latter value before I'd set it ... when it was used above that, when I expect it to have the first value set. Took a step back and whooooaa, did some reading and learned some. Then I remember well the next hurdle was that I couldn't write a loop, no iteration ... well, because containers are immutable (not variables per se at all) and so there is no
for i ...asihas one value and one value only. So every thing you would instinctively do in a loop demands a recursive solution - and recursion takes on a whole new role, no longer a semi risky thing (of an overflowing a stack) but a central mechanic for solving any sort of repetitive problem.It sure takes some getting used to, I'll grant that.