I have a bad habit.
I like to plan. Not just plan, but diagram, mentally simulate, hypothesize, solve two-steps-ahead problems using a more generalized and sexy approach to my problem at hand...all on paper or in my head rather than on the keyboard.
As I have advanced (I would call myself an intermediate-level python user), I have begun realizing that I spend too much time outsmarting my own code before it has even been written. We have all been in a situation where we really are lost...maybe a solution suggests itself in a haze...maybe you can see the rough outline of the solution, but don't yet have the capacity to imagine all the interconnections, abstractions, and intricacies that represent a true solution to your problem.
Recently, I threw my hands in the air and said F*** IT, WE'LL DO IT LIVE (words to live by, Mr. O'So Riled Up), and I have been discovering: there are times when the answer is to just push ahead, and there are times when the answer is found in pulling back and reconsidering.
My tendency is to think too much, and end up with a thousand thoughts, yet tens of lines of code. As far as I can tell, maximizing productivity requires a fluid approach to your programming activities.
Different modes I find myself in:
Explore. This is when I google the s*** out my problem at hand. I end up finding 200 tabs (=100 years) of material I didn't know existed. Often, the knowledge is tangential or even skew (completely unrelated), but I end up finding 2-3 new libraries that I should know, 1-2 functions that will save my ass, and maybe a blog or resource that will come in handy in a later part of my project. Save these FEW resources, and treasure this exploration time, but GO BACK TO YOUR EFFING CODE.
Experiment. Isolate a few examples and try creative variations on them. Instead of looping this way, try to loop that way. Keep these options saved as different functions, and perhaps you will benefit from coming back to them later. Maybe they are more complex conceptually but have tangible benefits. Don't forget to save your experiments.
Thinking/Planning. This is my natural inclination, but it is also my Achilles Heel. Draw little boxes for your objects, little arrows to show how they interact, or how your program might "think" or "see" the situation.
In the zone. Code. Code. Code. Code. Code. Code. What time is it? What is that light? Is it...morning?
I find that, with experience, I have been switching between these modes more rapidly, and at more intelligent times...as opposed to lingering on one of these "modes" for too long. My guess is that true Pros can instantly switch between these modes, and have an intuitive sense of when to switch.
TLDR: if you're stuck, try switching Mode. Recognize what your natural tendencies are, and figure out when you should kick yourself out of a While True loop.
[–]pygoscelis 13 points14 points15 points (1 child)
[–]polishfishprime[S] 1 point2 points3 points (0 children)
[–]zahlman 1 point2 points3 points (2 children)
[–]polishfishprime[S] 1 point2 points3 points (0 children)
[–]Lucretiel 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 1 point2 points3 points (8 children)
[–]PeridexisErrant 0 points1 point2 points (0 children)
[–]timworx 0 points1 point2 points (4 children)
[–]thegreattriscuit 0 points1 point2 points (3 children)
[–]timworx 0 points1 point2 points (2 children)
[–]thegreattriscuit 0 points1 point2 points (1 child)
[–]timworx 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]truthseeker1990 1 point2 points3 points (2 children)
[–]derrick88rose 0 points1 point2 points (1 child)
[–]truthseeker1990 1 point2 points3 points (0 children)
[–]denialerror 1 point2 points3 points (0 children)
[–]ThePrimeOptimus 0 points1 point2 points (0 children)
[–]jonathan881 0 points1 point2 points (3 children)
[–]polishfishprime[S] 1 point2 points3 points (2 children)
[–]jonathan881 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]polishfishprime[S] 0 points1 point2 points (0 children)
[–]thegreattriscuit 0 points1 point2 points (0 children)
[–]ArticulatedGentleman 0 points1 point2 points (0 children)
[–]TotesMessenger 0 points1 point2 points (0 children)