Are there any recommended ways to organize code? THe simulation project I'm working on has gotten a little unwieldy. I've read up on packages but have never used them before. It seems fairly straightforward? Right now I have all my code for this simulation in 3 cells:
Cell 1: Function definitions Cell 2: Parameter Initializations Cell 3: Main time stepping loop
This way of working seemed reasonable when the code was small but it has gotten unwieldy. Modifying function definitions is problematic since the variable names used in function definitions tend to be used in Cells 2 and 3, so they have to be Cleared in order to re-run the cell with the function definitions. I'm thinking I should just move the function definitions into a package? Then if I modify a function I do it in the package and just rerun the Package? If some of the arguments in the functions in the package are also used in the notebook where I'm working this won't cause any problems as the package won't know about the notebook?