views:

115

answers:

3

Alright, so here is a breakdown of my situation.

  • I just finished my first year of 'computer science' in Highschool, learning the fabulous language, Vb.net (get your laughter out now)
  • I am going into AP computer science next year. We will be working with Java.
  • I have tons of free time this summer and I would like to improve my programming skills and become a more efficient programmer.
  • I will be using the BlueJ IDE for Java

Do you think I could learn to program in Java before September? What exercises would you recommend for a novice programmer to get rid of the bad habits that I may or may not have acquired while programming in vb.net? How hard is the transition of VB.net to Java? Would it be easy to work with different IDEs or should I just stick to a single IDE?

+2  A: 

The Java Tutorials would be a good place to start learning Java.

If the idea is to start out fresh and try to get rid of the "bad habits" (of course, using Visual Basic .NET doesn't necessarily mean that you may have picked up bad habits), it wouldn't hurt to take a look at the tutorial from the beginning.

As for the single or multiple IDE situation, at the beginning, I would say starting with one and getting somewhat comfortable wouldn't hurt.

Actually, it might not be such a bad idea to skip the IDE at the beginning and use a text editor and the command line to compile and run programs.

Why? I've noticed that many people who rely only on IDEs don't know the basics of how to compile and run programs, and as a result, have less of an understanding how to actually get things running at the basic level, because the IDE takes care of it for them.

I haven't used VB .NET myself, but I would suspect that if you've programmed in an object-oriented manner, the transition from VB .NET to Java probably isn't going to be a big leap. However, if object-oriented programming seems difficult, then starting out with an IDE like BlueJ (which I've only used a couple times, a few years back) at the beginning might be easier.

coobird
Thanks for the link, but I was really looking for some transition help. But this link sure will help when I sit down and start learning.
Java is actually a language which makes it a pain to use a text editor to write programs, though, as many things that are specified _in_ the file have to be specified outside again (class name, namesp^Wpackages), so a simple change makes moving and renaming files necessary. Not very fun, even though I do most of my programming in a text editor and not an IDE. But not for Java.
Joey
this is a valid point about the IDEs. I don't know how many times my lower level knowledge of how it all works have come in handy when debugging strange edge cases (especially with weird jars). I'm not a Java guy, but I get called in to troubleshoot these things from time to time. It might seem like a little thing, but that extra knowledge is a huge advantage in practice
Ben Hughes
I agree that anything more than some trivial program is going to be a pain to make in a text editor. However, for starting out with learning, most of a time a text editor will suffice, and will be a good opportunity to learn what it actually takes to compile and run Java applications -- those experiences can come in handy in figuring out problems later on.
coobird
+1  A: 

Learning Java before September is totally doable, but there is a lot of upfront learning especially with IDEs that could create motivation issues. Java is much stricter than VB, so the transition might seem pretty odd.

Personally, just coming from my interests, I would take a gradual approach by starting with Processing (http://processing.org/). Processing is Java, but designed for making digital art. It also defers the need for a lot of the boilerplate stuff until you have a need for it. I've found that the learning curve is pretty gentle and the skills translate well. Also, coding up pretty pictures or simple pong implementations is a lot more fun (at least for me) than writing "Hello World".

I transitioned from QBASIC to C++ and then Java and other languages. It's really not too bad.

Good Luck

Ben Hughes
+1  A: 

Well, syntax-wise VB.NET and Java aren't very much alike but in my experience syntax is the least of the problems in learning a new language.

You certainly have to come to grips with the standard class library of Java which is a little differently organized than .NET, although it contains essentially almost the same stuff.

What's more is that Java has very little syntactic sugar to make tasks easy for you. Writing larger programs alsmost invariably need design patterns and Java is a language which is pretty heavy on those. Learning them and knowing when to use them (or at least spot them in the class library) might take some time, unless you already have knowledge in that area.

For example while in VB.NET you have events for propagating messages between objects such a concept does not exist directly in the Java world. There's the observer pattern for that kind of thing. Depending on how you look at it, .NET events are just syntax sugar for the observer pattern, going on below the hood unbeknownst to the beginning programmer, or .NET simply doesn't have the need to approximate a solution with classes and interfaces where a proper one is already in place.

Actually, my biggest gripe with Java is verbosity and the fact that nearly everything has to be a class.

But for learning, I'd suggest you try just diving right in. There are a whole lot of tutorials out there to help you get started (Sun has many good ones covering key aspects of the Java platform). You can redo a project you already done in VB or come up with a task you want to solve yourself (although I'm not very good at such things, ymmv :-)).

But the easiest way to learn a language is to actually program in it. You'll certainly be no expert until September but solving some problems should be entirely doable. Also, I doubt they'll expecting you to have already mastered the language by then.

As for IDEs we use Eclipse a lot around here and just grazed BlueJ during a single lecture. I'd say you should use what works best for you, although I remember BlueJ not so much as an IDE but rather an interactive Java playground or so. I may be mistaken though as I regularly didn't pay attention to the lectures at that time :-).

Joey