CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2002
    Posts
    8

    when is c++ preferred over java?

    Hi.
    can u answer this.i want to know in which circumstances is java used and when is c++ used.
    In other way when is c++ preferred over java and viceversa??
    thanx
    BBC

  2. #2
    Join Date
    Nov 2002
    Location
    Foggy California
    Posts
    1,245
    The dividing line is not as clear cut as this, but here is a very brief summary:

    Java: Good for web apps, OS-independent apps where performance is not of the essence.

    C++: Good for apps where performance is of the essence or where you need low level platform hooks.

  3. #3
    Join Date
    Feb 2002
    Posts
    5,757
    Use C++ to solve real-world and complex problems that could require unparalled speed and efficiency. Use Java when you are lazy and want a quick and easy solution that Java library offers. Without the library, well, C++ owns you.

    Kuphryn

  4. #4
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Originally posted by kuphryn
    Use C++ to solve real-world and complex problems that could require unparalled speed and efficiency. Use Java when you are lazy and want a quick and easy solution that Java library offers. Without the library, well, C++ owns you.

    Kuphryn
    Heh...it's the reason why Java hiring pep's will give c++ pep's the job even if they don't know how to smoke java beans. But the opposite is rarely true. Learn C++, smoke java on the side

  5. #5
    Join Date
    Apr 1999
    Location
    Altrincham, England
    Posts
    4,470
    When is C++ preferred over Java? All the time, mate. All the time.
    Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
    --
    Sutter and Alexandrescu, C++ Coding Standards

    Programs must be written for people to read, and only incidentally for machines to execute.

    --
    Harold Abelson and Gerald Jay Sussman

    The cheapest, fastest and most reliable components of a computer system are those that aren't there.
    -- Gordon Bell


  6. #6
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537
    Originally posted by Graham
    When is C++ preferred over Java? All the time, mate. All the time.
    That was my short answer. Except for the mate part

  7. #7
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    If the problem is faster, easier, cheaper etc. solved with C++ than with Java. And if the problem specifications does not include things like it should be web-based, run on several platforms etc.

    There is no general when is one programming language preferred over another.

    The basic guideline is that you should pick the language depending on the kind of project/problem you need to solve. And since this is changing all the time there is no general answer to this.

  8. #8
    Join Date
    Nov 2002
    Location
    Foggy California
    Posts
    1,245
    bbcman,

    I think Andreas's post and my earlier posts have the most honest answers. Not to offend the other posters here, but I would not really consider their posts unbiased (considering the question was posted in a C++ forum). I would expect the opposite set of answers if you posted in a Java forum.

    - Kevin

  9. #9
    Join Date
    Apr 1999
    Posts
    27,449
    Originally posted by KevinHall
    bbcman,

    I think Andreas's post and my earlier posts have the most honest answers. Not to offend the other posters here, but I would not really consider their posts unbiased (considering the question was posted in a C++ forum). I would expect the opposite set of answers if you posted in a Java forum.

    - Kevin
    Can you imagine if you did have a "C++ is no good" opinion in a C++ forum or a "Java is a piece of garbage" post in the Java forum?

    If that ever happens, you'll see why forum moderators are important.

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    Originally posted by Paul McKenzie
    Can you imagine if you did have a "C++ is no good" opinion in a C++ forum or a "Java is a piece of garbage" post in the Java forum?

    If that ever happens, you'll see why forum moderators are important.

    Regards,

    Paul McKenzie
    Well, I'm not really here to 'convert' people to C++, so if someone posts a well argued post that in some circonstances java is better than C++, that's fine.

    But yes, as you said, it's really pointless to say "C++ resp. Java is no good". If that's all that is in a post, I may use my superpowers to cast it into oblivion And we know some people that tend to do just this

    Personally I agree with Andreas' approach. I mean, I even use VB regularly to test my COM objects. The sort of applications you write in each language are probably quite different, and each language is better suited for some things than for others.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured