1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development Java vs C++

Discussion in 'Software' started by DoNuT, 29 Dec 2004.

  1. DoNuT

    DoNuT What's a Dremel?

    Joined:
    20 Dec 2004
    Posts:
    165
    Likes Received:
    0
    i'm looking into software engineering for a college major, and i was wondering what the difference between Java and C++. Whats better? Are there advantages? Is one here to stay, and the other leaving? Also what is a good site to teach me the basics for Java.
     
  2. Tizz0r

    Tizz0r What's a Dremel?

    Joined:
    26 Jul 2004
    Posts:
    29
    Likes Received:
    0
    Which is better all depends on what you want to do. Java is probably the best for portability making is great for business apps and other apps. It will run on most systems that have a Java Virtual Machine with out a whole lot of modification to the source code of your program. C/C++ on the other hand is great for it's power over the system and speed at which it runs. You can write just about anything you want in C/C++ as well. There are pros and cons to both languages.

    I don't see Java going anywhere any time soon, it should be around for some time. C has already been around for 30+ years, and C++ has been around for about 20+ years. Either one is a good language, but like I said it depends on what you are doing with the language.

    As for a site, I've no clue, I'm a C/C++ person. Try google, or maybe some one else will know of one.
     
  3. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    java.sun.com

    Java uses a virtual machine, this means that the code has to be interpreted as its running, with java it uses a JIT (just in time) method.

    which means if you have something like

    repeat 10,000,000 times {

    ..... really complex algorytgm

    }

    the first time this code is run, the realy complex algorythm will be converted into the machine code for the type of computer its running on. This is really quite a light overhead as now its JIT'd once, it need not be again.

    this way you don't have a long wait on load time, because its only converted as its needed. and the other 9million+ times the code is run, its already been converted.
     
  4. John Cena

    John Cena What's a Dremel?

    Joined:
    1 Jun 2004
    Posts:
    818
    Likes Received:
    0
    Adavtanges of Java compared to C++:
    Portability between Operating Systems
    Runs in a Security "Sand Box" so it cannot do any damage like C++ programs can.

    Advantages of C++ compared to Java:
    C++ is WAY and I mean WAYYYYYY faster than Java even with the Just-In Compiler.
    C++ can run on Windows, however for Java to run on windows, you need the java run time environment.
    C++ is click and run. With java, you have to have a batch script file or something else to execute the program.
    C++ has MORE control like pointers and can acess the file system without restrictions like Java has. C++ can directly edit whats loaded into the Ram also.
    Java is VERY slow because it's interpreted. However, with the Just-In compiler, you can increase the performance however it will be nowhere near C++ programs performance.


    My opinion on C++ and C:
    They will be extinct by 2020. The new technologies are .Net technologies. C# Sharp.
     
  5. JADS

    JADS Et arma et verba vulnerant

    Joined:
    27 Mar 2001
    Posts:
    2,918
    Likes Received:
    1
    C++ is essentially C hacked into OO, and as such it isn't very clean. You'll find lots of interesting nasties when programming OO in C++.

    Java was written from the ground up to be an OO programming language, so you can actually write pure OO.
     
  6. John Cena

    John Cena What's a Dremel?

    Joined:
    1 Jun 2004
    Posts:
    818
    Likes Received:
    0
    If your comparing java, it is best to compare it against C Sharp not C++.

    C Sharp was made to compete with Java.
     
  7. the harlequin

    the harlequin What's a Dremel?

    Joined:
    31 Oct 2004
    Posts:
    41
    Likes Received:
    0
    Here are a few sites that may be of some use.

    http://java.sun.com/j2se/1.4/docs/api/
    The latest version of the java APIs (used to look up built in functions in java libraries)

    http://www.acm.uiuc.edu/webmonkeys/book/c_guide/index.html
    A C libraries index (not extensive as I feel it could be, but a good starting point)

    http://www.desy.de/gna/html/cc/Tutorial/tutorial.html
    C++ OOP introduction

    I'm a 2nd year computer science student, going on to 3rd year in 2005. We learnt programming using java, and migrated to C in 2nd year. I think that in 3rd year we get taught C++. Personally I like C, I feel as if I have more control over what's happening (e.g. memory management, C you need to allocate/deallocate memory, in java you just declaire a new variable). There are advantages and disadvantages (e.g. in C++ you can get polymorphism (where you can inherit mulitple objects) where as in java you can only inherit one object).
     
  8. johan

    johan What's a Dremel?

    Joined:
    29 Dec 2004
    Posts:
    69
    Likes Received:
    0
    In my experience it's a much better idea to start out coding with Java. It doesn't need to be much slower than C++ and can be compiled to native code. Speed is relative anyways and most of the slow code is due to crappy programmers.

    So some pros for Java imo:

    + Small language and therefore easy to learn.
    + Platform independent interface toolkits.
    + Fast compared to a lot of other languages.
    + Huge API with most of the functionality you'll ever need.

    Bottom line is that C++ is a huge (and admittedly powerful) language that is difficult to master and I wouldn't recommend it to anyone learning to program. Stick to Java and you'll turn out a much better programmer in the end (even if you end up coding in C++).

    .johan
     
  9. polus

    polus What's a Dremel?

    Joined:
    7 Aug 2004
    Posts:
    118
    Likes Received:
    0
    Hmm somehow I dont think so. Maybe I would think this aswell if i just worked developing code with VS.NET but as I also deal with development on Unix and embedded platforms I just cant see it happening.

    If I was starting out I would learn C then C++.
     
  10. alcedes

    alcedes What's a Dremel?

    Joined:
    1 Jan 2005
    Posts:
    121
    Likes Received:
    0
    .Net Developer Here! I try to exclusively use C# but I agree with you. C is still the lowest level language that you can get without embracing assembler and is still the best choice for some driver development and developing code that must be optimized. During the rare moments when I implement graphics algorithms I still drop back to C and some raw memory manipulation.

    For now C# still seems to be a language for developing for microsoft OS's ( though you should see http://mono-project.com <- if you want to play with .Net/C# on a non-MS platform). BTW: Development for the foundation code for .Net was done in C.
     
  11. 731|\|37

    731|\|37 ESD Engineer in Training

    Joined:
    5 Sep 2004
    Posts:
    1,047
    Likes Received:
    0
    << Java guy

    umm contrary to prior post i believe Java does support polymorphism (but i could be wrong)


    Java is really cool, hell im learning it and im 15 so it cant be that hard..

    Java is actualy based on C/C++ so im sure deep down it cant be that diferrient

    no memory managment required
    automatic garbage collection (part of the mem managment section)
    an absolutly MASIVE API that has just about anything youd ever want to do with it
    can (and does) run on just about anything but DOS


    Hey dont count me for a whole lot because im still fairly new to java but I am writing (or at least trying anyway) a telnet client, with my mediocer knowledge
     
  12. DeX

    DeX Mube Codder

    Joined:
    22 Jul 2002
    Posts:
    4,152
    Likes Received:
    3
    Java does support polymorphism. Well at least I think it does. My idea of polymorphism is the ability to write procedures (functions/methods) that have the same name but different arguments. Java doesn't support multiple inheritance but I think this is probably because it goes against the general->specific idea of object inheritence.

    I were about to start a computer course I would first find out what the course uses as the primary language. Most courses tend to start with java as it's generally simpler to pickup. I find that C++ is quite hard to get into especially as there are so many different compilers and platforms and libraries. Still whichever language you choose to learn it will definately make your course easier. I know people in the first year of my course who had never done any programming in their life and who just couldn't grasp the concepts. My background knowlege has certainly helped me so far.
     
  13. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    I found the same thing. Some people just *don't* get it.
     
  14. Guest-2867

    Guest-2867 Guest

    I spent the whole of my AS/A2 computing course babysitting people who thought they were 'computer literate' because they could surf the net and use msn messenger
    :eyebrow:

    'tis one of the many disadvantages of going into a 'no experience required' course
     

Share This Page