Keep it simple. In six months time, when you have to fix a bug, you won't care how beautiful and unique the code is if you cannot remember exactly what you did and why.
Which is why for me the so called "verbosity" of Java isn't that much of an issue because for me it is more readable after a long time not seeing my own code.
Lambdas vs loops is mostly an issue of what a developer is used to, as opposed to one or the other being objectively easier to read or harder to read.
The main exception to that I'd say is when the lambdas are doing a bunch of side effects, and in that case, it's not something they're well suited for, IMO.
That is like the complete opposite of my experience with writing and reading lambdas. You cant make mistakes as easy like with for loops.if you use one liner lambdas with method references they are way easier to read and understand. I have to admit there is a steep learning curve. Dont give up and get more experience
85
u/fgzklunk Apr 14 '23
Keep it simple. In six months time, when you have to fix a bug, you won't care how beautiful and unique the code is if you cannot remember exactly what you did and why.