Monday, April 09, 2007

TOP 10 Tips for New ECLIPSE Users

I’m gonna share my top 10 basic Eclipse tips. These are very simple tips, but I’ve noticed that for some reason many people using Eclipse for the first time end up learning these tips the hard way (through discovery). The following 10 tips should be known by anyone using Eclipse on a day to day basis.

1 Use Code Assist

Code assist (also known as auto-complete) is the kind of feature that becomes almost completely automatic after a very short time. Most modern IDEs have a similar feature – for instance, Visual Studio calls it Intellisense.

The concept is simple – just press the code assist key combination (by default ctrl-space) and the IDE will either fill in where you’ve started typing or display a menu to allow you to choose an auto-completion from several possibilities.

This is the feature you will use the most in Eclipse. I just noticed that I can type ctrl-space without moving my fingers from the home position at all :-).

2 Navigate Through Code By ctrl-Clicking

This is another feature that you stop consciously thinking about once you’ve gotten in the habit. While editing, you can move to a field, method, or class by holding down the ctrl key and clicking on the identifier you’re interested in. This makes navigation dead simple.

When looking through unfamiliar code, this feature is great. If you are wondering what a class is, or what the implementation of a method looks like, it’s as easy as ctrl-clicking it.

3 Quickly Open Classes and Resources by Name

There are two ways to open a class or resource in an editor: the slow way and the fast way :-). Don’t use the slow way – there’s no good reason to.

To open a Java class, press ctrl-shift-T. This will display a dialog box that allows you to type in a class name. To open a non-Java resource (a .txt file for instance) use the ctrl-shift-R shortcut. These open boxes support wildcards, partial names, and even camel case names (try typing ctrl-shift-T, AIOOBE to see camel case search in action).

There is hardly ever a reason to use the Package Explorer view to manually pick out a class to open if you know its name.

4 Know the Keyboard Shortcuts

Eclipse has extremely good keyboard shortcut support. Most of the common operations have an associated keyboard shortcut, and learning these keyboard shortcuts is the most effective productivity boost you can give your Eclipse experience.

There are too many keyboard shortcuts to enumerate them all here, and the previous tip already mentioned two of the most useful shortcuts. However, I will list the shortcuts I think are most useful:

ctrl-shift-G: searches for references to a highlighted class, method, field, or variable
ctrl-shift-F4: closes all open editor windows
ctrl-o: outline popup – very useful for quickly jumping to a method in a large class
F4: shows the hierarchy viewer for a class (ctrl-T shows similar data in a popup version)
ctrl-m: toggle maximize of the current editor or view
ctrl-F11: run the last launched configuration

There’s even a keyboard shortcut you can press that will show you all available keyboard shortcuts in the current context: that’s ctrl-shift-L.

It’s worth noting that the keyboard shortcuts can be customized. However, I don’t recommend you do this. It makes pair programming and team collaboration harder because each machine may have a different set of keyboard shortcuts. The shortcuts Eclipse ships with are good defaults – I recommend leaving them that way.

5 Set the Heap Size

Eclipse is a large, complex, Java-based IDE. It needs lots of memory to perform well. In fact, if you’re using Eclipse to do daily development, you should configure your machine so that Eclipse can use RAM in preference to any other processes.

When starting Eclipse, you should always specify a large maximum heap size. The default Eclipse uses is far too small for normal use. There are lots of ways to specify this when starting Eclipse (see Google). The easiest way is to use the –vmargs parameter with the Eclipse native launcher executable:

eclipse -vmargs –Xmx1024M

That syntax will work only on Sun’s JVMs, by the way. And, yes, I do give my IDE 1GB of RAM to work with. My development box has 4GBs so I have plenty to spare :-).

6 Configure Eclipse To Use a JDK, not a JRE

Eclipse comes with its own Java compiler, so technically you don’t need to install a Java Development Kit (JDK) from Sun to develop Java programs with Eclipse – a Java Runtime Environment (JRE) works just fine.

However, you’re going to want to install a JDK and configure Eclipse to use it. The reason is that this is the easiest way to get the Java source code into your development environment. Doing this will allow you do set browse into and set breakpoints in Java classes, as well as giving you Javadoc support in the IDE for all the standard library classes and methods.

To configure Eclipse to use a JDK, first make sure you’ve installed a JDK on your machine. Then in Eclipse, go to Window -> Preference -> Java -> Installed JREs, and make sure that the default (checked) JRE points to your JDK installation.

7 Use the Eclipse’s Refactoring Support and Code Generation

Eclipse originally became popular because of its support for various kinds of refactorings
of Java classes. These refactorings are still some of the best of any IDE available today.

Many of the refactorings are somewhat hidden and will show up when performing other operations, but you can get started with refactorings by right-clicking in the Package Explorer and looking at the Refactor and Source menus.

Eclipse also has extensive support for code generation. If you’re writing constructors, getters, or setters by hand then learning to use code generation for this will be a huge time saver. Looking at the Source menu mentioned above will get you started with code generation.

8 Use Multiple Workspaces Effectively

Eclipse supports a concept called workspaces. A workspace is a container of projects that has its own set of preferences and metadata. An installation of Eclipse can work with multiple workspaces – you can tell Eclipse which workspace to use when starting up.

Why are multiple workspaces useful? Many developers create an Eclipse workspace for each version of an application, so doing maintenance work and new development don’t conflict. This maps very naturally to branches in a source control system. Multiple workspaces are also good for separating different projects you may be working on at the same time.

The easiest way to specify which workspace Eclipse uses is to use the –data and –showlocation parameters with the launcher:

eclipse –data c:\myworkspace –showlocation

The –data parameter directs Eclipse to use the “c:\myworkspace” directory on the local machine as the workspace directory. The –showlocation parameter shows the workspace location in the Eclipse title bar – very helpful when running multiple Eclipse instances at the same time.

One note – don’t waste time setting your preferences in each workspace you create. Simply use the Import and Export options under the file menu to export preference from one workspace you’ve already set up into new workspaces you create.

9 Use Templates

Eclipse has two different concepts of templates. I’m not going to talk much about Code Templates, which control what generated code looks like. Instead, I’d like to point your attention to Editor Templates, which are a bit like macros.

For instance, open a Java class in an editor, type in “sysout” and press ctrl-space. An editor template automatically expands that to “System.out.println()” and positions your cursor in the right place. This is probably the simplest example of templates, but they can be much more complex than that.

Get comfortable with templates, and learn the template for each piece of boilerplate code like loops, casts, try/catch blocks, etc. You should never have to write these things by hand if you are comfortable with the templates. Even better, you can create your own parameterized templates for commonly used code constructs.

10 Set Type Filters

You can filter the types that Eclipse uses for auto-completion and when searching for classes. For example, there are two classes called List in Java’s standard library – java.util.List and java.awt.List. If you’re not a Swing, developer, you probably don’t care about java.awt.List and almost always want Eclipse to prefer java.util.List. To do this, you can filter out java.awt.List (even better, java.awt.*).

Filters are configured through Window -> Preferences -> Java -> Appearance -> Type Filters. If you’re seeing classes show up at the top of your search you know you’re not interested in, filter them out for faster searching.

Monday, April 02, 2007

KEEP THE MESS AWAY FROM YOUR NEXT FINANCIAL YEAR

Tips below are really easy and helpful to keep you away from financial troubles..

Track your money: Check your bank statement every month and make notes against each entry in pencil. So when you finally present these to your CA, you’ll know exactly what each entry is about—15 minutes every month is all it takes. But it will save you hours of work at the end of the year. Do the same with your credit card statements.

Keep income and expenses in separate boxes--literally: Get two shoe boxes—in one put all your bills, in the other your pay slips, dividends and any other income in the other. And impress your CA further by presenting her with the two boxes at the end of the year.

Joint account for common expenses: If you have a partner who contributes to expenses, open a joint account where each of you contributes a fixed amount every month. All common bills can be paid out of this and you can holiday with what’s left.

A kitty for the house: If you own your own place, it’s likely to need repairs from time to time. Start a recurring deposit where you tuck away a small sum every month—when the big bill comes, you won’t feel the pinch quite as much.

Portable Apps is the way to go …

As my friend Arun was talking about it at BCB3 so i though of writing about it..

So what is a portable App by the way?
A portable app is a computer program that you can carry around with you on a portable device and use on any Windows computer. When your USB flash drive, portable hard drive, iPod or other portable device is plugged in, you have access to your software and personal data just as you would on your own PC. And when you unplug the device, none of your personal data is left behind.

No Special Hardware and No Additional Software is required.

It gives you the following freedom/possibilities to carry...
> your web browser with all your favorite bookmarks
> your calendar with all your appointments
> your email client with all your contacts and settings
> your instant messenger and your buddy list
> your whole office suite along with your documents and presentations
> your antivirus program and other computer utilities
> all your important passwords and account information securely

It has a set of apps, plug-ins and your own personal settings. Use it across a huge section of windows emulations. The apps are portable.

> No formal installation required.
> Use the PC for just the computing power.
> Can be stored in a removable device.

There is a dedicated project going on at SourceForge for Portable Applications…
Performance will not be that good as it’s working off a USB drive. But accessibility of data ANYWHERE is the real beauty…

Time to rejoice the event, BCB3

Well it was really a good feeling organizing and attending BarCamp ,Bangalore 3.As a venue IIMB was the perfect place to have events like BarCamps. We got bigger space and good infrastructure and even IIMB NSRCEL was also involved in the event. We had around 350 campers this time on first day and almost 50% were first timers. There were variety of talks in sections like Mobile, Internet, SocialTech and Demo.

I enjoyed some of the talks –
>> Future of Indian mobile, technology and broadband (telecom) - Sujai Karampuri
>> Are we ready to move to products from services - Savita Kini
>> Authoring a book using a wiki - Kiruba Shankar
>> Activ Mobs - How to build an SMS based application.
>> Deploying Rail Apps - Vivek Prahlad
>> Tinkering Culture OR How Intellectual Property is Screwing Us and How Piracy Will Save Us! - Lawrence Liang
>> The Knowledge Foundation: Opportunities, Ideas, Challenges - Syed

You guys can see the complete list of topics in schedule section of wiki. Check this link for all live and post event coverage. Event images can be found on Flickr.com with Tag name as barcampbangalore3 and most of the presentations can be found at SlideShare.com.
We are looking forward to come up with early event calendar for all the future versions of BCB so that people can better plan out their next visit with great sessions.

Tuesday, March 20, 2007

BarCamp Bangalore 3 - Social Tech


Guys BarCamp, Bangalore (BCB3) is back again..

The Theme - The impact of technology on society and our lives, and vice versa.

At this BarCamp we would like you guys to talk over ups and downs of technology and how technology is affecting our day to day life or rather society as whole..
A wide range of topics under one roof: e-goverence, copyright law, electronic media and many other new innovations to name a few..
So come up with your own topics, ideas and issues and help your fellow campers to gain most out of this camp.

When and Where -
Saturday-Sunday, March 31 & April 1, 2007; 8:30 AM to 6:30 PM, at the Indian Institute of Management, Bangalore (IIMB).

Register -
Registrations for BarCamp Bangalore 3 are open. We already have 200+ registrations prior to any publicity for the event. Barcamp Bangalore typically attracts participants from around India and overseas. You can register for the event here.

Sponsors -
Interested in sponsoring the event? We love you! Step this way please
So see you campers there ...

Popular Posts