I find holding down shift for large macro machinations to be a severe cause of pinky strain and awkward hand positioning. I don't do "perfect" home row style typing, but trying to hold left shift through that entire macro is borderline impossible for me to type -- I use my left pinkie for those As, and my left hand for reaching over to that B and that G, which is stressful holding left shift. For right shift, the underscore becomes especially problematic as well. On top of that, right shift (not left!) M has become muscle memory to the point where I reach for it even if I make the effort to hold down left shift for the entire identifier.
This results in, if optimized instead of tripping over my own fingers the entire time: ↓mboot↑↓-p↑↓age↑↓-↑↓align↑
My old iBook capslock key broke in half I hit it so often. I think my pinkies might break in half if I hit the shift keys at that rate!
In Emacs I would end up typing '↑mb↓ M-/ M-/ M-/' (where Meta is the Option key on my keyboard). Because of the way Emacs completes, I might also do '↑mb↓ M-/ M-BS M-BS ↑P↓ M-/'. Either way that's easier to me that typing it out with caps lock or holding the shift key. The only time I can't complete is when I'm defining something for the first time and I'll get over it in that case since it's very rare.
Yes, but you'd agree it's no panacea, surely.
- The main code editors I use all have slightly different completion mechanisms. Using a consistent non-IDE editor, while certainly possible, I find much more clunky than making do. I do use the completion of my primary IDE significantly however.
- C++ completion is wonky in general due to the poor language grammar
- I don't find defining things particularly rare. Every variable (local, member, or otherwise), every function, every class, every macro...
- My muscle memory isn't built around the preprocessor, but around much more multi-context languages (such as C++) where entry as terse as yours will generally break regularly.
My mental state is brittle. Mis-completing identifiers breaks my flow and concentration, whereas typing is almost completely subconcious at this point having practiced it so regularly everywhere from this forum to my first clashes with 16-bit DOS programming. This means I could be seen as wasteful from a pure keystroke perspective on just about every front.
Even in the simple act of googling, I start entering my next, more refined search query while still scanning the results of my previous query. Dynamic search results broke this workflow (prompting me to disable Javascript) as my new text would cause the links I tried to click on to disappear because of the additional text entry, causing the results to refresh. I didn't even realize I was doing it until that change.
My use of completion is similar: Type until I scan the refined identifier to select as an early-bail. The closest I get to your completion style is some blind initial 3-5 character tokens + explicit use of completion keywords in some fairly limited contexts where I have a sufficiently low (1-4%?) failure rate. This translates to C-style free functions in C or C++, and C# members of things (classnames generally get typed out and then Ctrl+.ed for "using ...;" statement generation.) My macro names as a rule are too heavily namespace prefixed to blind-complete in that fashion, with the exception of some locally scoped 1-letter #define s which are #undef ed later in the same scope which need no completion.
While I've experimented with acronym-style completion methods rather than start-of-word-only, I find acronyming to require too much conscious thought, and disambiguation gives me outright struggle. If I'm in a context where the completion simply won't work (say that I haven't imported it yet like I thought I did), I have to go back and retype the entire thing.
You sound like you're using and IDE of some sort. I find their completion to be extremely useful when I can't remember exactly what function I want to call, but less useful when I know it and just want to get it typed out.
I use Emacs so I don't even have the nice semantic completion that IDEs offer (Emacs has some of that with its "cedet", but I can never figure out how to get it to work properly). But Emacs's completion heuristics are good enough for almost everything I do. When you hit the complete key in Emacs (M-/) it first looks backwards through the file you're in looking for the word. Then it looks forward. Then it looks in the other files you have open.
That looking backwards first thing is the key to why it works so well. And that's because most of the time you're referencing variable or macros that are nearby in your code, and almost always just up a few lines. It makes it correct a very high percentage of the time, so much so that I rarely completely type a variable name twice.
Like other people said, typing like that is very stressful for your hands. I wouldn't survive many hours typing like that. (This is one excellent use case for the Kinesis foot pedals.)
That is (↓ meaning shift down and ↑ shift up):
The alternative would seem to be less effcient: