PokeVideoPlayer v23.9-app.js-020924_
0143ab93_videojs8_1563605 licensed under gpl3-or-later
Views : 6,454
Genre: Science & Technology
Uploaded At Dec 2, 2023 ^^
warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.813 (19/388 LTDR)
95.33% of the users lieked the video!!
4.67% of the users dislieked the video!!
User score: 93.00- Overwhelmingly Positive
RYD date created : 2024-06-08T17:33:56.281739Z
See in json
Top Comments of this video!! :3
The reason of clean code is to make the code more readable and maintainable for everyone in the team. I can understand your last approach with the expression but as we are coding in C# and not F# and those expression trees are not that commonly used by developers I would rather opt for the version before everything was cramped into one expression simply because I'm not alone in the Team and other developers have no clue about functional languages and will find that statement hard to read.
1 |
My preference is 2# and #3 together, meaning the guard/special case clauses stay like they are and the for loop is turned into a single expression. It's the same as #3 just not using nested ternary, terse code is more often misread than slightly more verbose code. Your formatting helps but what you really are doing is turning back it into a more procedural style. I would probably like to use #3 but I just know it will likely hurt readability for others reading the code. I try to reserve ternary for simple returns/assignments and I never nest them.
|
@brendonlantz5972
11 months ago
Someone mentioned this to me in a code review, and it really had a big impact on my code. It might seem like rearranging the same logic, but you are really separating out conditions. Every additional nested "If" level is a condition you have to keep in your mind when reading the code. By reducing nesting it really helps a codebase stay readable.
11 |