REPL are super nice for this!
I've had a hard time in Java, Fortran, etc. in determining the right development patterns that are used in this space to be productive.
REPL are super nice for this!
I've had a hard time in Java, Fortran, etc. in determining the right development patterns that are used in this space to be productive.
Step2, IDE: Right click + Run.
Step2, CLI: $ run <test name>
Bonus: The test is now part of your automated test suite, and will be ran many times to ensure things don't break.
Maybe it takes 3 minutes to get it into the state where it failed, so instead of starting over every change you just want to modify the one function over and over.
Doing it in a repl like jupyter has you run the actual code many times as you're writing it so ensure things don't break before you ever save the file. Of course thats not an excuse to skip tests, but if I was going to pick one, I would choose running the code as I write it, instead of testing it after the fact.
B. Then memoize the expensive function to disk. Bonus: Can keep multiple versions on disk, thus can tweak the expensive function while having fast reloads with guaranteed correct version.