loading...

re: The beauty of Functional Programming VIEW POST

TOP OF THREAD FULL DISCUSSION
re: While I do prefer a FP-esque style of programming, I don't think that the recursive myCount is more readable. It's also less safe, at least as it...
 

I agree. I doubt many people would consider the recursive version to be more readable in this case. Recursion is a very powerful tool which is essential in some scenarios and just plain more elegant and understandable in others. However, here it really is unnecessary. Recursive code can also be extremely difficult to debug. This is my own personal experience from working a lot with trees in several different contexts.

code of conduct - report abuse