An open API service indexing awesome lists of open source software.

https://github.com/aimenux/defensiveprogrammingdemo

Using various libraries to make defensive coding
https://github.com/aimenux/defensiveprogrammingdemo

codecontracts consoleapp dawn-guard ensure-that guardclause netcore3 netframework47 pitcher vs19

Last synced: 2 days ago
JSON representation

Using various libraries to make defensive coding

Awesome Lists containing this project

README

          

# DefensiveProgrammingDemo
```
Defensive coding using various libraries
```

I m adding `defensive coding` to a dummy service/repository sample with the following libraries :
- [CodeContracts](https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/code-contracts) :
a great microsoft library for making preconditions, postconditions and invariants on code but seems to be no maintained (no support for .net core)
- [Pitcher](https://github.com/akamsteeg/Pitcher) :
a library for throwing a meaningful exception when some condition is not met by code (support for .net core)
- [DawnGuard](https://github.com/safakgur/guard) :
another library for throwing a meaningful exception when some condition is not met by code (support for .net core)
- [EnsureThat](https://github.com/danielwertheim/Ensure.That) :
an extensible library for throwing a meaningful exception when some condition is not met by code (support for .net core)
- [GuardClauses](https://github.com/ardalis/GuardClauses) :
a nice library for throwing a meaningful exception when some condition is not met by code (support for .net core)
- [LightGuardClauses](https://github.com/feO2x/Light.GuardClauses) :
a rich and user friendly library for throwing a meaningful exception when some condition is not met by code (support for .net core)
- [Throw](https://github.com/amantinband/throw) :
a fluent, extensible, and customizable library for throwing a meaningful exception when some condition is not met by code (support for .net core)

**`Tools`** : vs22, net 6, net full 4.8