by usrbinbash · 4y ago · 0 comments
> The denunciation of the mouse usually involves invoking concepts such as the “home row”, or the cumbersome migration of the hand between keyboard and mouse. These might all be well and good, if I were a typist and as such all I did was to type. But this isn’t the case, I ponder and perceive, more than I write.
This resonated so much with me :-) I still cannot believe how many people seem to think that the ability to type really fast is important to be a good coder, when we spend the vast majority of our time reading, re-reading and podering code instead of writing it.
When I'm in this state, I'm probably writing pseudo-code fairly close to the real language I'm working in, and not worrying too much about errors I'm not seeing, and just trying to quickly correct the errors I do see, such that I can express my intent on screen. Finding missed typos and other errors is for a second pass and with the help of a compiler/interpreter, for code I write in that manner. It may require some additional passes to tweak things that just don't work, as well, but that's fine. The point was to get what was very clearly in my mind transferred to another medium before something caused a corruption of my mental state.
That's not to say that's the only way I write. I also often devote time to carefully pondering what's on the screen and how to best interact with it to change it in the way I want, or whether there is a better way to do it entirely and that code should be rewritten. But when I'm trying to get what's in my mind onto the screen, little things like auto-indent and being able to accomplish something while keeping my hands doing what they've been doing all add up to help in small ways.
This is how tiny bacteria with flagella operate; they whip their hairs furiously when they want to zoom towards or away from a particular stimulus, but tumble idly in intermediate zones. Having only one mode of operation isn't adaptive.
In that respect it's not whether keyboard binding or mouse context menues are better, it's about providing tools to support both contexts, so the appropriate one can be chosen at the appropriate time.
I have no idea where this notion of "shunning the mouse" came from. The simple fact is that when you're "in the zone", the mouse gets in the way. After having read and re-read other peoples code, and occasionally also having read half a dozen research papers, you are finally ready to dump all the code that has been brewing in your head. At that point, you are a typist. All the for-loops and switch-cases and function calls are jostling around in your head, and you want to serialize them into source code as fast as you can. When you're doing that, forget the mouse even the arrow keys are too far away. All you want is "do what I mean" with "the thing at point". Everything else just disappears outside your region of focus.
So yeah, the mouse is awesome when you're browsing and reading code. But when you're typing code, the home row is the fastest way to get it all out.
EDIT: s/two/too/ far away
On the other hand, I use the mouse a lot while coding and I would say you’re wrong here, for me. I prefer the ability to not have to think about memorized keys when coding.
I go into a state of flow based on what I believe is a combo between visualizing and imagining the code in an object form or something similar, so using a mouse is more natural since I’m still visualizing the mouse menu and the areas I have to click on instead of context switching into the mode where I try to remember keys I often look at the keyboard when typing, too, due to my way of flowing. I personally think it’s because my brain works a bit more visually and my imagination is pretty good, so I am able to map the imaginary code flow in my mind to the text version, so using a mouse to me is like navigating between the two. My mind takes the logic and is able to translate that to mouse movements easily to reach the part of the code I’m thinking about abstractly.
Personally, I’ve tried to be a better typist and tried to use emacs or vim, but I always go back to the way I do things and I’ve just decided my brain works a bit differently than many coders.
To each their own, I say; so do whatever works for you and I’ll keep using my way.
It does both. And much faster than keyboard navigation if you're moving to a text at some distance away from where your cursor currently is. Mouse is literally a pointing device. If you need to go to a point in text 10 lines above your current cursor, moving the cursor there with a mouse is definitely faster than figuring out which of the ten arcane commands will get you there.
There are other shortcuts like Ctrl+Direction to skip chunks of text. Ctrl+Left or Ctrl+Right skips words and symbols, Ctrl+Up and Ctrl+Down, in some of my language configurations, skips to the next starting point of a code block in the same branch.
Movement is very straightforward with the keyboard, and depending on the editor, does not take long to get used to. If the mouse works for you, great. It did for me too, up to a point.
A mouse can afford spacial exploration. Moving text from there to here, style thinking. Versus the keyboard of jump to there, copy text, jump back, paste.
Hard to see either as superior for text. Hard to see how to use the symbolic for spatial data. (Images and such)
But after experimenting with home row mods and (split) keyboards with multiple thumb keys, regular keyboard layout usage just feels terribly inefficient.
While fast typing is not a bad thing it is definitely not necessary skill of good coder. But coding and using the terminal requires frequently using special keys and combinations, which on regular keyboard require constantly moving hands to access hard to reach keys.
Using home row mods (with a special keyboard) the hands are almost resting.
I still look at the keyboard to type. (Glances to ensure focus has not moved... Love emacs' case changing commands for when the caps-lock pressed)
I have thought about learning to touch type - yes, one day.
I have tried clisubg my eyues (that is "closing my eyes") to type....
What is the use, really? I spend so much time thinking about and reflecting on code and so little actually writing it
When I'm writing prose, the speed I can type is the speed I can write. There are no downsides to being a competent touch typist. It's a bit much to say it makes me a better "coder" but there's no question it makes me better at my job.