My Video Game Childhood
During my Christmas break this year (2017 at the time of this writing), I have been playing some of my favorite childhood games. This got me thinking about one of the first times I started taking hotkeys seriously.
I spent a lot of my teenage years playing real-time strategy games. Age of Empires II and Starcraft were my favorites.
Speed is very important in these games. You must give tasks to your resource gatherers quickly. You must build more of them and build an army faster than your opponent. Exploring and countering your enemy is vital.
I noticed when I clicked some of my villagers, it had keys in the help text. Pressing those keys on the keyboard prevented me from clicking my mouse. While one click may save 1 second, that second multiplied by hundreds of times throughout the game means the difference between winning and losing.
The more I used my keyboard over the mouse, the faster I became. The faster I became, the more likely I was to win.
Hotkeys Improve My Chances of Winning
Later on, I learned about some of the best Starcraft players in the world. They generally live in Korea. One common trait the best players have is their APMs (actions per minute) are extremely high. The best have somewhere in the high 200s or low 300s. That’s 4-5 actions per second!
To get an example of how that looks, check out this video of a Korean game playing Starcraft and Warcraft. That is insane!
I have never gotten anywhere near that speed. However, I generally had more actions per minute than my friends. I beat them a lot of the time. While I definitely couldn’t beat the professionals, I did pretty well for an amateur player.
You may be wondering… what the heck does this have to do with software automation?
From Gaming to Programming
Fast-forward to after college. I get my first development job. After a year or two on the job, I start learning a lot of hotkeys for the tools I use.
One hotkey during the day save perhaps a second. But what about 1000 hotkeys? That saves 15 minutes a day. Or an hour per week.
It doesn’t sound like a big deal, but it starts with a mindset. This love of keyboard shortcuts (and trying to eliminate the mouse) led me to start hating slow-starting applications. The Eclipse IDE loaded slowly on my Windows desktop at work.
So I decided to try Linux. I noticed it loaded a lot faster in Linux. This is not to say that Eclipse really is faster in Linux. It just so happened to load a lot faster with the codebase I was using and with the default settings that were in Linux.
Hotkeys in Linux
Having picked up Linux, now I started to learn its hotkeys. I can launch an application with Alt-F2. I can start a new gnome-terminal windows with Ctrl+Shift+T. After using these shortcuts for a while, they become second nature. When I want to do something, I don’t even have to think about it.
I am addicted. I love the speed it gives me! So I took things up a notch. I learned Vim. I installed the plugin in the Eclipse IDE and started learning it. Over time, I did more and more things in Vim. Eventually, I ditched the IDE to completely do everything in Vim.
I also started using tmux (at the suggestion of colleagues). Why take the time to create new windows in gnome-terminal when it is so much better hotkey-equipped with tmux?
Now when people see me really start to develop, some people are floored. Whereas many might point and click or use the arrow keys, I’m flying through multiple files without thinking. I program almost at the speed that I think of the code.
What about Bugs?
Well, that’s why I do TDD, of course! I’m fast, but I don’t sacrifice quality. I write tests as I write my source code. Besides, the computer is better at finding those bugs than I am.
Are You Obsessed?
Yes, mildly obsessed.
Isn’t that Unhealthy?
Meh. I don’t think so. It’s fun!
Ok, fine. How Do I Get Started?
For tools that you use often, start noticing the buttons you press a lot. Hopefully they have hotkeys associated with them. When you need to perform that specific function the next time, use your keyboard rather than your mouse.
Be vigilant! Keep doing this over and over, and eventually you will start using your mouse less and less. It’s almost like a game by itself. How little can you use the mouse?
If you keep doing this, you will get a lot faster over time at that application. You may even start wanting to use different applications based on the speed of one over the other. That’s why I started using Vim. Then you can learn m ore hotkeys.
It is interesting how all sorts of different experiences we have affects us in the present. When I first started playing AoEII and Starcraft, I never intended it to make me a big hotkey fan. It just played out that way.
I had no idea that same skill would translate to writing faster code.
This is why it is important to always continue to learn and invest in yourself. You never know when some unrelated skill might come back to pay a lot of dividends in the future. Even if that skill is fun. The more fun, the better!