DEV Community

0 seconds of 7 minutes, 32 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
07:32
 
JavaScript Joel
JavaScript Joel

Posted on

11 1

INVERT IF STATEMENTS and EARLY RETURNS to improve your code readability

Inverting if statements and early returns are two techniques that can be applied that can improve your codebase.

When used properly it can reduce indentation and complexity.

links in video:
https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html
https://www.jetbrains.com/help/resharper/InvertIf.html

Be sure to subscribe for more videos like this!

Alt Text

Top comments (1)

Collapse
 
abanoub7asaad profile image
Abanoub Asaad

Thank you so much!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay