#2 stands for using recursion over imperative loop constructs, which is an approach heavily biased towards FP. #2 stands for using recursion over imperative loop constructs, which is an approach heavily biased towards FP.
First, I would like to make clear that I used the word prefer with the intention to show that it is more a guideline than a strong rule. I apologies if that is not the exact meaning in English (which isn’t my first language) but that is the meaning of the word “preferir” which is the Spanish translation of that word (my first language).
Second, IMHO, it has been shown that even without going full FP and using effects systems and things like that, Scala power resides in the combination of OOP with FP, using Scala just as an OOP and imperative better Java is not recommended, you are not only no gaining anything. But rather making your life more complicated. If you want a better Java it would be better to use Kotlin.
So, for me, it is safe to say that basic FP constructs are a core for any Scala developer.
Third, #2 refers more to the use of functions like map
& filter
rather than plain recursion. And, I believe this is a good practice even outside of Scala, other OOP languages like JS, Python, Java and even C++ are including these.
Because, it is hard to argue against the idea that those are cleaner and easier to reason about (not necessary that they are always better, but that is another discussion).
Finally, I agree that #4 is the one with the least consensus, I have made that clear in my first post saying it was the most controversial one of the list. So I won’t go further.
I would say that this is actually the place where Scala shines the least. The compiler / build process is extremely slow, and that is a huge pain in development.
I have to say that I am biased about this one, as all the Scala codebases that I work on, are small enough for that being a problem. Also, IMHO, this is an orthogonal issue, the compiler being slow does not demerit that it is really powerful.
Anyways, I would like to return the question, if the type-safety of the language is not Scala’s strongest point for you, then which one is?