MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/86ufrf/a_path_finder_i_recently_made_in_python_pygame/dw8b3a4
r/Python • u/boijunior • Mar 24 '18
111 comments sorted by
View all comments
Show parent comments
2
I see your point. I guess in this case the only way to reduce indentation I see is to "spread" the code out more by placing each loop into its class but I don't see them as removable. I will look back over it.
2 u/Atrament_ Py3 Mar 24 '18 Not wrong. And for a "prototype" code it is rather clean.Your algorithm basically solves the same problem at different scales, right ?If so the "detour" part could be a single function called over different parameters, for instance.Ideally you would end up with the "high order logic" in a main block, and "problem solving logic" in some other blocks.Much easier to maintain ( also to extract to reuse)
Not wrong. And for a "prototype" code it is rather clean.
Your algorithm basically solves the same problem at different scales, right ?
If so the "detour" part could be a single function called over different parameters, for instance.
Ideally you would end up with the "high order logic" in a main block, and "problem solving logic" in some other blocks.
Much easier to maintain ( also to extract to reuse)
2
u/boijunior Mar 24 '18
I see your point. I guess in this case the only way to reduce indentation I see is to "spread" the code out more by placing each loop into its class but I don't see them as removable. I will look back over it.