logoalt Hacker News

Zaktoday at 2:03 PM1 replyview on HN

Unit testing doesn't provide the level of interactivity a REPL does. A REPL lets you see the output of parts of an unfinished function based on the running program's state.

If you've already thought out the whole program before you start writing it, that may not be as valuable. In my experience, software often isn't that way and the ease of exploration a REPL and long-running process provide are unmatched.


Replies

bluGilltoday at 2:51 PM

yes and no. You are correct the REPL provides more interactivity. However the downside is you can break something that used to work while make something else work.

There is no reason you can have a REPL and unit tests in the same. Every change results in running all the tests. (of course most changes are syntax error - just "if foo()" is 7 syntax errors. ) I've seen various attempts of this over the years, but quickly your code becomes more complex than the computer can run while you type and you fall back to running most of the tests after in some way.

show 3 replies