Advice for a noob Java Developer?

Bryan Sant bryan.sant at gmail.com
Thu Nov 9 14:46:07 MST 2006


On 11/9/06, Steve <smorrey at gmail.com> wrote:
> #1 A Good Book, I'ld really like to find a good book targeted towards

You want to read Effective Java by Joshua Bloch (Google fellow).  This
is the best book you will ever read on Java.  It is short and every
page is worthwhile.

Other than that you'll want to bookmark this:
http://java.sun.com/j2se/1.5.0/docs/api/
-or-
Download and uncompress the javadocs into the $JAVA_HOME/docs dir.

> #2 A nice IDE, since my time using Java several years ago a plethora
> IDE's for Java have emerged.  NetBeans, Eclipse, JBuilder etc and
> blah.  I've been using NetBeans now for a couple of weeks, but I
> really feel I've out grown it.  My major specific gripe is that if you
> use the visual editor to create your GUI, you cannot modify certain
> sections of code directly and instead have to use the visual editor to
> edit them, or leave the IDE make my edits in a standard text editor
> and then reload.  Which seems to me to be an unnessacry PITA.
> I'ld just like some advice on what IDE you use for Java development
> and why you like it vs others you may have tried.

Eclipse or NetBeans.  I use Eclipse primarily.  I've only dappled with
NetBeans, but I've used it enough to really like the GUI builder.  If
you're doing Swing UI stuff, then NetBeans is the right choice,
otherwise I'd recommend Eclipse.  It sounds like you're using and
having issues with the NetBeans GUI builder.  I think you haven't
grokked the way NetBeans wants you to use their GUI builder.  The code
they generate is not modifiable for a reason.  You'll never need to
touch that code.  They declare every component as a member field, so
you'll just define your own method and tweak components there.

Anyway, I write all of my Swing UI stuff from scratch.  I don't think
I'm cool because I do that, and I'm not recommending it, but I
personally know the Swing API well and I like coding up the UI myself.
 Because I don't have a need for a GUI builder, I prefer Eclipse over
NetBeans.  Both are a good choice though.  Take time to look through
the menus and see what features exist.  If you don't use the features
of either IDE, then you're no better off than using a text editor.

If you choose Eclipse, you'll want to learn these features:

Yes when you type "." a list of methods/fields come up, but there is a
LOT more to it than that.  Ctrl+Space will always bring up the
auto-complete box.

If anything is underlined in red, go to that line, and hit Ctrl+1.  In
most cases, Eclipse knows what to do, and will suggest how to fix it.
Choose a select and it will fix the problem for you.

Never type "System.out.println" :-).  Type "sysout" and hit Ctrl+Space.

Say you have a method signature like this:
public void doSomething(String mySuperLongCamelCaseName) {
}

You don't type out mySuperLongCamelCaseName = "foot";
You type "mSL" and hit Ctrl+Space.  Eclipse knows what you mean and
types out the full variable name.

Likewise, never browse for a class or file.  Say I want to access a
class I have named "FooManChoo" in the "org.plug.rules" package.  I
don't navigate there (though you can), you hit Ctrl+Shift+T and type
"FMC".  That will take you to your class.

I could go on and on and on.  I've only scratched the surface.  My
point is to play around with the hot keys and inspect whats in the
menus to get the full benefit of either IDE.

-Bryan



More information about the PLUG mailing list