Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

C++ vs Java

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
UndertheOcean Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Mar-13-09 07:40 PM
Original message
C++ vs Java
what is the better language ?

Printer Friendly | Permalink |  | Top
Xipe Totec Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Mar-13-09 07:42 PM
Response to Original message
1. Java is emasculated C++
I've used both languages, forced to deal with Java now.

I would prefer C++

But the market prefers otherwise.
Printer Friendly | Permalink |  | Top
 
mainegreen Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Mar-13-09 07:48 PM
Response to Original message
2. Depends on the programmer now, doesn't it?
Edited on Fri Mar-13-09 07:49 PM by mainegreen
Edited: But I'll vote C++.
Printer Friendly | Permalink |  | Top
 
aePrime Donating Member (676 posts) Send PM | Profile | Ignore Fri Mar-13-09 10:41 PM
Response to Original message
3. That's a rather open-ended question.
A good programmer will choose the right tool for the job. Sometimes that's something like C, or C++, or something on the opposite end like Ruby or Python. Of course, there are a million other languages.

I don't think you can say which language is better -- all you can do is weigh the benefits of each.

* Java has built in garbage collection, which is a major factor for a lot of people. (By the way, it's quite possible to write memory-leak proof C++ with smart pointers like std::auto_ptr, boost::shared_ptr (tr1::shared_ptr), and tr1::unique_ptr).

* Java has built-in threading support (C++0x will as well).

* Java has several tightly-coupled GUI frameworks, whereas C++ has several independent, unofficial GUI frameworks.

* Java is probably more portable than C++.

* Java runs through a virtual machine, which tends to slow things down. However, this can also allow Just-In-Time compiling, which can speed things up!

* The garbage collection in Java can also be a performance issue. C++'s std::auto_ptr and tr1::unique_ptr have no performance slowdowns over correctly-written hand-written code.

* C++ is huge (and C++0x will only make it bigger) and has a massive learning curve. It can take years to become a C++ expert.

* C++ has pointers! Pointer should be avoided if possible, but sometimes you need a pointer!

I write professional CAD software for a living. It's in C++ (but to be fair, it was originally written before Java was available). However, if we wrote it in Java, its performance would probably suffer (especially the ray tracer portion that I'm in charge of).

However, if you're looking to learn programming, I'd start with C++. It's harder to learn than Java, but you'll be forced to learn the fundamentals. Many Java programmers are unaware that it's possible to write a memory leak within Java!
Printer Friendly | Permalink |  | Top
 
DarkTirade Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Mar-13-09 11:01 PM
Response to Original message
4. Depends. Are you looking for one to go out and have fun with, or one to settle down with and
introduce to your family?
Printer Friendly | Permalink |  | Top
 
ChromeFoundry Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Mar-13-09 11:15 PM
Response to Original message
5. This is one of those questions that is better answered with...
another question. What is it that you need to accomplish?

The answer will always be derived from the current need.

Not much different than asking, "Which is the better tool, hammer or screwdriver?"
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Apr 25th 2024, 09:22 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC