Java better than C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • r035198x
    MVP
    • Sep 2006
    • 13225

    Java better than C++

    OK shoot me, but with the latest additions to java most of the claimed advantages of C++ over java have disappeared and I now wait to get one clear non-arguable advantage of C++ over Java for the software developer.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    See also my entry in this forum's thread Best programming language.

    This dicussion is the same as: why is Ford better then GM?
    People tend to stick to what they have learned and have coming to like. And if you learned all in's and out's of C++, you usually stick with it until you need something that isn't posisble in C++, only then you will look for a better language. Or maybe curiosity. But usually not on objective, measureable, grounds.

    So your statement may be true for you, it maybe not for someone else.

    Ronald :cool:

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by ronverdonk
      See also my entry in this forum's thread Best programming language.

      This dicussion is the same as: why is Ford better then GM?
      People tend to stick to what they have learned and have coming to like. And if you learned all in's and out's of C++, you usually stick with it until you need something that isn't posisble in C++, only then you will look for a better language. Or maybe curiosity. But usually not on objective, measureable, grounds.

      So your statement may be true for you, it maybe not for someone else.

      Ronald :cool:
      While it is generally true that one prefers what one already knows, for true comparisons this should not be an issue. Just because I've spent more time coding in c than I have in Java should not be something I use to compare the two languages.
      Instead we should look at
      garbage collection effort, platform dependance, speed, areas of application, paradigm support etc.
      It does not matter how many times I have written a destructor in c++, the Java gc is much better for me the programmer and similar arguments...

      Comment

      • Starasoris
        New Member
        • Oct 2006
        • 11

        #4
        Although Java is more portable across environments, if I had to write some quick and dirty and small program to update something on someones system, it would be in C++.

        The only thing that scares me about Java is the reliance on the RTE and library stuff. I also have more of a feeling of what is happening with C++ and what will be slow or fast.

        Other than that, I think Java should be encouraged so that it can be ported strait to Linux or vise versa.

        Hmm, I Suppose that I really should take another look at it.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by Starasoris
          Although Java is more portable across environments, if I had to write some quick and dirty and small program to update something on someones system, it would be in C++.

          The only thing that scares me about Java is the reliance on the RTE and library stuff. I also have more of a feeling of what is happening with C++ and what will be slow or fast.

          Other than that, I think Java should be encouraged so that it can be ported strait to Linux or vise versa.

          Hmm, I Suppose that I really should take another look at it.
          Certainly when correct programming is done,
          c++ will be faster than java and c++ will
          get you closer to the memory.
          My argument is these days speed of a programming laguage
          is no longer an issue and getting better
          control of memory is also not neccessary
          owing to the increasing speed of processors

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            Originally posted by r035198x
            My argument is these days speed of a programming laguage
            is no longer an issue and getting better
            control of memory is also not neccessary
            owing to the increasing speed of processors
            Then that must be the platform you work on. When you have a ~200MHz processor and you are trying to stream several megabits/second of data through it then speed of your language and the efficiency with which the compiler converts it to efficent machine code are still big considerations.

            And on GC in a embedded application when memory is normally an extremely tight resource then a GC just does not provide enough control of memory allocation/deallocation.

            Don't get me wrong, Java is good at what it does and has lots of plus points. It just is not suited to all platforms and to be honest would really expect any 1 language to ever achieve that?

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by Banfa
              Then that must be the platform you work on. When you have a ~200MHz processor and you are trying to stream several megabits/second of data through it then speed of your language and the efficiency with which the compiler converts it to efficent machine code are still big considerations.

              And on GC in a embedded application when memory is normally an extremely tight resource then a GC just does not provide enough control of memory allocation/deallocation.

              Don't get me wrong, Java is good at what it does and has lots of plus points. It just is not suited to all platforms and to be honest would really expect any 1 language to ever achieve that?
              You are right. How we all wish there was just one platform where everything runs on! But to be more honest, which language do you think suits more platforms than other languages?

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by r035198x
                You are right. How we all wish there was just one platform where everything runs on! But to be more honest, which language do you think suits more platforms than other languages?
                Since wxWidgets got wrapped for Python, this language (often overlooked on this forum for some reason) now looks native on all platforms supported by wxWidgets. Has GC and is actually readable by a mere human.

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  which language do you think suits more platforms than other languages?
                  Assembly. As portable as C and runs anywhere, at least on the same processor. Syntax is pretty much the same no matter what assembler you use and there are few abstractions or ambiguities.

                  Comment

                  • bartonc
                    Recognized Expert Expert
                    • Sep 2006
                    • 6478

                    #10
                    Originally posted by drhowarddrfine
                    Assembly. As portable as C and runs anywhere, at least on the same processor. Syntax is pretty much the same no matter what assembler you use and there are few abstractions or ambiguities.
                    Yep. I began my illustrious (ha-ha) carrer writing in assembler (moto style) and still enjoy thinking like a compiler (as an intelectual challange). But seriously, abstaction is what good languages do well, is it not?

                    Comment

                    • drhowarddrfine
                      Recognized Expert Expert
                      • Sep 2006
                      • 7434

                      #11
                      That's right and it can be helpful but it adds to the confusion. I started out in hardware so assembly was the only thing. Actually, coding in hex. I do the same as you. I visualize pointers in C as the actual register pointing at a memory address. When code starts 'dereferencing objects' I get a little crazy.

                      Comment

                      • sashi
                        Recognized Expert Top Contributor
                        • Jun 2006
                        • 1749

                        #12
                        Originally posted by r035198x
                        OK shoot me, but with the latest additions to java most of the claimed advantages of C++ over java have disappeared and I now wait to get one clear non-arguable advantage of C++ over Java for the software developer.
                        Hi everyone,

                        Java? C++? which one? I prefer to use C++ as it enables pointers, pointers can be very handy. Some of my friends even claim that Java is the mother of C++? Any review on that? Good luck & Take care.

                        Comment

                        • drhowarddrfine
                          Recognized Expert Expert
                          • Sep 2006
                          • 7434

                          #13
                          Some of my friends even claim that Java is the mother of C++? Any review on that?
                          They may be talking about the OOP part of C++ but C is the mother of C++. Bjarne Stroustrup worked at Bell Labs with K&R and never worked at Sun.

                          In fact, Bjarne himself says Java inherited C++ features. Bjarne Stroustrup

                          Comment

                          • ronverdonk
                            Recognized Expert Specialist
                            • Jul 2006
                            • 4259

                            #14
                            Originally posted by drhowarddrfine
                            That's right and it can be helpful but it adds to the confusion. I started out in hardware so assembly was the only thing. Actually, coding in hex. I do the same as you. I visualize pointers in C as the actual register pointing at a memory address. When code starts 'dereferencing objects' I get a little crazy.
                            Those we the days! I think C and embedded assembler is still the way to do it, best of both worlds. At least you have some feeling for the computer and its inner workings. OOP and Windows spoiled all that, it's like assembling Lego bricks now.

                            Ronald :cool:

                            Comment

                            • MMcCarthy
                              Recognized Expert MVP
                              • Aug 2006
                              • 14387

                              #15
                              Originally posted by ronverdonk
                              Those we the days! I think C and embedded assembler is still the way to do it, best of both worlds. At least you have some feeling for the computer and its inner workings. OOP and Windows spoiled all that, it's like assembling Lego bricks now.

                              Ronald :cool:
                              Since I've never used either language commercially I won't comment on preformance of C++ vs. Java.

                              One point I would like to make is C is the first language I ever learned and I believe sometimes that all programmers should have to learn it as a rule. The basic understanding of C provides a progammer with an understanding of the rules of programming that is just not provided in my experience with instruction in C++ or Java.

                              I remember in college a student asked the Java lecturer if a method was like a function. To which she replied, there are no such things as functions in OO programming.

                              What do you think?

                              Mary

                              Comment

                              Working...