x <- x + 1;
(BTW be careful about assuming you're the brightest guy in the room, how others "struggle to even see" when you do, and with such clarity)
x <- x + 1;
(BTW be careful about assuming you're the brightest guy in the room, how others "struggle to even see" when you do, and with such clarity)
> OK, how about
> x <- x + 1;
Better.
From such syntax you can at least guess that mutation is happening there.
Still nothing you would show a newcomer in a FP-programming introduction.
(I'm not sure why your comment got down-voted. I can only up-vote it, so I did; to battle stupid down-votes because "feels"…)
Your complaint is that the '=' is used in a different domain than programming with a different use. Rightly or wrongly people will adjust to different notations very easily, homonyms in natural languages rarely cause problems because of the context. Same here, this is C/C++ not formal logic.
Once somebody is told 'this is mutation' and it sinks in, it's not a problem.
You make the bigger claim that FP is easier to understand, and I don't buy it. If you want to put forward that, back it up with some evidence. Personally I believe that it depends on the person. I did a brief introduction to FP to a couple of mathematicians and they got it immediately, but then they were extremely bright and had minds naturally suited to handling abstractions. (edit: which I am not and have not, respectively)
And one of them was not allergic to learning C either, and he got a few lessons in that too.
I worked with one person who simply couldn't understand the concept of passing a function around like any other piece of data.
It frustrates me when people (like you) insist that one programming paradigms is The Truth because, the truth is, you need all of them and you need to apply them at the right time – 00, FP, logic, and yes, procedural. If you can't do that, if you're too hung up on one-way then it speaks of inexperience. As a programmer you're there to deliver a solution, not a technology, and I've been involved in the mess when someone far too inexperienced pushed for the tech rather than the saleable product.
Final note, the inventor of Scala is Martin Odersky and I was watching one of his videos on YouTube where he very much surprised me by saying something about allowing Scala to be imperative for when imperative solutions were the more concise answer. And in the end, all computers are state machines.
So please, loosen up your presumptions; the world is a messy place and you need to allow for that.
Would it not have been simpler to write the new text over the top of the old comment?
(edit: replaced dumb with unhelpful)
> Would it not have been simpler to write the new text over the top of the old comment?
But yeah. It's just dumb I guess.