3 ms·
I think functional programming and immutability goes hand in hand, so I wouldn't call x = x*2 an example of the functional thinking. With the same logic, C is
by friendly_chap 13y ago
I think functional programming and immutability goes hand in hand, so I wouldn't call x = x*2 an example of the functional thinking.
With the same logic, C is functional because you don't care about the bit fiddling in x++...
- raverbashing 13y agoYes, x = x*2 is not (y = x*2 would be better) But expecting a while loop to exit as soon as the condition is met (as opposed as while the loop block finished) is a common case