Nested 'If' vs. Guard Condition - Guard Clauses Technique

preview_player
Показать описание
Guard clauses are a technique that focuses on the fast fail or guards' first approach to stop execution as early as possible.

“In computer programming, a guard is a boolean expression that must evaluate to true if the program execution is to continue in the branch in question. Regardless of which programming language is used, guard code or a guard clause is a check of integrity preconditions used to avoid errors during execution.” — Wikipedia.

Chapters
00:00 Introduction
00:38 Write test
04:13 Guard Clauses
08:55 Write tests for refactored logic

----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
Let me know what packages or plugins you would like to see in the show; I will do my best to invite the authors for pair programming.

Рекомендации по теме
Комментарии
Автор

I actually used this more as a test tutorial, then guard conditions tutorial, I've always felt testing was so mysterious, but seems really simple, thank you!

juanmacias
Автор

Is that a new intro? Suppa cool 🤩🤩. And Love you man. 😊💙

mostafijulislam