# Removing validation, error handling, logging or stated rules to shrink code

*Errors and checks hidden*: one of the ways AI coding agents bloat software, from lessloc's [pattern catalog](https://lessloc.org/patterns/index.md). lessloc catches it as [`removed-safeguard`](https://lessloc.org/guide/reference.md#tier-1).

## What makes removing validation or error handling to shrink code a bad practice?

The standard that calls it a bad practice: lessloc's own "Never cut" list.

## What does lessloc do about removing validation or error handling to shrink code?

lessloc catches it as [`removed-safeguard`](https://lessloc.org/guide/reference.md#tier-1).

- `removed-safeguard` (tier 1): Logging, error handling, validation, or a comment that states a security rule or contract was removed.

## Related patterns

The other patterns in [Errors and checks hidden](https://lessloc.org/patterns/index.md#errors-and-checks-hidden):

- [Swallowed errors](https://lessloc.org/patterns/swallowed-error.md): lessloc catches it as `swallowed-error`.
- [Silenced checks](https://lessloc.org/patterns/silenced-checks.md): lessloc catches it as `suppression`.
- [Checks, fallbacks and catches for cases that cannot happen](https://lessloc.org/patterns/defensive.md): `defensive` catches a null check of a value just created, a type re-checked inside private code and `?.` on a fresh object.
