---
title: "Discussion on \"Better data validation with Guard Clauses\" | Hashnode"
description: "Discussion on \"Better data validation with Guard Clauses\". Let's use Defensive Programming to make sure that invalid data never makes it again!"
url: "https://hashnode.com/posts/better-data-validation-with-guard-clauses/6220e50ce0d8973d4d458d95"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Better data validation with Guard Clauses](https://phillcode.io/better-data-validation-with-guard-clauses?utm_source=hashnode&utm_medium=feed)

Let's use Defensive Programming to make sure that invalid data never makes it again!

Mar 3, 2022 · 16 min read · phillcode.io  
Updated Dec 4, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#validation](https://hashnode.com/tag/validation)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#classes](https://hashnode.com/tag/classes)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Phillippe Santana](https://hashnode.com/@phillippelevidad)

@phillippelevidad · Curitiba, BR

  
[View profile](https://hashnode.com/@phillippelevidad)

CTO at INA

15 years as Software Engineer and Solutions Architect, I also have a strong experience in Leadership, Product Development and Project Management. Interested in: software architecture and development, excelent communication, people, personal development, playing guitar and travelling :)

## Responses 1

Markdown supported · ⌘↵ to post

[Phillippe Santana](https://hashnode.com/@phillippelevidad)

[Dec 4, 2022](https://hashnode.com/posts/better-data-validation-with-guard-clauses/6220e50ce0d8973d4d458d95/comment/638bf09664b7288d8d8e4d2b)

The newer and better version of the guard clauses is now available as an NPM package. Go get it at [@phillcode/guard](https://www.npmjs.com/package/@phillcode/guard), install with `npm i @phillcode/guard` or inspect the [source code](https://github.com/phillippelevidad/guardjs).
