2 ms·
Still, if there's way too much looping logic strewn around the code, that's probably because the code lacks good abstractions for the most routine data access t
by Goladus 10y ago
Still, if there's way too much looping logic strewn around the code, that's probably because the code lacks good abstractions for the most routine data access tasks in this code.
If the code used more objects, each data type would be packaged up with its own methods for looping over the data. For code that doesn't wrap every bit of data in a specialized type, you may find that a few small utility abstractions will clean up your code substantially.
The tradeoff is that you must import these functions in every module that needs to use them, since they aren't passed to your code with the object.