Hacker News new | ask | show | jobs
by william42 5396 days ago
Recursion isn't worthwhile in Java because of 1) a lack of tail-recursion and 2) the clunkiest possible syntax and most restrictive possible semantics for lambdas.
1 comments

This is a very strong statement. AFAIK most languages don't have do tail-recursion in general (Even most implementations of common lisp, and Clojure only if you use a special keyword).

Recursion is worthwhile in certain cases in any language where the problem naturally calls for recursion; things like DFS and BFS are a lot uglier without recursion. Lambdas and first class functions really aren't necessary for a lot of situations where recursion is natural, and in those scenarios it is clearly worthwhile in Java.