depends on what you want to log I guess (seems doubtful, that you want to log anything here - indeed I never had the need to log anything inside a pure function as you can test it anytime if you know the input to it)
but sure most of us learned programming in the more operational/imperative mindset (basically by doing step-by-step debugging in our head) so it might take some time to get "warm" with FP ;)
But in those more mathematical problems (where the problem often is recursive in nature) it's just a natural fit ;)
depends on what you want to log I guess (seems doubtful, that you want to log anything here - indeed I never had the need to log anything inside a pure function as you can test it anytime if you know the input to it)
but sure most of us learned programming in the more operational/imperative mindset (basically by doing step-by-step debugging in our head) so it might take some time to get "warm" with FP ;)
But in those more mathematical problems (where the problem often is recursive in nature) it's just a natural fit ;)
cool, adding the scala functional :: recursive :: declarative :: concise way to the post :)) .