Commit No Bug
Published on

Why Typing Until Only One Suggestion Remains Makes You a Better Developer

Authors
  • avatar
    Name
    nikUnique
    Twitter
A person's hands are on a notebook, selecting one of the several auto-complete suggestions.

Intro

I assume that many developers are overusing VS Code's auto-complete (or any other auto-complete), where they type a couple of characters ➡️ press Tab (or Enter) ➡️ and move on. There is nothing wrong with that approach when you are working in a familiar codebase. But there is another, less discussed way of using auto-complete that prioritizes learning depth over short-term typing speed. You may do it by intentionally typing until the suggestion list narrows to exactly one correct option before accepting. This small change in behavior creates surprisingly long-term advantages. The suggestion list may not narrow down to only one option if there are similar options below. Which means that you can't always type until only one suggestion remains. But I suppose that more often than not, there will be situations when only one suggestion remains.

1. Stronger Muscle Memory and Spelling Automatically

When you repeatedly type useEffect, useReducer, getElementById, and stuff like that fully, character by character, your fingers learn the exact sequences. Later, when auto-complete is turned off, or when you switch to a different editor, or when you write code on paper/whiteboard in an interview, the correct spelling is more automatic. The difference between someone who has typed getElementsByClassName 80 times vs someone who has only used auto-complete is noticeable.

2. Deeper Internalization of API Properties and Methods and Naming Conventions

Typing the full name forces you to see and process every part of it. With this, you see which words are used, where the capital letters are, and whether there are abbreviations like props instead of properties. Also, you see how the library creators prefer to name things. After typing createAsyncThunk, extraReducers, pending, fulfilled, rejected dozens of times, you start to feel the naming style of Redux Toolkit (It isn't like I use it). You start to better orient yourself in the library.

3. Fewer "I Accepted It, But It Isn't What I Wanted" Moments

It is very easy to Tab-accept something after 3 characters, only to realize later that you have been using the wrong thing. When you type until you have only one auto-complete suggestion, you are almost guaranteed to get what you wanted. Which means that you can easily avoid this kind of mistake. Let's see an example:

Imagine a developer is writing a script to manipulate the DOM and types:

script.js
document.getElementById('myButton').addEventListener('click', function() {
    document.getElementById('myText').innerT

The auto-complete feature suggests completing the word with innerText, but the developer's actual intention was to use innerHTML. The developer, focusing on speed, accepts the suggestion without noticing the difference. The script runs, but it does not update the HTML content as intended, leading to an "I Accepted It, But It Isn't What I Wanted" moment. The developer must then spend additional time correcting the code:

script.js
document.getElementById('myButton').addEventListener('click', function() {
    document.getElementById('myText').innerHTML = 'New Content';
});

In this case, the auto-complete feature suggested a similar but incorrect word, causing a misunderstanding and requiring additional effort to fix.

4. Better Code Reading and Debugging Speed

The brain recognizes things it has produced with its own hands much faster than things it has only passively seen or auto-completed. People who typed getBoundingClientRect, IntersectionObserver, ResizeObserverEntry, MutationObserver many times read DOM-related code noticeably faster than people who always accepted after getB, Inter, etc. This advantage compounds when reviewing pull requests, reading open-source code, or debugging legacy systems.

When It Is Better to Use This Approach

It is recommended to type until only one auto-complete suggestion if you are learning a new programming language, a new framework, or if you are working in a large/unfamiliar codebase. This is especially crucial when you are preparing for technical interviews. And in the end, it is useful to have periods when you intentionally want to level up rather than maximize the amount of work you do.

When to Auto-Complete Earlier

If you are quite familiar with the codebase, then yeah, accepting earlier suggestions may be beneficial. I also think that if you are really good at some technology and have practiced it a lot, it is natural to auto-complete earlier. But if you are not really good at the technology or if you are not familiar with the code well enough, then it is better to stick to accepting the single remaining auto-complete suggestion.

Conclusion

That's it! These are the advantages you get when typing until only one auto-complete suggestion remains. It is slower than accepting them earlier, but sometimes the slowest way forward is actually the fastest way to mastery. If you like this article, please share it with someone who might find it interesting too. Like my blog? Subscribe to the newsletter.

Got questions? Send an email to commitnobug@outlook.com.