PokeVideoPlayer v23.9-app.js-020924_
0143ab93_videojs8_1563605 licensed under gpl3-or-later
Views : 15,183
Genre: Science & Technology
Uploaded At Jun 26, 2024 ^^
warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.901 (21/831 LTDR)
97.54% of the users lieked the video!!
2.46% of the users dislieked the video!!
User score: 96.31- Overwhelmingly Positive
RYD date created : 2024-11-23T02:54:21.796585Z
See in json
Top Comments of this video!! :3
There is, unfortunately, no silver bullet when it comes to software engineering. The main drawback of the strategy pattern VS passing lambdas is the verbosity of the code. The big advantage of the strategy pattern, however, is the ability to directly unit test the strategies as well as the opportunity to better express the intent. Which one should you use depends on the problem you are trying to solve. Unless I'm dealing with a very low level code that I have the opportunity to thoroughly test on higher levels of abstraction, I usually opt for strategies.
|
@ebbergemann
4 months ago
There hits a point with these lambdas where the amount of code that doesn't describe itself is quite excessive. One ventures into an application and finds themselves having to debug each and every lambda in order to understand what they are doing.
The extra text in those strategy/interface implementations contain valuable information for other developers. That is, it tells them what the code is doing.
A simple s.ToUpper() is one thing, but when the lambdas are quite long and don't rely on enough named functions describing themselves within the lambdas, the code becomes a mess.
The measure of good code design is not how few lines you can fit it in, but how quickly someone can understand it. Sometimes more code can be understood faster.
32 |