Programmer Superpower Number Two

Only code!

If you haven’t done so yet you can check out my post about Programmer Superpower Number One. That post sets the tone for this one.

Programmer Superpower Number Two is may favorite and will save you tons of time during your development career! So without further ado I present to you Programmer Superpower Number Two!

Whenever you move the mouse to click a button, don’t, just don’t do it, it is bad.

Mouseless Development

Using the keyboard and not the mouse is not an original concept and for good reason. Here are just a few benefits of not using a mouse:

  • Faster IDE navigation
  • Faster code generation
  • Less/no wrist pain/injury
  • Distraction free UI (some IDEs)

There are many more but most of them have to do with being faster at something.

Before we go on I want to highlight the last bullet point with some imagery.

You, your code…and buttons sooo many buttons!

VS

Just you and your code, clean clean cooode!

Now we have two questions to answer:

  1. How do we learn all the keyboard shortcuts?
  2. How do we remember to not use the mouse?

The answer to both of these questions resides with habits and I’m going to teach how to develop them.

First things first.

You’re asking “How can we possibly learn ALL the shortcuts?!?!” You don’t have to learn the shortcuts you just have to habituate them. Here is a simple method I use for turning every keyboard shortcut into a habitual response.

Whenever you move the mouse to click a button, don’t, just don’t do it, it is bad. Instead go look up the keyboard shortcut and use it. Do this for as long as it takes until that shortcut becomes as habitual as typing any other key.

Ok, so this is all dandy but how do you take these steps if your not using the mouse? Not to worry, most IDEs have shortcuts for looking things up and navigating around. I learn those first and then the mouse is just not necessary. For example IntelliJ IDEs have the CTRL + Shift + A shortcut that will display an action search dialog. With that dialog I can do things like navigate to files or anything else a button can do. I use that function in the case I don’t know shortcut I need.

What if there is no shortcut, do I still need the mouse? Probably not, that’s because most IDEs have the ability to add custom shortcuts to a command. For example IntelliJ IDEs have a keymap section in settings. From there you could create your own shortcut if one does not exist already.

This habit will take time and discipline to implement but the return on your investment is astounding. Now that you can navigate your IDE with shortcuts it’s time to move on to the next step to a mouseless developing environment.

Setting the Mouse Aside

Literally! When you sit down at your desk, or wherever you sit to do your work, put the mouse aside. Try to turn off, put out of reach, or even unplug your mouse. If you are using a laptop save up for an external keyboard in order to put the trackpad further away from your hands.

If your IDE is open then that is the cue to put the mouse aside. Every time you go to touch that mouse you should be asking yourself “Is there a shortcut I could learn instead”. Try to go for as long as you can without the mouse. I even try to use the keyboard to navigate my computer and the internet.

What Is The Reward?

In Programmer Superpower Number One I mentioned that some rewards can be a little abstract and hard to identify. At first that seemed to be the case here but after thinking about it for a night I realized it’s not. The main reward here, at least for me, is the feeling of empowerment. Commands begin to flow from your hands, like thoughts, and you begin to feel like you’re in control. Besides that, you also become a dramatically faster programmer and that’s pretty awesome if you ask me.

If you enjoyed this post then stay tuned for Programmer Superpower Number Three!