I think it's the difference between thinking/taking the action "walk to the door and open" (X in the flow state) and "ok get up, left leg forward, right leg forward, left leg forward, right leg forward, move arm to door, grab, twist, pull". Flow is just not thinking about the things that are not important (a lot of code is just gluing and can be done in a flow state - still allowing you to stop and think about the real important places). What your friend is calling out is that yeah I guess that sometimes you can "automate"/flow things that actually are important but to be honest I don't think that happens very often in this context (software, real use(r)-cases) because their use-case are usually so narrow and specific (we should design software to allow them to "flow" the unimportant stuff - click next for the additional questions - did you notice the button responds on mouse click up? I hope not, I hope we made that piece "flowable")
But programing is nothing like mechanical activities.
- reading and understanding existing code
- a often very goal oriented activity (but sometimes exploratory) where I (try to in the latter case) transform a part of the system according to my visions of a better system
- the mechanics of moving the caret around (arrow keys, file selection), selecting text (shift and ctrl modifiers in addition to arrow keys), using shortcuts to invoke pre defined transformations (automated refactoring) etc.
It is the thinking I get paid the good money for.
But if I was constantly struggling with my tools then it will take more time and I would get exhausted faster.
You can't hurt yourself moving the caret around.
My broader point however is that if even a small but non trivial part of my brain capacity must be used to deal with the mechanics.
In a way it is like when I learned to use a climbing harness for work and learned to trust it, the effect on my output when I worked in the field was amazing because everything I did was no longer interrupted by constant considerations and adjustments to stay safe.
If you've used a computer for any length of time, then when you type you're not thinking about the act of pressing each key - you're probably thinking several words ahead of your fingers. If you type half a dozen characters and nothing happens on-screen, then they all appear at once three or four seconds later that would be an intolerable break of flow. (And happens more frequently today than it did when computers were literally 0.1% of their current speed.)
If you're driving, you don't want to be thinking about the act of reaching for the gearstick or indicator stalk, but you do want to be thinking about what's happening on the road - so there you can indeed take "flow" too far.
On the other hand, if you're performing music, your fingers need to be in a state of flow in order to free you to concentrate on the emotion of the music - yet that, too, would ideally be in a state of flow...
It's the absolute opposite, you are totally conscious about what you are doing, and clear headed about the decisions you make.
It does feel effortless, but not in the sense that you are not doing the thing consciously, rather in the sense that the thing seems so obvious and easy as you perform in perfect fluidity.
When I'm in a flow state, I see and understand not only the function in front of me, but the functions it calls, the functions that call it, and the data structures involved. I can see the tree in minute detail at the same time I can see exactly how it fits into the ecosystem of the forest.
It isn't that I'm not thinking hard. It's that thinking hard is possible, rather than interrupted by a constant need to regain context.
I'm a long term emacs user and between changing keyboards a few times and an unfortunate spell of a few years using an IntelliJ-based IDE with Emacs Keybindings that are far better than most but inevitably off (most infuriatingly, to conclude an incremental search you use Ctrl-g, which in actual emacs jumps you back to where you started the search) my reflexes are all over the place. I'm therefore having to force myself to slow down and be consciously aware of everything I do.
I'm finding it a really useful exercise for more than just the retraining aspect. It does seem to increase my overall engagement with the task I'm carrying out, beyond just the operation of the tool.
on the contrary, it is when you are in a state of flow that you are thinking hardest about what you are doing
it sounds like your friend got confused by a random coincidence of word meanings
But yes, sometimes this waste time because you discover afterwards that what you did wasn't what should have been done, if you were less focused on doing it you may have changed your mind before.