News for hackers. Stuff that matters.
Re:What if you couldn’t program with loops? by helloiloveyou on Monday July 15, 2019 @01:01AM (#20438272)
Hey! you are the one from the blog comment :) It must be pretty fun to create those curriculums!! I agree with you that the restriction of not using loops can also direct you to apply recursion.

However do you believe recursion makes it easier to debug certain parts of the array when you can adjust the starting and stoping points in the guard of the for loop?

Re:What if you couldn’t program with loops? by yjhoney on Monday July 15, 2019 @02:16AM (#20438560)
Ultimately, everyone should use higher order functions. In your case (as other commenters have said), map or forEach should have been used.

I don't really want to make a statement that recursion makes debugging easier because I don't code like that at work. I use utility functions (map, reduce, filter, etc.)