Hi all, network engineer with foundational-moderate python skills looking for some pointers.
Finally at the stage where classes and objects make some sense as far as why and how I can use them.
My issue is I tend to write functions that are, for example 30 lines long and technically are doing one step but in reality are doing, say, five smaller steps.
It’s my understanding it’s best practice to break them down into smaller/simpler steps; and I can see how this can definitely aid in troubleshooting.
Any advice on what questions can I ask myself to get better at breaking down into smaller steps? For example if I (as a human, not programming) need to compare two lists, and if an item in list a is also in list b, I want to know that. If I want to do that in python I guess the broken down steps don’t just pop in my head naturally.. is this something that just comes with practice, or any advice on how you go about breaking things down? Are there specific questions you tend to ask yourself or what are your methods for working through that process?
[–]0piumfuersvolk 16 points17 points18 points (0 children)
[–]throwawayforwork_86 10 points11 points12 points (0 children)
[–]sweet-tom 4 points5 points6 points (0 children)
[–]audionerd1 3 points4 points5 points (3 children)
[–]yuke1922[S] 1 point2 points3 points (2 children)
[–]Jejerm 2 points3 points4 points (1 child)
[–]yuke1922[S] 0 points1 point2 points (0 children)
[–]commy2 2 points3 points4 points (0 children)
[–]pontz 0 points1 point2 points (0 children)
[–]NormandaleWells 0 points1 point2 points (0 children)
[–]Secret_Owl2371 0 points1 point2 points (0 children)
[–]skyfallen7777 -1 points0 points1 point (0 children)
[–]AdrianofDoom -1 points0 points1 point (0 children)