Why should I learn C++?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #16
    Here are some old notes I've had lying around for a while:
    there is very little reason to switch from straight C to C++ without virtual functions. Without virtual functions, C++ wouldn't be object-oriented. virtual functions are still at the heart of object-oriented programming using C++.
    Also, the creator of C++, Bjarne Stroupe, says C++ is not a superset of C and shouldn't be thought of as such. I'll have to look for that.
    assembler is not terribly easy to use, and of course has no cross platform portability.
    Everything should be done in assembly.

    Comment

    • AdrianH
      Recognized Expert Top Contributor
      • Feb 2007
      • 1251

      #17
      Originally posted by drhowarddrfine
      Here are some old notes I've had lying around for a while:

      Also, the creator of C++, Bjarne Stroupe, says C++ is not a superset of C and shouldn't be thought of as such. I'll have to look for that.
      Yeah, yeah, and humans aren't related to apes. C++ has so many linguistic similarities to C, that it is fairly easy to see that they are related. Superset or not, C++ took a lot from C.


      Originally posted by drhowarddrfine
      Everything should be done in assembly.
      I think we have had this discussion... ;)


      Adrian

      Comment

      • AdrianH
        Recognized Expert Top Contributor
        • Feb 2007
        • 1251

        #18
        Originally posted by Banfa
        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.
        Maybe there is something to be said for the intellectual influence, but I think that even then, I still think that originally, C++ took from C (and possibly others) and later on, it may have also swung the other way.


        Adrian

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #19
          I guess I misremember. From Bjarne's site and FAQ:
          C++ is a direct descendant of C that retains almost all of C as a subset.
          Elsewhere he said C++ was originally known as "C with classes".

          But he also says this when asked if C is a subset of C++:
          In the strict mathematical sense, C isn't a subset of C++. There are programs that are valid C but not valid C++ and even a few ways of writing code that has a different meaning in C and C++. However, C++ supports every programming technique supported by C. Every C program can be written in essentially the same way in C++ with the same run-time and space efficiency.

          Thus, C++ is as much a superset of ANSI C as ANSI C is a superset of K&R C and much as ISO C++ is a superset of C++ as it existed in 1985.

          Except for a few examples ... C++ is a superset of C.
          Here is his answer to the question, "Should I learn C before I learn C++?".
          Knowing C is a prerequisite for learning C++, right?
          Wrong. The common subset of C and C++ is easier to learn than C. There will be less type errors to catch manually (the C++ type system is stricter and more expressive), fewer tricks to learn (C++ allows you to express more things without circumlocution) , and better libraries available. The best initial subset of C++ to learn is not "all of C".

          Comment

          • Savage
            Recognized Expert Top Contributor
            • Feb 2007
            • 1759

            #20
            Originally posted by AdrianH
            So what are you confused about?


            Adrian
            This two posts confuse me:

            Originally posted by JosAH
            Don't forget that lots of industries use fault tolerant, mission critical and often
            real time systems. None of them are PCs, no matter the OS installed on them.

            All that other metal doesn't run .NET; they do run C or C++ though. You don't
            want managed code when you just have a few micro seconds (or less) to
            respond to some external signal reliably according to an SLA.

            The two are just disjunct different worlds and IMHO it will take a long long time
            before the twain shall meet.

            kind regards,

            Jos
            and
            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
            Savage

            Comment

            • AdrianH
              Recognized Expert Top Contributor
              • Feb 2007
              • 1251

              #21
              Originally posted by Savage
              Originally posted by AdrianH
              So what are you confused about?


              Adrian
              This two posts confuse me:

              Originally posted by JosAH
              Don't forget that lots of industries use fault tolerant, mission critical and often
              real time systems. None of them are PCs, no matter the OS installed on them.

              All that other metal doesn't run .NET; they do run C or C++ though. You don't
              want managed code when you just have a few micro seconds (or less) to
              respond to some external signal reliably according to an SLA.

              The two are just disjunct different worlds and IMHO it will take a long long time
              before the twain shall meet.

              kind regards,

              Jos
              and
              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
              Savage
              How do they confuse you? Are you confused about .NET being a library framework? Are you confused that C++ and C# can both use .NET? Are you confused about C# not being used in realtime embedded systems (yet)?

              What are you confused about?


              Adrian

              Comment

              • Savage
                Recognized Expert Top Contributor
                • Feb 2007
                • 1759

                #22
                Originally posted by AdrianH
                Are you confused about C# not being used in realtime embedded systems (yet)?
                This is what cofuses me.

                Look at this part:

                Originally posted by JosAH
                None of them are PCs, no matter the OS installed on them.

                All that other metal doesn't run .NET; they do run C or C++ though
                Which means that C# is only .NET oriented and C or C++ COM oriented.

                Savage

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #23
                  Originally posted by Savage
                  This is what cofuses me.

                  Look at this part:



                  Which means that C# is only .NET oriented and C or C++ COM oriented.

                  Savage
                  There's are different types of computers than PCs or Macs; those other
                  machines know nothing about .NET or COM or whatever Microsoftism.
                  C++ and C run fine in those other environments; C# doesn't even exist there.

                  kind regards,

                  Jos

                  Comment

                  • Savage
                    Recognized Expert Top Contributor
                    • Feb 2007
                    • 1759

                    #24
                    Originally posted by JosAH
                    There's are different types of computers than PCs or Macs; those other
                    machines know nothing about .NET or COM or whatever Microsoftism.
                    C++ and C run fine in those other environments; C# doesn't even exist there.

                    kind regards,

                    Jos
                    Aha,thanks Jos!

                    Savage

                    Comment

                    • hallowelt
                      New Member
                      • Jun 2007
                      • 2

                      #25
                      Hi Silent1Mezzo,
                      not that i could help you to answer if you should learn c++.
                      This was the original question wasn´t it ? Have you found out during this thread ?

                      Comment

                      • AdrianH
                        Recognized Expert Top Contributor
                        • Feb 2007
                        • 1251

                        #26
                        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.
                        BTW, Banfa, what did you use to generate the graphs? The dot language? Or something else?


                        Adrian

                        Comment

                        • weaknessforcats
                          Recognized Expert Expert
                          • Mar 2007
                          • 9214

                          #27
                          Originally posted by JosAH
                          There's are different types of computers than PCs or Macs; those other
                          machines know nothing about .NET or COM or whatever Microsoftism.
                          C++ and C run fine in those other environments; C# doesn't even exist there.
                          You just said it: No C# on those machines.

                          You are aware, I hope, that the MSIL language used by the Microsoft CLR to interpret C# code is public domain? That means all you need do is write your own CLR for one of those other machines and BOOM! all existing Microsoft .NET code will execute.

                          Microsoft will not write those CLRs due to monopoly issues. But you can. And that would be the foundation of a real business.

                          Comment

                          • Banfa
                            Recognized Expert Expert
                            • Feb 2006
                            • 9067

                            #28
                            Originally posted by AdrianH
                            BTW, Banfa, what did you use to generate the graphs? The dot language? Or something else?
                            Paint initially, then when the image proved to be too large I used The GIMP to edit it (I think).

                            Those are the 2 graphics packages I use, both free. The only thing I have against The GIMP is it really is for manipulating images that already exist, if you wanted to create a new image and draw a circle on it that would be quite hard in The GIMP, very good apart from that.

                            Comment

                            • Banfa
                              Recognized Expert Expert
                              • Feb 2006
                              • 9067

                              #29
                              Originally posted by weaknessforcats
                              You are aware, I hope, that the MSIL language used by the Microsoft CLR to interpret C# code is public domain? That means all you need do is write your own CLR for one of those other machines and BOOM! all existing Microsoft .NET code will execute.
                              Why on earth would anyone want to muddy up a nice clean embedded environment by writing a .NET interpreter for it.

                              Actually I realise that what Jos references includes a whole raft of platforms that are not embedded but all the same, I am sure they are all running very nicely with and MS garbage muddying the waters. Why would you want to cripple a system by introducing MS bloat code.

                              Comment

                              • AdrianH
                                Recognized Expert Top Contributor
                                • Feb 2007
                                • 1251

                                #30
                                Originally posted by Banfa
                                Paint initially, then when the image proved to be too large I used The GIMP to edit it (I think).

                                Those are the 2 graphics packages I use, both free. The only thing I have against The GIMP is it really is for manipulating images that already exist, if you wanted to create a new image and draw a circle on it that would be quite hard in The GIMP, very good apart from that.
                                I use GIMP. Don't find that very difficult drawing a circle or making a new image. I like the layering stuff you can do with it (that is how I generated my Avatar). Unfortunately, you cannot manipulate it using vectors, though I've not played with the line drawing stuff in it.

                                I also use paint when I don't want or need overkill. And then I use ASCII art when I feel that graphics are overkill. ;)


                                Adrian

                                Comment

                                Working...