Clean Code Tip: C# Expression Bodied Members to Save Lines of Code



Clean Code Tip: C# Expression Bodied Members to Save Lines of Code

Clean Code Tip: C# Expression Bodied Members to Save Lines of Code

If your constructor, method or property is just 1 line, you can get rid of some braces and lines of code with C# expression bodied members.

💝 Join this channel to get access to perks:
https://www.youtube.com/channel/GeraldVersluis/join

Disclaimer: this channel is done on personal title, in my free time, and not officially affiliated with or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.

🛑 Don’t forget to subscribe to my channel for more cool content: https://www.youtube.com/GeraldVersluis/?sub_confirmation=1

🐦 Follow me on Twitter: https://twitter.com/jfversluis
🤝 Join the Discord server: https://discord.gg/2cAyTGNHBD

🔗 Links
Expression Bodied Members Docs page: https://learn.microsoft.com/dotnet/csharp/programming-guide/statements-expressions-operators/expression-bodied-members

⏱ Timestamps
0:00 – C# Expression Bodied Members
0:08 – From Block Body to Expression Body
0:31 – Which Team Are You?

🎥 Video edited with Camtasia (ref): https://techsmith.z6rjha.net/AJoeD

🙋‍♂️ Also find my…
Blog: https://blog.verslu.is
Twitch: https://twitch.tv/jfversluis
All the rest: https://jfversluis.dev

#csharp #expressionbodiedmembers #cleancode #dotnet #visualstudio

Comments are closed.