Click to See Complete Forum and Search --> : Transition from C++ to Java. Hard?
kozumo
08-02-2001, 12:03 AM
What are your opinions? I've completed first year compsci in C++ and I'm jumping into Java now in a Data Structures/Algorithm course.
I'm skimming through Java now with Java in 21 days and I seem to be OK with it, but I'd like to hear some of your opinions.
[ 02 August 2001: Message edited by: kozumo ]
andrzej
08-02-2001, 03:04 AM
Easy. With no learning at all I opened up an editor and started writing (poor) java.
The only thing that is tricky are threads and synchronized objects. Maybe 'tricky' is too much said - but I've still got problems to get used to it.
It's improving quickly as I'm now working with VHDL in which most statements are concurrent.
Dru Lee Parsec
08-02-2001, 03:21 PM
No problem. In fact, you'll find yourself saying things like "Wait, don't I need a destructor for that" (nope!) "Where's my pointers?" (Don't need 'em).
The only thing that I wish Java had was operator overloading. I'd love to have a Matrix class where I could just say:
A = B * C;
and A would be a matrix multiplication of B * C.
Check out Bruce Eckel's book "Thinking In Java". With your C++ background you'll skim throught the first several chapters on OOP. The rest of it will come easily.
Good luck.
Danger Fan
08-02-2001, 04:10 PM
i agree. not hard at all. just remember that everything is a class, and the file name must be the same name as the class.
also, no destructors.
of course, it gobbles up memory like there's no tomorrow.
good luck, you'll do fine. i got a B+ in my algo/DS class using Java.
Stuka
08-02-2001, 04:29 PM
Not that I've really coded much in Java, but the transition seems fairly easy. I was able to whip out a quick & dirty file copier in about 5 minutes, with only 1 non-syntax-type error (which I quickly resolved by looking at the documentation). So, if you ask me, it ain't that hard to convert.
Originally posted by andrzej:
<STRONG>Easy. With no learning at all I opened up an editor and started writing (poor) java.
The only thing that is tricky are threads and synchronized objects. Maybe 'tricky' is too much said - but I've still got problems to get used to it.
It's improving quickly as I'm now working with VHDL in which most statements are concurrent.</STRONG>
I agree, but I would also mention that thread synchronization issues aren't a Java thing at all, since multithreaded programs of any language must deal with them. I really like Java's thread synchronization implementation. Every object is a monitor (def. (http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=monitor&action=Search) see #2).
lazy_cod3R
08-03-2001, 06:56 PM
I think going from c++ to java is alot easier then the other way around.
You should be able to pick it up very quick and the error messages in java seem to be a bit more helpful then error messages the c++ compiler likes to give out