DEV Community

Discussion on: What Subset Of The Language Do You Not Use?

 
functional_js profile image
Functional Javascript • Edited

Thanks for your feedback John.

"Suggested" is not in my criteria set. ;)
I have no idea how an iterative approach lends to making code "impure". If you have an example of that let me know.
Actually to me, iterative is way more readable, and way more debuggable. And it's certainly faster and certainly more robust according to the metrics output by the tests.

At the end of the day the tests make the decision, not me.
The most performant and robust is what gets deployed.

If a recursive variant won out in the testing, I would deploy it.

Thread Thread
 
johnkazer profile image
John Kazer

I guess the worry with iterators (used by for loops and such) is the potential for receiving or setting them outside the function. Just less self contained.
But at the end of the day is all about preference. I just like the way a functional approach let's me think about, and directly represent in code, the logical structure of what I'm trying to achieve.
Mixing paradigms, if that's the right phrase, means thinking in different ways and so perhaps less clearly.
Definitely agree that when performance matters pick the fastest approach.