HACKER Q&A
📣 nso95

How to reduce the amount of time spent debugging?


How to reduce the amount of time spent debugging?


  👤 smt88 Accepted Answer ✓
By far the biggest time saver is to use a language with a strict static type system (ideally Kotlin for JVM, F# for .NET, TypeScript for Node, etc.)

Practice TDD, even on small projects, and write unit tests as you go

Learn how to use an IDE-integrated debugger properly

Avoid magic at all costs (the reflection-based DI in .NET is a particularly egregious example of this -- it is literally undebuggable)


👤 uberman
I finding spending more time writing pseudo code helps me write less code that requires debugging.

If you have assumptions about how this should work, assert() that they are correct.


👤 FroshKiller
Validate parameters first thing on all public APIs and fail early. Write code in the functional style.