A chainsaw is not safe. But you can learn to use it safely.
Replace chainsaw with:
- knife
- guns
- C programming language
There are tools and methods (and a lot of discipline) to ensure safety in C:
- compiler's sanitizers[0]:
- address: to detect out-of-bounds and use-after-free bugs
- pointer-compare, pointer-subtract: to detect invalid operation when pointers are non null
- shadow-call-stack: to detect return address overwrites (stack buffer overflows)
- thread: to detect data races
- leak: to detect memory leaks
- undefined: to detect undefined behaviors
- ...
- static analysis tools, like Splint[1]
Would you ride a motorbike without the proper protections (helmet, heavy jacket, ...) ?
Replace chainsaw with:
There are tools and methods (and a lot of discipline) to ensure safety in C: Would you ride a motorbike without the proper protections (helmet, heavy jacket, ...) ?[0] - https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.h...
[1] - https://github.com/splintchecker/splint