How did programming become one of those things that let you enter a flow state? Was it some concept or mental model related to a style of programming or doing lots of projects?
The 'View Source' in browsers is what got me started initially in webdev. It was amazing seeing how sites were pieced together, and it was all progress from there. In the start I copied a lot of code, but then got comfortable writing my own.<p>Also the ability to write code in an editor and see it instantly reflected in the browser by hitting refresh was a game changer. No compiling. No writing code in a black box where you don't get instant feedback or don't know if the code is behaving correctly.
I don't know the answer to this and I wonder how many others will feel the same way.<p>I started copying code out of books a long time ago when you had to do that to run a program at all. Slowly I learned to debug as a result of my own typo's as well as typo's in the original books. Slowly I started writing very tiny things that were my own ideas and I think I got into a flow state even working on those. I do notice that I'm in less of this state when I'm learning a brand new language though.<p>Keep in mind that being in a flow state isn't really about being able to just type the code. I'm constantly looking things up and moving back and forth between previews, edits, etc. It's just that I seem to block out the rest of the world because I'm focused on the task. If someone speaks to me during this time it will either break my flow or I'll accidentally ignore them (or sometimes even respond subconsciously).<p>Anyway, just thought I'd share what little insight I have.
When I was learning programming, I had a very experienced friend holding my hand along the way. I felt that this was great for me as a beginner, although sometimes she would way over-explain something that was irrelevant as a beginner.<p>As time went on, I relied on her less and less, until one day I realized I didn't need her anymore to write anything. At some point during that time, it had "clicked" for me.<p>I think another part of the click happened when I transitioned from Java to Scala: it made me realize just how much time I was wasting manually transforming types/managing collections when map/filter/fold etc were sitting under my nose the whole time in Scala.<p>Yes, I know that Java has ways to accomplish the same things with streams/collectors, but it's not even close to as fluent as it is with Scala. For me, the only language I can truly enter a "flow" state in is Scala.
I have a very vivid memory of following a tutorial for Game Maker which guided you through building an Asteroids clone. There was a section on programming the gun, where you had a variable canShoot which is set to false after each shot and then reset with a timer, to prevent rapid fire shooting. Then as an exercise it asked you to add a second gun with a separate cooldown timer. I remember thinking "okay but what's the name of the second canShoot variable?" and was completely stumped. I gave up and moved on to other things, until a day or so later it occurred to me that the name wasn't relevant, canShoot is not a built-in with magic properties making it suited to this function, and all the other code actually contained the necessary logic.
For me, flow is disrupted when I try to <i>learn</i> and <i>program</i> at the same time.<p>Programming is bliss when I restrict myself to tools and domains that I deeply understand.