Eclipse

Developers Are Lazy (And How To Use That To Your Advantage With Eclipse)

by on February 25, 2014 9:16 am

As I sat down to write this blog post, I thought through how many years I’ve been developing, and how many great people I have been lucky to meet in my career. I’ve been developing professionally for 18 years now (wow, I’m getting old) and the last 10+ have been as a consultant. In all that time, through all the different organizations I’ve been lucky to have worked with and all the developers I’ve sat alongside, there is one thing that sticks out to me about us all… we are lazy.

If you ask a developer to perform a task, most of them will write a program to do it and then run that program. Why? Because… we are lazy. If you come back and ask us to perform the same task again, we’ll just re-run that program. We complain about clicking 3 times, having to scroll a web page and load times that (gasp!) exceed 5 seconds.

I can’t say that I’m any different, though. And to some extent, I think it has served me well. That is to say, it serves developers well to be somewhat lazy. Of course, being inherently lazy is a bad thing. It can make you cut corners, write bad code, not think things through, and make your wife want to pull her hair out.

But, I’m a pretty optimistic guy. Being lazy can also (if used wisely) help breed efficiency. It can foster communication and innovation. Heck, if really put to the test, it could even make you a better programmer.

I look at the development environment that I use day in and day out and I realize how much it does for me, and that I’d be lost without it. My IDE of choice is Eclipse™. I’ve been using it since the late 1990s and I wear her like an old comfortable sweater. I just can’t seem to get away from her.

Between Eclipse’s visual layout, editor support, and keyboard shortcuts, I have been able to train my fingers and brain to not only minimize the number of keystrokes I type to perform tasks, but to also minimize the amount of times my hands have to leave the keyboard touch the mouse. Because that takes forever!

So, here are a few of my favorite features/tips/tricks about being a developer inside of an environment like Eclipse:

Navigation

When I say the word ‘navigation’, what I mean is moving around between files and within one. The ability to quickly locate and open a file for editing is paramount to a developer’s laziness. Can you imagine having to dig through folder after folder every time you wanted to open a file? Eclipse affords you two great ways to avoid that:

1. Open Type – This is typically mapped to the Ctrl-Shift-T key combination. Open Type pops up a dialog box with the cursor focused on the search box.

Developers are Lazy1

Begin typing and Eclipse will present to you a list of classes that match your keyword (wildcards supported!). Use your arrow keys, select the matching file, and hit enter. Voila! You opened a class and your hands never had to touch your mouse. (Note, newer versions of Eclipse also let you choose what View/Editor to open the file with at the bottom of the dialog box).

2. Open Resource – This is typically mapped to the Ctrl-Shift-R key combination. Almost identical to the Open Type command, Open Resource will open any file, not just a Java class. The same methodology applies. Open the dialog, type the name, hit enter. Super simple.

Developers are Lazy2

Many times, I find myself using these tools to not only open files, but to do research on where they exist, too. For example, if I get a ClassNotFoundException, I’ll use the Open Type dialog to type in the name of the missing class and look to see what jar file it exists in. It’s a fantastic way to diagnose classpath, build, and deployment problems.

Now that you have a file open, Eclipse gives you some great tools for navigating within the file itself.

3. Incremental Find – This is typically mapped to the Ctrl-J key combination. This allows you to start searching the open file, keystroke by keystroke. Once you begin, by typing Ctrl-J, you can enter characters to match (case insensitive!). Each character you type adds to the search, and you can see the cursor (and focus) move through the file as it finds matches. Stop typing keys and type Ctrl-J again to move to the next match (for the current string of characters you are searching on).

4. Open Method – This is typically mapped to the Ctrl-O key combination. This allows you to search for a declared method in the currently-open-file. Again, this is case insensitive and wildcard enabled. Simply begin typing part of the name of the method you wish to navigate to, and hit enter to go directly to the highlighted match.

Bonus! – With the Open Method dialog window open, type Ctrl-O again. This allows you to now search and open a method anywhere in the Hierarchy (inherited methods) of the current class!

5. Quick Type Hierarchy – This is usually mapped to the Ctrl-T combination and uses the current cursor position as its context. The purpose of this is to show you a hierarchy tree of all classes in the hierarchy that implement or extend the current selection. For example, put your cursor in the name of an Interface and type Ctrl-T. You’ll be presented with a list of all classes that implement that interface. Do the same on a method name and you’ll see all overrides/extensions of that method. This is super handy for getting an idea of where you are in the hierarchy.

Developers are Lazy3

Task and Time Tracking

Whether you are a consultant, contractor, full time employee, or freelancer, chances are that if you are a developer, you’ll be asked to track your time and fill in a timesheet. There are countless clocks and timers available that are desktop and web-based to keep track of these things. But again, I’m lazy. I want all my tools to be inside of Eclipse so that I don’t have to launch other applications and navigate between them. Eclipse has a decent solution to not only track your time, but to track your work tasks as well. It’s called Mylyn.

Mylyn is the basic idea of listing and tracking the progress and status of tasks you need to perform. Mylyn uses connectors to talk to 3rd party workflow tools, such as Bugzilla, Jira and Rally. By connecting Mylyn to these tools, you’ll be able to your list of work items and activate one to work on. Activating a task (double-clicking it in the Tasks view) not only starts a timer, but also keeps track of every file you touch while that task is activated. Mylyn calls this a context. Files can be added and removed to/from the context. Tasks can be activated and deactivated. Other tasks can be activated and deactivated and Mylyn keeps track of all of it.

Many times, the connector you are using (usually written by the same developers that built the workflow tools) also allows you to open the Task to edit it. This allows you to add notes, log file names and even log time towards the task you are working on. Again, you didn’t have to leave Eclipse to do this.

Database Access

The Eclipse foundation has put countless hours and effort towards developing its database connectivity platform. Built-in Eclipse features are already complete to allow you to connect to remote databases (every major implementation is supported, from Oracle to DB2 to SQL Server and MySQL) and execute queries.

I’ve used their Data Tools Platform in the past, but recently I got nudged towards the Toad plugin for Eclipse. Toad is well known for its desktop database tools, but I’ve never gotten attached to it for whatever reason. But, their Eclipse plugin works fantastically for me.

It allows you to store pre-defined connections, execute queries, and see their results, as well as has a well implemented Outline view of the database. This view shows you everything you have access to once you are logged in. Tables, views, packages, synonyms, and more are all in one compact view. And, the whole thing is filterable by keystroke (wildcards supported!). Can’t remember the exact table name? Simply type in a few characters and let Toad filter the list down for you.

Clicking on a table (or view) shows you detailed information, including the columns, types, references, indexes and constraints. You can even preview the data in the table by just clicking on the Data tab.

And, again, you didn’t have to leave Eclipse to do any of this.

Log File Monitoring

Typically, I’m running my code inside of Eclipse and the logging/output is fed to the console. But there are times when that just isn’t possible. I recently found a nice plugin called LogViewer that allows you to open a log file on the filesystem and watch it grow. This is essentially the Eclipse version of the unix tail command. For those times when you aren’t/can’t run your code inside of Eclipse, this is super-helpful.

Conclusion

Eclipse has many other features that I use daily. I can’t say enough about its repository connectivity (for CVS, SVN, and others), support of server launching (Tomcat, Apache, JBoss, etc), debugging tools, and much more. But when it comes to being lazy, these are my favorites. Have some of your own? Please let us know!

— Adi Rosenblum, asktheteam@keyholesoftware

  • Share:

2 Responses to “Developers Are Lazy (And How To Use That To Your Advantage With Eclipse)”

  1. Zach Gardner says:

    The git plugin for Eclipse is lacking in some aspects, but the Merge Tool is one of the best I’ve ever used. It’s so easy to copy all non-conflicting changes rather than remove the < <<<<< and >>>>>> in a text editor.

  2. Adi Rosenblum says:

    Absolutely, Zach. Everything with comparing/merging/synching and committing files is pretty amazing. Their file-compare tool is so good, I use it to compare files that aren’t even part of my codebase.

Leave a Reply

Things Twitter is Talking About
  • We send out our free monthly tech newsletter tomorrow - dev tips/articles via email. Not on the list? Sign up: http://t.co/h8kpjn419s
    September 16, 2014 at 2:58 PM
  • Want to chuckle? If programming languages were vehicles -http://t.co/quqHsUFCtR #funny
    September 16, 2014 at 11:41 AM
  • In Part 2 of our series on creating your own annotations, learn about processing #Java annotations using Reflection: http://t.co/DJZvQuarkc
    September 16, 2014 at 9:06 AM
  • Don't miss @jhackett01's newest post on the Keyhole blog - Processing #Java Annotations Using Reflection: http://t.co/E1lr3RmjI7
    September 15, 2014 at 12:02 PM
  • We're pretty excited - Keyhole's #BikeMS team raised 158% of their fundraising goal to benefit @MidAmericaMS. Plus, they had a great ride!
    September 15, 2014 at 10:38 AM
  • A huge welcome to David Kelly (@rheomatic) who officially joins the Keyhole team today! :-)
    September 15, 2014 at 10:00 AM
  • Sending warm thoughts to @eastlack, @cdesalvo, @wdpitt & all participating in #BikeMS this AM. Thanks for helping in the fight against MS!
    September 13, 2014 at 8:10 AM
  • .@rheomatic We are so excited to have you joining the team! Welcome :-)
    September 12, 2014 at 4:11 PM
  • As the official holiday is a Saturday, we're celebrating today! Happy (early) #ProgrammersDay to you! http://t.co/1CvUfrzytE
    September 12, 2014 at 1:55 PM
  • Tomorrow @cdesalvo, @eastlack, & @wdpitt are riding #BikeMS to benefit @MidAmericaMS. You can get involved, too - http://t.co/9boQwEUxth
    September 12, 2014 at 11:00 AM
  • RT @AgileDevs: 5 tips for great code reviews http://t.co/9PdbtEv0z8
    September 11, 2014 at 2:53 PM
  • The BEMs of Structuring #CSS - http://t.co/159suYtfx6 A quick introduction to the Block Element Modifier methodology.
    September 10, 2014 at 2:49 PM
  • A huge welcome to Joseph Post (@jsphpst) who has joined the Keyhole team this week!
    September 10, 2014 at 9:52 AM
  • @TheGrisExplores Absolutely, and thanks for the compliment! Here's an article that you might find helpful, too - http://t.co/7oxpaohCS1
    September 9, 2014 at 2:22 PM
  • Express.js seems to be the top pick! MT @TheGrisExplores: "what's your fave server-side MVC framework for NodeJS when SPA is not an option?"
    September 9, 2014 at 1:56 PM
  • RT @TheGrisExplores: Yo @KeyholeSoftware dudes and dudettes: what is your favorite server-side MVC framework for NodeJS when SPA is not an …
    September 9, 2014 at 1:15 PM
  • There is a new post on the Keyhole blog by @brianletteri - The BEMs of Structuring CSS: http://t.co/159suYtfx6
    September 9, 2014 at 12:12 PM
  • Know a bright grad? We're looking for a business support / recruiting representative to join our team in Kansas City: http://t.co/GDvFVmoMF9
    September 8, 2014 at 11:31 AM
  • A huge welcome to @jeremygard who joins the Keyhole team today!
    September 8, 2014 at 8:40 AM
  • 8 tips to help you code for maintainability so the next developer doesn't hate you (which we think is important) - http://t.co/Aoe931WLzb
    September 5, 2014 at 2:40 PM
Keyhole Software
8900 State Line Road, Suite 455
Leawood, KS 66206
ph: 877-521-7769
© 2014 Keyhole Software, LLC. All rights reserved.