Why Isn't Debugging Treated as a First-Class Activity?
I would go so far as to suggest that if you need a debugger, you&#x27;re probably doing it wrong.<p>I have found that code that needs a debugger is code that is written in an extremely stateful fashion.<p>The very reason why debuggers exist is to deal with code that has a dozen variables book-keeping complex state that you need to track closely to figure out how something works (or why something doesn&#x27;t). Debuggers even have &quot;watches&quot; to track something closely so that it doesn&#x27;t change underneath you, when you aren&#x27;t looking.<p>To me this is a code smell. I would suggest that instead of using a debugger, we ought to be composing small functions together.<p>Small and pure functions only need an REPL to test.<p>Once you make sure the function is behaving right, you can almost just copy paste over the test cases you ran in your REPL into unit tests.<p>The simplest way to enforce this discipline is to do away with assignments, and instead constrain oneself to using expressions. This forces one to break code into smaller functions. Code written this way turns out to be much more readable, as well as reusable.<p>I suggest that we eschew the debugger in favour of the REPL.