4 ms·
Yes, I have heard that. I'm used to frequently restarting R to ensure that codes are reproducible and can run in a clean environment. That's a best practice in
by clircle 4y ago
Yes, I have heard that. I'm used to frequently restarting R to ensure that codes are reproducible and can run in a clean environment. That's a best practice in technical research that seems at odds with the Julia workflow.
- martinsmit 4y agoAs someone who does work in similar domains as yourself, I find that making a main function which contains all of the code I want to be reproducible is a good way to achieve both high speed and running code in a clean environment. Writing .jl files in VSCode and sending code to the integrated REPL with shift-return for playing around is great and then when I want to run code properly I just comment out my testing code, wrap my important code in a main() function (which is sometimes everything apart from the imports) and then just make sure that I'm not referring to any variables or function methods defined that are now commented. This is made relatively easy as VSCode will immediately complain about possible method errors. It's not a perfect substitution for having fast startup and when I go back to Python or R for things like the holy grail called Tidyverse then it feels like a weight off my back, but the benefit of doing things the Julia way is that your code has a clear starting point and it helps readability as you can see what every script is supposed to do.
- krastanov 4y agoI disagree with the conclusion. I agree on the best practices you mentioned, and I follow them when working in Julia (and the Julia Manifest.toml files provides for much better reproducibility compared to e.g. conda). Avoiding recompilation of code that has not changed is not at odds with rerunning your computational pipeline often to ensure reproducibility. It is true though that you can not translate the muscle memory you have in R to Julia. Also, I would say actual best practices would be to have CI, not to be rerunning your code manually.