Five Essential Keyboard Shortcuts for Coders (and other humans)

Control-Z Keyboard Shortcut Illustrated

Keyboard shortcuts? Why bother?

It used to be fairly safe for a computer science instructor to assume that:

  • Folks who took programming courses were very interested in computers and had already spent a lot of time on a desktop or laptop computer.
  • Folks who spent a lot of time on computers had also spent a lot of time on their keyboards and were likely to be fluent with a core set of keyboard shortcuts.

Neither is true any more. Business students take web development courses simply to get a better understanding of how web sites are put together. Science students now often enroll in Intro CS because it is required for their major. Science is rarely done entirely in test tubes or on bench-tops these days; modeling and simulations are ever more important. Neither group may ever have been interested in computers in their own right.

And, these days, even folks who spend a LOT of time on electronic devices now are not necessarily physical keyboard users. They may well spend most of their time poking and swiping or even, heck, talking to that little box. When they do use a conventional keyboard and mouse, they mostly use menu options accessible via mouse (Edit/Undo, File/Save) rather than keyboard shortcuts.

But, when you are in a coding class, getting your wrist neurons wrapped around a small set of keyboard shortcuts can save you TONS of time and frustration. Sure, the same work can be done with a mouse and the menu options. But not as fast and not as fluently. The less you have to think about when making certain kinds of small changes, the more you can keep the big picture of what you’re trying to accomplish in context.

When you’re not in coding class, the keyboard shortcuts can still be big time savers. If you’re a student who is stepping up your writing game to produce multiple short essays a week or a few longer papers a semester, keyboard fluency can make that work go faster. If you are a teacher who has to grade online or a business person who responds to a lot of emails, the faster and more accurately you can copy/paste, undo, and save, the faster you can cut through the administrivia of your day and get on to other tasks.

So, in order from most important to least, these are my nominations for the five essential keyboard shortcuts all modern humans should know. Mac users note: on your keyboard, substitute the Cmd (command) key for the Ctrl (control) key.

#1: Ctrl-Z — Undo

If you’re like me, you make a lot of small mistakes and/or change your mind a lot as you type. Having the Undo command literally at your fingertips can save time, your mouse shoulder, and sometimes, for coders, your whole day if you can use it to transform mysteriously now-broken code back into the previous was-working code.

For coders: Note that you can use Ctrl-Z not just once but repeatedly. If you had code that was working, then made changes in several places and now have code that won’t run at all, take a few minutes to scan back through your many changes and see if you can spot the problem. But don’t waste time on this step. If you can’t identify the defect after a thorough scan of your new/modified code, Ctrl-Z your way back to greatness (i.e., working code), then, slowly, carefully work your way forward again, testing as often as you can. Feel like undoing lots of changes is too slow for you? A) Test more often, you’ll have less code to fix. B) Sometimes you have to go slow to go fast.

For other humans: Undo is not only great for fixing your own writing. It should be your number one weapon in the ongoing battle against the increasingly over-zealous auto-corrects and auto-formats of your mail and word processing programs. Want a hyphen at the start of a line and it keeps getting turned into a bullet point? A backspace deletes too much. Ctrl-Z undoes just the auto-formatting and leaves your hyphen where you put it. Working on an employee manual and keep seeing the HSA you type get auto-corrected to HAS? Ctrl-Z is a quick fix. (But if you have a problem like this consistently, know that you can change the auto-correct dictionary for just about any product.)

#2: Ctrl-C/Ctrl-V — Copy/Paste

Just about everyone knows the mouse/menu options for copy/paste. Master the keyboard shortcuts. Seriously. Speed of execution goes WAY up.

For those of you who don’t: Simply highlight the text you want to copy. Hit Ctrl-C. Move your cursor to the location where you want the copy to go. Hit Ctrl-V. If you haven’t ever tried it, open a document editor right now and give it a go. Seriously. We’ll wait here for you till you come back.

#3: Ctrl-X/Ctrl-V — Cut/Paste

Ctrl-X, Cut, is the under-appreciated sibling of Ctrl-C. In coding, particularly when you are trying to fine-tune some almost-working code, you more often want to move some code than make another copy of it. If you use Ctrl-C/Ctrl-V, you have to remember to go back and delete the old copy. If you CUT the code, rather than copying it, you know you’ll end up with it in only one place. Afraid of being interrupted in the middle of the operation and losing something? See Ctrl-Z above.

#4: Ctrl-F — Find

Perhaps you are scanning through code to remind yourself of a variable name. Or you find yourself scrolling up and down through a long web page or Word doc to find that one critical sentence you know has to be there. STOP. Don’t scroll, Find. There are very few text-based products any more (and that includes web browsers and pdf readers) that don’t respond to a Ctrl-F by putting up a search box to help you find a word or phrase. No, it’s not a Google search tool. You have to type the word(s) exactly to find them. But compared to scrolling, Find can save your time and your eyes.

#5: Ctrl-A — Select All

Ctrl-A is usually used as a precursor to Ctrl-C. You want to copy all the text out of a doc or a source code file. You can place your cursor at the top and scroll down to the bottom, highlighting as you go. Or you can simply Ctrl-A to select all the text. Be warned, though, this is the one keyboard shortcut that works significantly less well on browser pages. You may end up selecting text you did not want out of menus and nav bars.

#6: Ctrl-S — Save!

Google docs and the auto-save features in many other online tools have made all of us less vigilant about saving compulsively. But, coders, your online code editor is probably configured to wait for you to explicitly Save a file. And, other humans, if you still use the desktop versions of Excel and Word, don’t be in the habit of waiting till you hit the Close button and being prompted to Save. Save early, save often, save tears.

Yeah, sure, my top five list has six entries. Consider 6 just a bit of lagniappe waiting for anyone who got all the way to the end.

Tagged , , . Bookmark the permalink.

About Anne Gunn

A Wyoming native who grew up in Montana, Anne Gunn lived for 20 years in New England before returning to Wyoming in 1999. While in New England, she co-founded Tally Systems, a bootstrap-funded software company. At Tally she wore many hats, including software development, sales, technical support, quality assurance, and product management. In 1995 she promoted herself from Senior VP of Product Management to entry level programmer in order to have more flexibility about when and where she worked. She remained on the board of Tally until its sale to Novell in 2005. Here in Wyoming, she has worked as a freelance programmer and has a small software company, Sheridan Programmers Guild, that publishes apps, websites, and ebooks. But these days, most of her time and energy goes into teaching coding as a computer science instructor at Sheridan College / NWCCD.

Leave a Reply

Your email address will not be published. Required fields are marked *