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 sate 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’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?

Have a favourite that I haven’t listed? Leave a comment and let us know!

Reference: The Mouse is a Programmer’s Enemy from our JCG partner Craig Flichel at the Carfey Software Blog blog.
Related Whitepaper:

Software Architecture

This guide will introduce you to the world of Software Architecture!

This 162 page guide will cover topics within the field of software architecture including: software architecture as a solution balancing the concerns of different stakeholders, quality assurance, methods to describe and evaluate architectures, the influence of architecture on reuse, and the life cycle of a system and its architecture. This guide concludes with a comparison between the professions of software architect and software engineer.

Get it Now!  

3 Responses to "The Mouse is a Programmer’s Enemy"

  1. Wesslan says:

    This is so true!
    I really hope my colleagues catch this too… :)

  2. Hi,
    nice post.
    May be you can reference to NetBeans KeyBoard shortcuts page (http://wiki.netbeans.org/Keyboard_Shortcuts).

  3. Pretty much all of these keyboard shortcuts apply to C# and VB .NET programming in Visual Studio as well. You’re right about reaching for the mouse breaking the flow–it’s a change in brain activity from the fingers to the arm and from textual to visual dynamic positioning. It uses a whole other side of the brain. One annoyance is when certain keyboard shortcuts change, in Visual Studio between versions or even depending on what type of file you’re editing. Formatting is an example. Nevertheless, there are many ways to avoid the mouse and even avoid extra typing. For example, being able to type a few characters such as “prop” to insert a snippet of a public property for a class is one of my favorites. Any IDE should be a cybernetic aid to our fingers and brains, and Eclipse and Visual Studio both do a pretty decent job of it.

Leave a Reply


+ 3 = five



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close