Stop Indenting Your Code. Use Guard Clauses Instead #programming #coding #tutorial

Channel:
Subscribers:
2,820
Published on ● Video Link: https://www.youtube.com/watch?v=9OI6zaUGOKw



Category:
Tutorial
Duration: 12:04
1,592 views
66


Stop nesting if statements in your code, causing it to indent to the right side of the screen. By reversing your statements, you can often use guard clauses to make things easier to read. In this video, Brendan shows how to use if statements to guard, how to build custom guard methods, and how to use ardalis guard clauses in C# to clean up your code.

Sample Code Used in the Video: https://github.com/DevChatter/YouTubeSamples/tree/main/Indenting

Timestamps:
0:00 - Intro
0:46 - Nested If Statements
4:48 - Custom Guard Clauses
9:01 - Ardalis Guard Clauses
11:28 - Outro

Watch our live stream at https://www.twitch.tv/devchatter

Chat with us on Discord - https://discord.gg/aQry9jG

Contribute on GitHub - https://github.com/DevChatter/

Support DevChatter through Patreon - https://www.patreon.com/DevChatter

Follow Brendan on Twitter - https://twitter.com/brendoneus

Brendan's Pluralsight Courses - https://www.pluralsight.com/authors/brendan-enrick




Other Videos By DevChatter


2022-11-14Avoid Nulls with these in C# #shorts #programming #csharp
2022-11-07Stop Dragging! Copy-Paste Like a Pro in #vscode ! #shorts
2022-11-01Improve Your Code's Performance with Span in #csharp - #dotnet #programming
2022-10-31Record Types Save You Time and Code in C# #shorts #programming #csharp
2022-10-27VS Code Tips and Tricks - Ep 7 #programming #tips
2022-10-25Crash Course in VS Code - #vscode #programming #coding
2022-10-24Correctly Checking for Null in C# #shorts #programming #csharp
2022-10-21First Look at JetBrains Fleet - Live Stream - Ep 270 #programming #jetbrains #firstlook
2022-10-20VS Code Tips - Editor Selection and Line Manipulation - Ep 6 #vscode #programming
2022-10-19Live Coding - Playing some CodinGame in C# and dotnet - Ep 269
2022-10-18Stop Indenting Your Code. Use Guard Clauses Instead #programming #coding #tutorial
2022-10-16Stop Writing HTML - Use Emmet Abbreviations In VS Code instead #html #shorts
2022-10-14Live Coding C# Chat Control of Final Fantasy 7 - Ep 268 #livecoding #livestream
2022-10-13Multiline Editing and Symbol Searching - VS Code Tips - Ep 5 #vscode #programming #coding
2022-10-12Live Coding Chat Control of Final Fantasy 7 - DevChatter Ep 267
2022-10-11Never Re-Throw Exceptions in C# Do This Instead - DevChatter #csharp #programming #tutorial
2022-10-10Don't Use && in C# - Use and Instead #shorts
2022-10-08Live Coding - My First Look at .NET MAUI in .NET 6 - Ep 266
2022-10-063 Things You Didn't Know About VS Code - Ep 4
2022-10-05Live Coding - Attempting the Lift Pass Refactoring Kata - Ep 265
2022-10-04Creating Your First GitHub Action - Learn to Automate Your Builds



Tags:
.NET
.NET 5
.NET Tutorial
.NET for Beginners
C#
C# 9
C# Tutorial
C# Tutorial for Beginners
C# for Beginners
CSharp
CSharp Tutorial
CSharp Tutorial for Beginners
CSharp for Beginners
Coding
Coding for Beginners
Learn C#
Learn CSharp
Programming
Programming for Beginners
Software Development
Software Engineering
c# course
c# programming
c# training
learn c# for beginners
learn c# programming