-java- programming, not coffee
Nov 26, 2002 at 1:32 AM Post #4 of 16
Just wondering: do you know C++? I've found that learning C++ first is, imho, a better way for getting into java. Also, let's be quite honest: java, ah, well, isn't used all that much.
 
Nov 26, 2002 at 1:41 AM Post #5 of 16
Quote:

Originally posted by andrzejpw
java, ah, well, isn't used all that much.


Um, yes it is. It is extremely popular in the business world for enterprise application development, which is what a huuuuuge proportion of developers do.

You are right, any c-syntax language is an excellent introduction to Java, but it's far from a waste to learn it.
 
Nov 26, 2002 at 2:18 AM Post #6 of 16
Sorry, I didn't mean to imply that java was useless to learn. Although it does have it's place it the enterprise world, to me, a "general" programmer, I find it a bit constricting.

Also, I find that learning C++, c, whatever, first, is a great way to get into java. Java does a lot of work for you.
 
Nov 26, 2002 at 3:57 AM Post #7 of 16
Actually, I wouldn't call Java necessarily easy to learn coming off your typical C++ curriculum. Some of the syntax will come to you more easily of course, but the hardest transition to make is going from a procedure oriented style of programming, which is what you learn for 2-3 years in C++ classes, to object oriented programming. I actually got into Java before I learned about classes in C++, and boy did it take me a while to adjust. The difference being in Java, you HAVE to use it, while in C++, it's optional. On the flip side, once I learned classes through Java, doing it through C++ became a breeze, and just became a matter of learning syntax and restrictions.

One of the craziest things about Java is all the different packages and components you can pull into your program. It's kind of hard to get around Java without some type of reference book lying around to look up what you need. I think if you are doing graphic based apps with an interface, Java has an advantage over C++. On the flip side, I think it's easier to do more mundane tasks using C++, such as sorting, searching, etc.

Every try Assembly? Now that's the shiznit.
very_evil_smiley.gif
011010110110...
 
Nov 26, 2002 at 8:36 AM Post #8 of 16
Quote:

Originally posted by Vertigo-1
but the hardest transition to make is going from a procedure oriented style of programming, which is what you learn for 2-3 years in C++ classes, to object oriented programming.


that's C not C++. you compiler might be the same but you werent programming in C++.
 
Nov 26, 2002 at 10:12 AM Post #9 of 16
Learning C++ (in an OO manner :wink: first is definitely the best way - although nowadays, with the prevalence of Java it could be argued that it may be more practical to go straight to Java.

Learning C++ first is better because you are forced to think about issues such as memory management, object copying and thread synchronization. If you get these things right in C++, then Java will be a breeze.

Java takes some of the pain away when dealing with those issues. This is only good *sometimes*. Also, in order to deal with those issues, major restrictions have to be placed on the language - again, this is only good *sometimes*.

There are also a number of philosophical differences between C++ and Java - which it is useful to be aware of.


Java at the end of the day, is easier to use than C++, partly because of its early adoption of a "standard library" and partly because all complex types are objects which all inherit from a common base class (Object).

Performance of Java is still an issue - which the Java community is making good progress with (JDK v1.4.1).

I started using C in about 1986, C++ in 1990, and playing with Java in1995. It wasn't until about 1998 that Java really became mainstream. Now I work mostly with Java.

It's probably best also, to take a look at the new support for generics and templates(?) that are coming up soon.

--Jatinder
 
Nov 26, 2002 at 1:46 PM Post #10 of 16
Personally, I learned to use classes early on in c++, and now they are an integral part of my programming. That's why transitioning to java would be easy. Personally, I wanted to start with java, and I sort of gave up. :-/ I then started taking c++ classes in high school, and I finally "got" it.

I haven't looked at java in a while though. Performance has always scared me a bit. Jatinder: How's the new jdk different? I may have to peruse it. . .
 
Nov 26, 2002 at 2:31 PM Post #11 of 16
The new JDK offers a better set of I/O primitives which support POSIX-like "select" or "poll" functionality. This means that you no longer require a dedicated thread per socket - which limits vertical scaleability. So with the new I/O primitives, vertical scaling is much better.

Most of the rest of the performance enhancements are transparent to you - mainly in the JVM and garbage collection algorithms. There are now a number of GC algorithms which can be selectively used in client and server apps.

All in all, much better.

There are a number of Java native compilers out there and the new JRockit JVM from BEA dynamically compiles up the entire app from the bytecode.

So raw Java performance really shouldn't be an issue nowadays. It's the GC and the "Java-philosophy" that slows things down now.

--Jatinder
 
Nov 26, 2002 at 5:48 PM Post #12 of 16
I'm not sure if my statement will be too bold, but I always thought C++ is a superset of Java. The transition (at least myself and a few of my friends) of going from C++ to Java is much easier than the other way.

As some had pointed out, performance of java is still and issue, especially with swing.

On the other hand, one of my professor said teaching software engineering in C++ is a pain in the butt.

Some advice from my fellow classmates for coding in Java, do not write something like import java.util.*, instead import the packages as needed. That'd help to improve the performace.
 
Nov 26, 2002 at 6:54 PM Post #13 of 16
People have been saying for years that the next generation of the JVM will solve the performance problems. While things continue to get better, anyone who has experience writing modern compilers knows that Java's performance problems will never totally be solved. The design choices made early in Java's design (notably "every function is a virtual function") make about 85% of modern compiler optimizations impossible. Sure you can do funky stuff at runtime at a large memory cost, but increased program footprint means less of the program fits in the processor cache. A cache miss costs about 200-300 cycles these days! And of course, all those dynamic techniques could be used for languages like C++ too.

That's not to say Java is bad. Far from it. It's probably the best enterprise software development environment there is.
 
Nov 26, 2002 at 11:43 PM Post #15 of 16
Java was never SUPPOSED to match C++ in terms of performance. The reason it's a popular enterprise application development language is that it's easy to do things fast in it without worrying about memory management and garbage collection.

Hardware is cheap. Programmers are expensive. That's why Java is so popular in the business world.
 

Users who are viewing this thread

Back
Top