My answer will not be popular.
I believe Lambda is 99% always the best choice for three reasons.
Firstly, thereβs absolutely nothing wrong with assuming your developers are smart. Other answers have a fundamental premise that every developer, but you are stupid. Not this way.
Secondly, Lamdas (and others) are modern syntax - and tomorrow they will become more common than they are today. The project code should flow from current and emerging agreements.
Third, writing the "old fashioned way" code may seem easier for you, but itβs not so easy for the compiler. This is important; legacy approaches have little room for improvement as the compiler updates. Lambdas (et al.), Which rely on the compiler to extend them, may benefit as the compiler handles them better over time.
Summarizing:
- Developers can handle this.
- Everybody do it
- There future potential
Again, I know this will not be a popular answer. And believe me, "Simple is the best" is also my mantra. Maintenance is an important aspect for any source. I understood. But I think that we overshadow reality with some rules of thumb.
source share