Thread: C++ compared to Java

  1. #1
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377

    Question C++ compared to Java

    How faster is C++ compared to Java ? I tryed asking this at offical java forum but they deleted my thread...
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Do you realize that what you are saying is inflammitory?

    http://72.14.203.104/search?q=cache:...s&ct=clnk&cd=1
    http://www.kano.net/javabench/

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Probably marginally faster, considering C++ has 3 characters compared to 4 characters for Java.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > How faster is C++ compared to Java ?
    http://www.albionmich.com/inspiratio...licompare.html

    How about just picking the right tool for the job?

    Your question is about as meaningful as which is better, a hammer or a screw-driver.

    Why do you keep asking?
    http://cboard.cprogramming.com/showthread.php?t=77811
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    the university im planning on going to next summer only teaches Java. unfortunately.

  6. #6
    Prying open my third eye.
    Join Date
    Jun 2005
    Posts
    45
    For what kind of degree? Only Java?

    At my university, Java is taught first, then C++; from there its the students job to learn other languages (besides obvious cases).

    The point is: a programming language is a tool, nothing more. You simply need to decide which tool best suits the problem at hand(Java, C++, Python....whatever)
    "So you're one of those condescending UNIX computer users?"

    "Here's a nickel, kid. Get yourself a better computer."

  7. #7
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    The speed that a language works is not that important, apart from perhaps game code, where as well written C++ programs can be lightning quick
    Double Helix STL

  8. #8
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    One thing I find wierd is that in my computer science course they start with java, then end up doing all the top tier classes in C++ (with the exception of programming languages which teaches several)

  9. #9
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I vote to lock or delete this thread. The original question was asinine and now it's totally derailed.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  10. #10
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    One thing I find wierd is that in my computer science course they start with java, then end up doing all the top tier classes in C++ (with the exception of programming languages which teaches several)
    It maybe that learning Java would give you a solid foundation for moving on to unserstanding C++. Personally, I had no interst in Java. I am not knocking it, it is a good language with many uses, but C/C++ was more what I needed. When I left school in 1997, I learnt a small C course but then took to learning C++ in my own time.
    Double Helix STL

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    > but they deleted my thread...

    There's 4 religions out there.
    - One considers any question like this inflammatory. Followers of this religion usually are secret believers of one of the next two religions.

    - Two other religions have an answer to that question. And they stick to it!

    - The forth and last religion know there is no answer. Atheists! But damn me if they aren't the smart ones.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    The better question would be "I have the following requirements for foo, what might the pros and cons of a Java or C++ implementation be?".

    > I vote to lock or delete this thread.
    We'll see what ElastoManiac's first rebuttal to the arguments are....
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  13. #13
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    Quote Originally Posted by Mario F.
    >
    - Two other religions have an answer to that question. And they stick to it!
    ok, I'll openly admit I'm in one of these two religions

    in all seriousness, Java is slower in execution for a number of reasons, not the least of which is the jvm.

    add that you have to build the framework for your object, every time you want to use it, in java and you have bloated code to start with.
    [ essentially, java requires scaffolding around every object in the code to support the code from falling over itself ]

    a program in C++ can be badly written, with tons of bloat and perform slowly as well, but C++ does not require such bloat as java does.


    the jvm issue isn't that it's needed, it's that there is more than one.
    sorry, eclipse framework to support multiple jvms is just more bloat in the language, not a smart choice.
    it's a cop-out, and the eclipse team should all be shot for stupidity.
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

  14. #14
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    hence the reason why many beginner programmers would choose C++ over Java. Especially for games ( being that was their ideal aim )
    Double Helix STL

  15. #15
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Jaqui
    the jvm issue isn't that it's needed, it's that there is more than one.
    sorry, eclipse framework to support multiple jvms is just more bloat in the language, not a smart choice.
    it's a cop-out, and the eclipse team should all be shot for stupidity.
    Now that paragraph didn't really make sense. What has Eclipse to do with the language?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mats, the java answers
    By Jaqui in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 04-22-2008, 02:12 AM
  2. C#, Java, C++
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-05-2004, 02:06 PM
  3. The Java language is being expanded
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 06-11-2004, 09:07 PM
  4. Java woes
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 07-06-2003, 12:37 AM
  5. C or Java as a first language
    By CorJava in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 10-23-2002, 05:12 PM