4 ms·
Whenver I use a REPL I'm annoyed I didn't write it as a test, so I get proper import completion and generally tooling support. Finally I usually want to reuse t
by markeibes 4y ago
Whenver I use a REPL I'm annoyed I didn't write it as a test, so I get proper import completion and generally tooling support. Finally I usually want to reuse the code or have a regression.
- capableweb 4y agoI think you're thinking about a different type of "REPL" than what the author is referring to. What you're thinking about is more of a "Programming Shell", a separate window/tab/pane where you enter code and when you're happy, you copy-paste that into your source file. What the author is talking about is a REPL running in the background while connected to your editor. So most of the time, you're entering code directly into your file, while evaluating snippets in the REPL but you never leave the editor itself. With that approach, nothing is stopping you from using the REPL to write the tests themselves. In fact, that's what I tend to get the most value from, writing unit tests together with a background REPL, interactively building up the test case until I'm happy, then committing the unit test that has been written in the process.