I recently started working on a project where they encourage writing code with streams lambdas and such. Basically, the functional programming approach. While I find streams appealing, I have a few doubts about them. They are as follows.
Performance - are serial streams really faster and more scalable than corresponding collections? Or are streams only preferable because someday we might use the stream().parallel() version?
Memory usage - are streams a burden on the heap memory given that the terminal operations like collect(toList()) usually create a new object?
Garbage collection (GC) - are streams more GC friendly than collections?
Programming paradigm - I personally think mixing the functional programming style with OOPs is kind of gonna result in issues.
Debugging - I personally debug my code by pen and paper rather than using a debugger (which some people might prefer). How good are streams when it comes to debugging?
Operations Complexity - when it comes to writing everyday code (filtering grouping collecting mapping) streams are a cakewalk, but I find that when I have to write complex logic I end up resorting to the old collection based approach as it is more tweakable. Am I the only one doing this?
I understand that I am asking multiple questions here, but really they are 6 parts of the same question mentioned in the title. Hope for at least a summary like answer to each of these sub-questions. It'd be helpful if someone also could add a link to dive deep into all of these.
cheers!!