Developers spend most of their time coding. Writing code is not too dissimilar to writing a dissertation or even writing a poem. You need inspiration, a calm environment and, most importantly, focus. Small distractions are usually the main culprits that impact performance, especially when writing. In today’s post, I want to take a look at the ways in which developers can utilize IDE keyboard shortcuts to improve productivity.
One of the distractions I personally struggle with the most, believe it or not, is using my mouse to complete tasks. It sounds silly but put yourself in my shoes. I’m working on a really complicated task involving some major code changes. I’ve developed a completely new algorithm that performs the task in the best way possible. I’m focusing all of my energy on writing down the details into my IDE of choice. I’m in a Zen-like state, somewhat akin to the Matrix, where nothing else exists around me. It’s just me, the keyboard and a brain full of ideas.
It’s finally complete! Now I just need to invoke the algorithm from the point in the code where it’s needed and damn! It’s in a different file and I need the mouse to open it. No problem! I’ll just go and grab the mouse and…
….wait, what was I doing?!
If, like me, you find yourself getting easily distracted whilst working within your IDE, you’re going to want to unleash the power of IDE keyboard shortcuts!
As I mentioned in my post on how to use IDEs effectively, we must always be aware of the difference between knowledge and usage: it is important to know that a feature exists in order to use it. This is particularly important for shortcuts.
According to Wikipedia, a keyboard shortcut is a ‘sequence or combination of keystrokes on a computer keyboard which invokes commands in software’.
A keyboard shortcut allows easy access to a command (or sequence of commands) in your software. It’s important to remember that you can only invoke commands that are already implemented in your software. Therefore, if a command is not available in your software, there won’t be a shortcut for it and you won’t be able to set up a custom shortcut either.
Shortcuts are an extremely useful feature in almost any software, particularly in IDEs where a lot of commands (aside from the code editor itself) are available to the user. Nevertheless, it’s also really easy to abuse them.
How is that so? Us developers love the sound that our keyboards make when we’re tapping away at them. It’s thus common practice to favour keyboard over mouse usage for almost? everything. The mouse often gets abadoned in the corner of our desks. This doesn’t mean that you need to go out and commit every single keyboard shortcut to memory, however.
As I mentioned in our post on using your IDE effectively, whilst I know Sublime Text has a shortcut to enable multi-addition of several lines simultaneously, I have to search for it whenever I need to use that feature because I only use it a handful of times per year.
From personal experience, I would suggest that every shortcut you use should come naturally to you as a part of your daily typing. That’s to say that keyboard shortcuts must be memorised by your hands and not by your mind. If you end up having to spend time thinking about the keystroke combination you need in detail, the purpose of using a shortcut is completely lost!
Shortcuts are meant to optimise your time; therefore, you should only be aware of those that you use on a daily basis since they will save the greatest amount of time.
Finally, if your IDE of choice allows you to customise your shortcuts or define new ones, don’t hesitate! Give it a try.
Some combinations are pretty complex. Mapping out those commands and customising them into a much simpler combination will save you time and energy!
As I’ve mentioned in previous blog posts, I like to lead by example. As such, here are my top 13 XCode keyboard shortcuts (for version 10.2).
Keyboard shortcuts are powerful tools that can save you a lot of time when used properly. Fail to use them adequately and you’ll be left with a headache!
As with any other feature you use during the development process, it’s important to know what your IDE both can or cannot do and use it accordingly.
Remember pals, you need to know your damn IDE!
What are your favourite IDE keyboard shortcuts and why? Tweet us at @WeAreMobile1st and we’ll be sure to retweet your responses. If you’re interested in reading more of our IDE advice, you can check out our post on how to use IDEs effectively or our post on the simple XCode hack that could optimise developer productivity.
We Are Mobile First is a digital product agency based in Barcelona helping to transform businesses in a mobile-first world. Follow us on Twitter, LinkedIn and Medium to be notified of our future posts and stay up-to-date with our company news.
(Hero image credit: Apple Developer)