Refresh

This website web.obsidianscheduler.com/mouse-is-a-programmers-enemy/ is currently offline. Cloudflare's Always Online™ shows a snapshot of this web page from the Internet Archive's Wayback Machine. To check for the live version, click Refresh.

The Mouse is a Programmer’s Enemy

One of the first programming management books I was encouraged to read was Peopleware – Productive Projects and Teams. It was a great read and I try to re-read it every once in a while.

One of the topics covered is actually a term that comes from psychology – flow. Flow carries the idea of being completely mentally immersed in a task.

There are a lot of things that can break us out of flow or prevent us from ever entering that state that are out of our control. But I want to focus on something that is completely within our control and that could be interrupting our flow hundreds of times per day.

The Mouse

Reaching for the mouse (trackpad, touchpad, etc.) is a very natural instinct for many of us. But removing one of our hands from the keyboard actually can disrupt our thinking and hamper productivity – albeit not to the extent of many of the other distractions we contend with. Modern IDEs are so feature rich, that if you are deeply involved in a development task, know your requirements and have a well-thought out design that meets those requirements, you can perform much of the development without having your fingers leave your keyboard and maintain your blissful state of flow.

Keyboard Shortcuts

Most of us would agree that using the mouse to perform frequent operations like copy/cut/paste/save/undo/redo is unnecessary. But we can go much further in our effort to keep our minds focused and increase our productivity.

I won’t bother outlining what the shortcuts are since every IDE has its own set of built-in keyboard shortcuts, most allow for customization of these and some languages may have some shortcut concepts that don’t apply elsewhere. What I will do is outline some of the shortcuts that you should know for your IDE and, in brief, how they will benefit you.

I work in Java most often day-to-day, so some of these may apply more strictly to Java developers.

Refactor – rename / move

Don’t hesitate to rename variables, files or move them if it’s in your best interest to do so.

Generate

Generate entire code files, variables, implementation shells.

Open resource

Get to that code or resource file by name.

Open selection

Open the item your cursor is on.

Find references

Find all code uses of the item your cursor is on.

Show hierarchy

Display class hierarchy of selected item.

Indent / Outdent

Keep that code looking beautiful.

Comment / Toggle Comment

Quickly and easily handle code blocks to comments.

Cleanup / Format

More code beautification. Can even be used to resolve code problems.

Add Import

Java import of a specific class.

Run/Debug

Quickly relaunch last launched or the code that’s open in your editor.

Set/Toggle Breakpoint – Step Into / Step Out / Step Over / Run to Line / Resume

Debugger shortcuts.

Quick Fix / Quick Assist / Suggest

Super powerful! Code problem? Your IDE might know how to fix it! Also, save on pointless typing with assist/suggest features.

Duplicate lines

Need to perform another similar operation to an existing block of code? Line duplication without copy/paste!

Templates

Repetitive typing tasks simplified.

In Conclusion

These are just some of my favourites. There are dozens, even hundreds more available. Interested in more information?
IDEA Keyboard Shortcuts
Eclipse Keyboard Shortcuts
Have a favourite that I haven’t listed? Leave a comment and let us know!