3 ms·
Sometimes I do work this way in the repl - usually when I have little confidence I even understand how to fit together a new library or API call. But if you spe
by jeremyjh 8y ago
Sometimes I do work this way in the repl - usually when I have little confidence I even understand how to fit together a new library or API call. But if you spend more time in the repl building a data structure and interactively iteratively testing your function, when it is all finished all you have checked into source control is a function, not the tests. You have to then write the tests. In a lot of cases its faster to just write the tests and interact with the code through those. In some language environments this is not exclusive of using a repl - in Haskell for instance it is pretty easy to interactively run a module and tests saved to disk in the repl.
- dasmoth 8y agoPerhaps if great interactive development and debugging tools were more pervasive, there would be less demand for lots of tests written at the same time as the actual function. (The fine-grained "unit" stuff, anyway. System/integration tests come with different trade-offs).