Why should I learn C++?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Silent1Mezzo
    New Member
    • Feb 2007
    • 208

    Why should I learn C++?

    So I've been programming for a while now. I'm fairly proficient in C, C# and Java. I know a bunch of scripting languages as well. Is there any reason for me to learn C++? I don't really know anything about the language.

    What type of things is it good for? What can I do with it that I can't do with the others?


    Thanks
  • Savage
    Recognized Expert Top Contributor
    • Feb 2007
    • 1759

    #2
    Originally posted by Silent1Mezzo
    So I've been programming for a while now. I'm fairly proficient in C, C# and Java. I know a bunch of scripting languages as well. Is there any reason for me to learn C++? I don't really know anything about the language.

    What type of things is it good for? What can I do with it that I can't do with the others?


    Thanks
    If u know C then u have a good base for learning C++,C++ is simple said C superset.

    Why should u learn C++?

    U know C# is .NET oriented and C++ is COM oriented.Comput ers can run on .NET but some other scraps from metal can't run it while they can run on COM

    Savage

    Comment

    • AdrianH
      Recognized Expert Top Contributor
      • Feb 2007
      • 1251

      #3
      Originally posted by Savage
      If u know C then u have a good base for learning C++,C++ is simple said C superset.

      Why should u learn C++?

      U know C# is .NET oriented and C++ is COM oriented.Comput ers can run on .NET but some other scraps from metal can't run it while they can run on COM

      Savage
      I thought that C++ can be used with .NET. .NET is just a library after all. I also thought that C# can use COM as well, but may require wrappers.


      Adrian

      Comment

      • AdrianH
        Recognized Expert Top Contributor
        • Feb 2007
        • 1251

        #4
        Originally posted by Silent1Mezzo
        So I've been programming for a while now. I'm fairly proficient in C, C# and Java. I know a bunch of scripting languages as well. Is there any reason for me to learn C++? I don't really know anything about the language.

        What type of things is it good for? What can I do with it that I can't do with the others?


        Thanks
        C++ is similar to C# and Java but has its roots in C. The family tree probably looks something like this:
        Code:
        ---------------
        |   Assembly  |
        |       |     |
        |       C     |
        |       |     |
        |      C++    |
        |      /\     |
        |     /  \    |
        |  Java   \   |
        |     \   /   |
        |      \ /    |
        |       C#    |
        ---------------
        A reason to learn it? Flexibility is one, it also has some interesting features in it that you may find interesting like templates (slightly different from Java ones which came out only farily recently) and algorithms.


        Adrian

        Comment

        • Savage
          Recognized Expert Top Contributor
          • Feb 2007
          • 1759

          #5
          Originally posted by AdrianH
          I thought that C++ can be used with .NET. .NET is just a library after all. I also thought that C# can use COM as well, but may require wrappers.


          Adrian
          Now i'm confused.

          Please take a look at this

          Savage

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            C++ is the only language where "(a+b)/c" *can* mean that a Btree is to be split
            over c more blocks when a chunk b is added to a tree a. Or it *can* mean that
            you've just shot the enemy; or maybe it's just an addition and a division ...

            kind regards,

            Jos

            Comment

            • AdrianH
              Recognized Expert Top Contributor
              • Feb 2007
              • 1251

              #7
              Originally posted by JosAH
              C++ is the only language where "(a+b)/c" *can* mean that a Btree is to be split
              over c more blocks when a chunk b is added to a tree a. Or it *can* mean that
              you've just shot the enemy; or maybe it's just an addition and a division ...

              kind regards,

              Jos
              Hey, if a programmer want to be an idiot and use operator overloading to make code unreadable, that is his/her business (and will be put out of business quite quickly since no one will hire such an idiot).

              Operator overloading has legitimate uses. It should be used sparingly.


              Adrian

              Comment

              • AdrianH
                Recognized Expert Top Contributor
                • Feb 2007
                • 1251

                #8
                Originally posted by Savage
                Now i'm confused.

                Please take a look at this

                Savage
                So what are you confused about?


                Adrian

                Comment

                • Banfa
                  Recognized Expert Expert
                  • Feb 2006
                  • 9067

                  #9
                  Originally posted by AdrianH
                  C++ is similar to C# and Java but has its roots in C. The family tree probably looks something like this:
                  I believe the family tree is more like the image I have attached.

                  Note that modern standard C and C+ are more like siblings than descendents, both have features taken from the other language.
                  Attached Files

                  Comment

                  • Tuanisviet
                    New Member
                    • Jan 2007
                    • 37

                    #10
                    Originally posted by Banfa
                    I believe the family tree is more like the image I have attached.

                    Note that modern standard C and C+ are more like siblings than descendents, both have features taken from the other language.
                    I don't know C++, but isn't one advantage to using C++ is something like memory management or memory allocation? Please collect me if I'm wrong.

                    Comment

                    • AdrianH
                      Recognized Expert Top Contributor
                      • Feb 2007
                      • 1251

                      #11
                      Originally posted by Tuanisviet
                      I don't know C++, but isn't one advantage to using C++ is something like memory management or memory allocation? Please collect me if I'm wrong.
                      It is an advantage and disadvantage. Unfortunatly, there is no memory managment in standard C++. You have to do it yourself, which can be good or bad (but when bad, really bad).


                      Adrian

                      Comment

                      • AdrianH
                        Recognized Expert Top Contributor
                        • Feb 2007
                        • 1251

                        #12
                        Originally posted by Banfa
                        I believe the family tree is more like the image I have attached.

                        Note that modern standard C and C+ are more like siblings than descendents, both have features taken from the other language.
                        Your diagram is better than mine. But I still think that Java came out of C++.

                        As for C and C++ being siblings? Dunno if I agree. C++ was first written as a translator to C (think CFront). Now, C and C++ are fairly different with the newer C99 standard. Though I think that C++ standard will be bringing them in to line.


                        Adrian

                        Comment

                        • JosAH
                          Recognized Expert MVP
                          • Mar 2007
                          • 11453

                          #13
                          Originally posted by AdrianH
                          Your diagram is better than mine. But I still think that Java came out of C++.

                          As for C and C++ being siblings? Dunno if I agree. C++ was first written as a translator to C (think CFront). Now, C and C++ are fairly different with the newer C99 standard. Though I think that C++ standard will be bringing them in to line.


                          Adrian
                          There's no Objective C in that little picture; it's somewhere near C++, also a C
                          descendant. Java has 'borrowed' quite some concepts from Objective C; just like
                          C# 'borrowed' ideas from Java; it's a pity only Apple and a bit of GNU uses it;
                          it's the poor man's SmallTalk using C in a very sensible way.

                          And there's more lacking in that picture: BCPL is a descendant from CPL which
                          in turn used a lot of ideas invented in the Algol (60 and 68) family. Assembly
                          language isn't a direct predecessor from BCPL, nor Algol; and then there's Lisp,
                          the assembly language for Artificial Intelligence. ;-)

                          kind regards,

                          Jos

                          Comment

                          • Banfa
                            Recognized Expert Expert
                            • Feb 2006
                            • 9067

                            #14
                            Originally posted by JosAH
                            BCPL is a descendant from CPL
                            damn, new I'd missed something, although as it turns out I'd missed somethings.

                            In many ways no language descends from assembler, it was what was there, languages came about because assembler is not terribly easy to use, and of course has no cross platform portability.

                            Comment

                            • Banfa
                              Recognized Expert Expert
                              • Feb 2006
                              • 9067

                              #15
                              Originally posted by AdrianH
                              As for C and C++ being siblings? Dunno if I agree. C++ was first written as a translator to C (think CFront). Now, C and C++ are fairly different with the newer C99 standard. Though I think that C++ standard will be bringing them in to line.
                              I am sure that C++ chronologically came 2nd and I am aware that the first C++ compilers were actually translators to C.

                              However the diagram is meant to show how languages relate to each other intellectually (i.e. the ideas from which ones influenced which other ones) and from this point of view it is impossible to say Standard C++ descended from Standard C or the other way around, there has been quite a lot of interchange of ideas.

                              Comment

                              Working...