- Dec 11, 2002
- 18,408
- 39
- 91
So I'm writing a class that contains a couple of methods that need to be run in succession. Some of the earlier methods are computationally expensive and can take 5+ minutes to run.
If I want to test code in the later methods, I need to re-instantiate the object with the modified code, then re-run all of the methods, and thus taking a long time.
If the methods were in functions instead of being within a class, the outputs of each function would be stored in memory so I can just input those outputs to the function I'm developing. It makes rapid prototyping really quick and easy. What's the best way to develop classes to afford that same prototyping-testing feedback loop ability?
If I want to test code in the later methods, I need to re-instantiate the object with the modified code, then re-run all of the methods, and thus taking a long time.
If the methods were in functions instead of being within a class, the outputs of each function would be stored in memory so I can just input those outputs to the function I'm developing. It makes rapid prototyping really quick and easy. What's the best way to develop classes to afford that same prototyping-testing feedback loop ability?