Results 1 to 4 of 4

Thread: Is Java worth it?

  1. #1
    Regular Member Sadrok's Avatar
    Join Date
    Jul 2001
    Location
    South of Africa
    Posts
    265

    Is Java worth it?

    Hi,
    I'm currently expanding my knowledge on C/C++ (I'm just makin' stupid little useless proggies) and want to know if I really have to learn Java.
    I'm not gonna make java applets anyways.
    Is Java any better than C or what?
    You will experience a strong urge to do good; but it will pass.

  2. #2
    Regular Member
    Join Date
    Aug 1999
    Posts
    341
    Java and C++ are very similar. Much of the syntax is the same. There are some difference conceptually, for instance Java has a strict adherence to to OO methodology, in that classes can only inherit from one parent--whereas C++ allows multiple inheritance. But, for the most part, they are the same. The basic difference is the level at which they support portability. C++, assuming it's written ANSI/ISO compliant, is only portable at a pre-compiled level (you have to compile it for each architecture you wish it to run on). Java, on the other hand, compiles to bytecode which is then interpretted by the Java Virtual Machine that resides on the architecture that you run it on (you compile it for the virtual machine, and the virtual machine knows how to interact with the hardware and operating system on the system it is run on).

    Most of the arguments I've heard against Java, from those of us who are C++ enthusiasts, deal with execution speed. Since there is an additional layer between the bytecode and the hardware and operating system, Java runs slower than native C++. However, this is only a factor when you are using large amounts of memory. For instance, if you are using a DOM XML parser to interact with a XML document that has a million entities, then Java will be noticably slower than a C++ version of that same program. But, by and large, there is a very small difference in execution speed.

    The biggest difference between Java and C++, that I've seen, is that Java (javax) has tons of things built into it that C++ doesn't. This is because Sun Microsystems (the creators and maintainers of Java) have worked with many other companies to come up with open standards for different technologies. Which makes it very easy to introduce and replace different features.

    For instance, you interact with a messaging server using the same classes, methods, and parameters, regardless of the vendor of the messaging server (there are some small things to change in the code, but nothing significant). This means, if a better messaging server comes out on the market, you can replace yours with very little work. As of yet, C++ doesn't have anything in place like this. So, you end up using vendor-specific APIs to interact with the same messaging server--meaning that replacing the current messaging server is a lot of work. However, many vendors are extending the Java open standards to their C/C++ APIs. So, this advantage should disappear in the future.

    In addition, Java integrated the graphical user interface (GUI) right into the language. Thus, it does not rely on the operating system or third party toolkits to render a user-friendly environment.

    Another difference, is that Java doesn't let you "be dangerous". It has put in place a fairly well thought out strategy for not allowing the programmer to do things that could harm the environment it is run in. In effect, the virtual machine controls the enviroment, not the programmer. In C/C++, the programmer must be mindful of the environment, as it allows you much more freedom than Java does.

    Both languages have their strengths and weaknesses. Whether one is better than the other is entirely dependent on the application that you are applying the language to and the amount of portability you desire. If, for instance, you are writing an operating system, C/C++ would probably be a better choice (assuming you had to choose between only Java and C/C++). If you are writing a server-side web application that interacts with a database, but you aren't sure what operating system or database you will be using a year from now (or if it will be used on multiple operating systems or multiple databases from different vendors), then Java might be the better choice. You pick the best tool for the job at hand.

  3. #3
    Senior Member onetrueday's Avatar
    Join Date
    Nov 2000
    Location
    Floating down a river of Dingleberry Juice
    Posts
    4,796
    wow. I've read the work of a genuis.
    MSI 845 Ultra-ARU
    p4 1.8a @ 47 BILLION
    radeon8500 (4 HS's)
    2 80gig WD se's raid0/120gig WD
    30gigWD/15gigMaxtor/1.2gig WD
    512megs corsair pc3000xms

  4. #4
    Regular Member Sadrok's Avatar
    Join Date
    Jul 2001
    Location
    South of Africa
    Posts
    265

    Thumbs up WOW!

    That is the best (and longest) explanation and reply to any of my posts. It really helps out, Stu, I honor you
    You will experience a strong urge to do good; but it will pass.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •