Page 1 of 3 123 LastLast
Results 1 to 25 of 54

Thread: The great battle. Java VS C++

  1. #1
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    The great battle. Java VS C++

    Please note this thread is in this sub forum because I cannot access the programming ones at this moment in time.

    I have knowledge of C++ and to be honest I really like it, just when I looked into GUI's WIN32 to be precise that freaked me out, that's when I came across Processing (.org) and with Processing you can draw shapes to the screen with ease.. This is were Java comes in, Processing is made with Java so I'd have to learn Java to learn Processing..

    But there's problems..

    C++ is faster and in my opinion a more professional language, though I do not want to spend hours on a project that could take a matter of minutes in Processing..

    Also Processing can be embedded into web pages, unlike C++.

    Please say which one you think and WHY.

    I don't want "Bc0z 1 54Y 50" I want logical and explained answers please, this may be the start of my career..

    ~ Mathematics.

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Java and C++ both have their advantages. But in the end I think C++ wins. (Although C is better)
    You can also make the GUI with Java (processing) and the rest with C++, using the JNI.

    I don't like Java's garbage collector. But java definitely has possibilities.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  3. #3
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you, but why would you think C was better than C++?

    Most argue the other way around?

  4. #4
    Join Date
    Oct 2006
    Location
    Texas
    Posts
    1,450
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Mathematics View Post
    Thank you, but why would you think C was better than C++?

    Most argue the other way around?
    Just for future reference, please make your font bigger.

  5. #5
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    No programming language is better then the other. Each has their own weaknesses and strengths.

    And about starting your career, I suggest you ask yourself what you want to do. Then you research those jobs and see what languages they require. If they require knowledge of C++, maybe C++ is the best choice.

  6. #6
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Honestly, this question really should be C# vs Java. As those two languages are the most similar. When you start comparing two fairly dissimilar languages your answer almost immediately becomes "It depends on what you are trying to do."

    C++ is good because it has a lot of high level and low level features. It can be very fast and easier to program then other low level languages (fortran). Wizzup, the day when C was almost always faster then C++ is over, a good C++ compiler will optimize C++ just as much as it will C.

    Java is good because it is stupidly easy to make a cross platform application. It is also easier to make things like window, buttons, ect. Java has a fairly fast execution time (not as fast as C++). For most, computers have gotten sufficiently fast that any speed loss is a moot point compared to the development speed gain.

    If I was to recommend learning a language, I would say go with C# (the other option) Most developers (at least in the US) use this as their main language. Few actually get down to the nitty gritty of the hardware stuff. With C# you enjoy things like automatic garbage collection, a huge API (the .Net architecture) filled with many functions and features, and lots of support from the MSDN (One of the BEST API documentations ever written. Seriously, you just don't get much better then the MSDN)

  7. #7
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    really? my experiance with MSDN is it being sometimes really vague and unclear, and doesnt link together very well.

    i much prefer javadocs to msdn, they have things which msdn simply does not.
    like the "use" and "tree" thing, also you can easily make your own javadocs with the javadoc tool which is included by default with the java SDK.
    as far as i know you cant make your own msdn.


    with java you also get automatic garbage collection and a huge API.
    also, in some cases java's JIT compiler can beat c++ in speed. (some people dont believe this because it seems counter-intuitive, but is true i assure you)

    also boberman, maybe wizzup wasnt thinking of speed when he said c > c++.

    but the main reason i dont use c# is beacuse it doesnt work on my operating system. (mono has been around for 5 years and acheived not very much, clearly microsoft wants it to fail)
    Join the Official SRL IRC channel. Learn how to Here.

  8. #8
    Join Date
    Dec 2008
    Location
    Vermont
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This entire situation is like micro$oft(vista, xp) vs Linux(distros), it will never end as both have there pros and cons. Now the reason why(truthfully) think most perfer c++ above java is because:

    1- Micro$oft made it(so it must be better... hahaha)
    2- It gets mass attention

    Mass attention kills anything, which IMO it did for c++. ((Also it was killed because micro$oft distributes it))

  9. #9
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Mathematics View Post
    C++ is faster
    http://www.idiom.com/~zilla/Computer...benchmark.html
    I made a new script, check it out!.

  10. #10
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Do note that gcc isn't the best C Compiler when it comes to optimizations.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  11. #11
    Join Date
    Feb 2007
    Location
    Toronto, Ontario, Canada
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by slewx View Post
    Now the reason why(truthfully) think most perfer c++ above java is because:

    1- Micro$oft made it(so it must be better... hahaha)
    Microsoft makes and distributes C# and Visual C++, both of which are their own flavours based on the .NET framework/Windows API. C++ was made by a fellow named Bjarne Stroustrup in 1979, while Microsoft was still busy writing Altair BASIC - http://upload.wikimedia.org/wikipedi...Paper_Tape.jpg .

  12. #12
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Yakman View Post
    really? my experiance with MSDN is it being sometimes really vague and unclear, and doesnt link together very well.

    i much prefer javadocs to msdn, they have things which msdn simply does not.
    like the "use" and "tree" thing, also you can easily make your own javadocs with the javadoc tool which is included by default with the java SDK.
    as far as i know you cant make your own msdn.


    with java you also get automatic garbage collection and a huge API.
    also, in some cases java's JIT compiler can beat c++ in speed. (some people dont believe this because it seems counter-intuitive, but is true i assure you)

    also boberman, maybe wizzup wasnt thinking of speed when he said c > c++.

    but the main reason i dont use c# is beacuse it doesnt work on my operating system. (mono has been around for 5 years and acheived not very much, clearly microsoft wants it to fail)
    Ok, I've never used javadocs, so I couldn't say if MSDN is better or worse then them. However, I have used man pages. In some areas, a function or procedure has been documented pretty well, but in others its a PITA to figure things out.

    Don't believe me? See how long it takes you to figure out how to move the mouse in Linux or even get a pixel color on the screen. Not very easy, XLib documentation is very patchy in a lot of ways.

    As for the speed thing, if not speed, what else is there? For the average programmer C++ can do everything that C can and more. There are some changes but most will never notice them. OOP rules.

  13. #13
    Join Date
    Dec 2008
    Location
    Vermont
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by A G E N T View Post
    Microsoft makes and distributes C# and Visual C++, both of which are their own flavours based on the .NET framework/Windows API. C++ was made by a fellow named Bjarne Stroustrup in 1979, while Microsoft was still busy writing Altair BASIC - http://upload.wikimedia.org/wikipedi...Paper_Tape.jpg .
    If I remember correct micro$oft had a contract with sun to publish java under there visual studio until they went over board and was sued by sun. They where forced to stop publishing it. They called it j# I believe. That's what I was getting at.

  14. #14
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by boberman View Post
    Ok, I've never used javadocs, so I couldn't say if MSDN is better or worse then them. However, I have used man pages. In some areas, a function or procedure has been documented pretty well, but in others its a PITA to figure things out.

    Don't believe me? See how long it takes you to figure out how to move the mouse in Linux or even get a pixel color on the screen. Not very easy, XLib documentation is very patchy in a lot of ways.

    As for the speed thing, if not speed, what else is there? For the average programmer C++ can do everything that C can and more. There are some changes but most will never notice them. OOP rules.
    The thing is, C is so low level than you can do anything with that you can do with C++, it might just take more code in C. However, you simply have more control over your code in C, which is why I like it.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  15. #15
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    The thing is, C is so low level than you can do anything with that you can do with C++, it might just take more code in C. However, you simply have more control over your code in C, which is why I like it.
    Thats the thing, You can't do anything in C that you can do in C++. Ever tryed to make a constructor/deestructor in C? Give it a whirl with your Class objects. On the other hand, you CAN do anything in C++ that you can do in C, with exactly the same code. You have just as much control over your code with C++ as you do with C.

    C++ might as well be called C with OOP support.

  16. #16
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    i think what wizzup means is how c++ is too safe.

    for a start i think it forces annoying casting onto you,
    i know what windows BYTE* is exactly the same char*, c++ forces you to cast between the two, but c does not, and it makes for much nicer, cleaner and easier programming in some cases.
    Join the Official SRL IRC channel. Learn how to Here.

  17. #17
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by boberman View Post
    Thats the thing, You can't do anything in C that you can do in C++. Ever tryed to make a constructor/deestructor in C? Give it a whirl with your Class objects. On the other hand, you CAN do anything in C++ that you can do in C, with exactly the same code. You have just as much control over your code with C++ as you do with C.

    C++ might as well be called C with OOP support.
    You can also make OOP with C, just not if you want to use actual constructor keywords.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  18. #18
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    You can also make OOP with C, just not if you want to use actual constructor keywords.
    There are no constructor keywords in C. (constructor is the method, not a keyword, used to setup an object, destructor is the method to destroy an object. C has neither. If you us a struct for your objects you have to explicitly create and destroy the object, the object can't take care of that on its own)

  19. #19
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by boberman View Post
    There are no constructor keywords in C. (constructor is the method, not a keyword, used to setup an object, destructor is the method to destroy an object. C has neither. If you us a struct for your objects you have to explicitly create and destroy the object, the object can't take care of that on its own)
    That's what I said.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  20. #20
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    That's what I said.
    I should have said C++. You can't make a constructor for C. (C++ doesn't use keywords per say to make their constructors.)

  21. #21
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by boberman View Post
    I should have said C++. You can't make a constructor for C. (C++ doesn't use keywords per say to make their constructors.)
    Which is why I said

    Quote Originally Posted by Wizzup? View Post
    You can also make OOP with C, just not if you want to use actual constructor keywords.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  22. #22
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Me and my friend have decided to learn C then C++.

    Most people don't like that approach but the heck with it.

    ~ Mathematics.

  23. #23
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Mathematics View Post
    Me and my friend have decided to learn C then C++.

    Most people don't like that approach but the heck with it.

    ~ Mathematics.
    Well, the only reason I would disagree with that approach is that if you end goal is to learn C++, then you are waisting time with C.

    Just make sure you are actually learning C and not a C++/hybrid. The way you tell is this, if you are including <string>, <vector>, <iostream>, <fstream>, <sstream> or anything else that has a stream in it, you are using C++. All of those libraries use objects to make them work better. (What that means is no using cout, string, vector, fstream, ect)

    For C, the libraries are <stdc.h>, <stdioc.h>, ect (I'm a little fuzzy on them as I don't use them very often).

    Basically, you use commands like printf, getf, puts, ect. Just watch out for buffer overflows, it will bit you hard if you aren't careful (just ask microsoft)

  24. #24
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah thanks, well me and my friend are both getting new PC's at Christmas so will start our C journey there.

    At the moment he was no programming experience but is eager to learn, I can do loops, declarations/initializations that type of beginner things.

    Thanks all.

    ~ Mathematics.

  25. #25
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I've been messing around with C# for a while now and the msdn library is quite convinient, except for the fact that in some cases you'll run into a runtime exception which has absolutely no documentation, happens to a shitload of people with a different situation for each of them, making you go backwards and change some aspect of your program to go around it. Happened to me and I was barely able to avoid the straitjacket.

    Maybe a bit off topic but boberman brought it up so...

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Battle of the Scripts
    By FrÕzÑ_§ÕµL in forum News and General
    Replies: 73
    Last Post: 04-04-2008, 02:30 PM
  2. Battle of the Scipts v.2
    By king vash in forum News and General
    Replies: 1
    Last Post: 03-29-2008, 06:51 PM

Posting Permissions

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