2 ms·
If a function is more than a page long, refactoring should be considered. It sounds like perhaps the solution to the parent's readability problem might be repl
by csense 14y ago
If a function is more than a page long, refactoring should be considered.
It sounds like perhaps the solution to the parent's readability problem might be replacing the function in question with two or more functions: One function to load the variables from the table into a class instance, and another to take that class instance and run the algorithm
It's almost always good to keep code that interfaces with the outside world -- reading information from a database, sending triangle meshes to the GPU, whatever -- from pure mathematical code. It sounds like the parent's codebase doesn't follow this philosophy.
Depending on its complexity, the algorithm might need to itself be refactored into multiple functions.