c++ for python programmers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Nelson

    c++ for python programmers

    I realize I'm approaching this backwards from the direction most
    people go, but does anyone know of a good c/c++ introduction for
    python programmers?

    Thanks,

    Thomas

  • =?ISO-8859-1?Q?Ma=EBl_Benjamin_Mettler?=

    #2
    Re: c++ for python programmers

    SAMS "Teach yourself C in 21 days" by Bradley L. Jones and Peter Aitken

    Learning C++ is not worth is in my opinion, since you can get the OOP
    power from Python and use C if you need speed...

    Thomas Nelson schrieb:
    I realize I'm approaching this backwards from the direction most
    people go, but does anyone know of a good c/c++ introduction for
    python programmers?
    >
    Thanks,
    >
    Thomas
    >

    Comment

    • sjdevnull@yahoo.com

      #3
      Re: c++ for python programmers

      Thomas Nelson wrote:
      I realize I'm approaching this backwards from the direction most
      people go, but does anyone know of a good c/c++ introduction for
      python programmers?
      I would stick with C unless you need to edit C++ code. (Calling them
      C/C++ doesn't make much sense as they're separate languages).

      The biggest sticking points aren't going to be helped much by a Python
      background, so I'd just use one of the tutorials recommended over in
      comp.lang.c (Richard Heathfield had a useful link at one point).

      Comment

      • andrew clarke

        #4
        Re: c++ for python programmers

        On Mon, Feb 12, 2007 at 10:00:51AM -0800, Thomas Nelson wrote:
        I realize I'm approaching this backwards from the direction most
        people go, but does anyone know of a good c/c++ introduction for
        python programmers?
        Thomas, I sent you a message off-list but it bounced due to your mailbox
        being full.

        Short answer: Subscribe to the c-prog@yahoogroup s.com mailing list and
        ask your C/C++ questions there.

        Regards
        Andrew

        Comment

        • Thomas Nelson

          #5
          Re: c++ for python programmers

          On Feb 12, 1:35 pm, andrew clarke <mail@ozzmosis. comwrote:
          Thomas, I sent you a message off-list but it bounced due to your mailbox
          being full.
          >
          Short answer: Subscribe to the c-prog@yahoogroup s.com mailing list and
          ask your C/C++ questions there.
          >
          Regards
          Andrew
          I have to edit a large C++ project written by someone else. My email
          address
          above is incorrect; replace mail with cs. Thanks for the help.

          Thomas

          Comment

          • Andy Terrel

            #6
            Re: c++ for python programmers

            On Feb 12, 4:11 pm, "Thomas Nelson" <t...@mail.utex as.eduwrote:
            On Feb 12, 1:35 pm, andrew clarke <m...@ozzmosis. comwrote:
            >
            Thomas, I sent you a message off-list but it bounced due to your mailbox
            being full.
            >
            Short answer: Subscribe to the c-p...@yahoogroup s.com mailing list and
            ask your C/C++ questions there.
            >
            Regards
            Andrew
            >
            I have to edit a large C++ project written by someone else. My email
            address
            above is incorrect; replace mail with cs. Thanks for the help.
            >
            Thomas
            To learn C I recommend K&R (Kernigahn and Richie), for C++ I like
            Savitch's book, Absolute C++. I too learned python then c/c++. Also I
            would disagree with the people saying never to use C++, it will run
            much faster for computationally intensive programs. It will make you
            a better python programmer, you get to see how things are done "under
            the hood".

            Comment

            • Nicola Musatti

              #7
              Re: c++ for python programmers

              On Feb 12, 7:00 pm, "Thomas Nelson" <t...@mail.utex as.eduwrote:
              I realize I'm approaching this backwards from the direction most
              people go, but does anyone know of a good c/c++ introduction for
              python programmers?
              I don't think there's any book catering specifically for people coming
              from dynamically typed languages. If you want a crash course try
              "Accelerate d C++", by Koenig & Moo; if you want something more gentle,
              that may also serve as a reference, go for "C++ Primer", by Lippman,
              Lajoie & Moo. Both books from Addison Wesley.

              As for something freely available people speak well of Bruce Eckel's
              "Thinking in C++", but I haven't read it: http://www.mindview.net/
              Books/TICPP/ThinkingInCPP2e .html

              Cheers,
              Nicola Musatti


              Comment

              • Neil Cerutti

                #8
                Re: c++ for python programmers

                On 2007-02-12, Thomas Nelson <thn@mail.utexa s.eduwrote:
                I realize I'm approaching this backwards from the direction
                most people go, but does anyone know of a good c/c++
                introduction for python programmers?
                To become productive in C++ in a short time, especially with a
                Python background, I highly recommend Koenig & Moo _Accelerated
                C++_.

                It's not enough C++ to join a C++ team at a professional
                development house (of course no book can provide that), but it's
                all the best bits.

                If you get through that, then proceed directly to the source,
                Stroustrup _The C++ Programming language_.

                --
                Neil Cerutti
                You only get a once-in-a-lifetime opportunity so many times. --Ike Taylor

                Comment

                • Jorgen Grahn

                  #9
                  Re: c++ for python programmers

                  On Tue, 13 Feb 2007 06:35:36 +1100, andrew clarke <mail@ozzmosis. comwrote:
                  On Mon, Feb 12, 2007 at 10:00:51AM -0800, Thomas Nelson wrote:
                  >
                  >I realize I'm approaching this backwards from the direction most
                  >people go, but does anyone know of a good c/c++ introduction for
                  >python programmers?
                  >
                  Thomas, I sent you a message off-list but it bounced due to your mailbox
                  being full.
                  >
                  Short answer: Subscribe to the c-prog@yahoogroup s.com mailing list and
                  ask your C/C++ questions there.
                  Why on earth should he do that, seeing that he seems to post here over
                  Usenet? There are plenty of Usenet groups for both languages. For C++, there
                  are comp.lang.c++ and comp.lang.c++.m oderated. Reading the second one has
                  been both useful and enjoyable for me.

                  And to echo what someone else wrote: please don't use the term "C/C++". It
                  makes about the same sense as "Perl/Python" (or "Python/Perl").

                  /Jorgen

                  --
                  // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
                  \X/ snipabacken.dyn dns.org R'lyeh wgah'nagl fhtagn!

                  Comment

                  • Jorgen Grahn

                    #10
                    Re: c++ for python programmers

                    On Mon, 12 Feb 2007 19:10:02 +0100, Maƫl Benjamin Mettler <mbm@mediamonge r.chwrote:
                    Thomas Nelson schrieb:
                    [top posting fixed]
                    >I realize I'm approaching this backwards from the direction most
                    >people go, but does anyone know of a good c/c++ introduction for
                    >python programmers?
                    Learning C++ is not worth is in my opinion, since you can get the OOP
                    power from Python and use C if you need speed...
                    Well, C++ is a better language than C in many ways. So, if he needs to learn
                    one of them, why does it have to be C?

                    Another reason some people choose C++ over Python for some tasks is that
                    they feel that larger programs benefit from strong, static type checking.
                    I like both ways, but depending on the task, one or the other is better.

                    And then there's always the "my boss told me" reason, which seems to apply
                    to the OP.

                    /Jorgen

                    --
                    // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
                    \X/ snipabacken.dyn dns.org R'lyeh wgah'nagl fhtagn!

                    Comment

                    • Sam

                      #11
                      Re: c++ for python programmers

                      On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
                      <grahn+nntp@sni pabacken.dyndns .orgwrote:
                      Well, C++ is a better language than C in many ways. So, if he needs to learn
                      one of them, why does it have to be C?
                      >
                      Another reason some people choose C++ over Python for some tasks is that
                      they feel that larger programs benefit from strong, static type checking.
                      I like both ways, but depending on the task, one or the other is better.
                      C++ is -not- strongly typed. You can cast anything to void *, and
                      manipulate it in ways unimaginable. Plus there's the whole mess that
                      is pointer arithmetic and a weak typesystem...

                      Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and wholly
                      believe that if you want proper strong, static type checking, use
                      Haskell, or if you want proper, complete object-orientation (C++'s
                      primitive types compromise its object system's integrity, and I
                      believe I've already discussed casting and pointers), use Python, and
                      if you want under-the-hood pointer-fu, use C.

                      --Sam

                      Comment

                      • Anders Arnholm

                        #12
                        Re: c++ for python programmers

                        Sam <free.condiment s@gmail.comskri ver:
                        On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
                        ><grahn+nntp@sn ipabacken.dyndn s.orgwrote:
                        >Well, C++ is a better language than C in many ways. So, if he needs to learn
                        >one of them, why does it have to be C?
                        >>
                        >Another reason some people choose C++ over Python for some tasks is that
                        >they feel that larger programs benefit from strong, static type checking.
                        >I like both ways, but depending on the task, one or the other is better.
                        >
                        C++ is -not- strongly typed. You can cast anything to void *, and
                        manipulate it in ways unimaginable. Plus there's the whole mess that
                        is pointer arithmetic and a weak typesystem...

                        C++ can be both, The type systenm is as fragila as you like it to be.
                        I mainlty use c++ when i the need stronger typing that Python och C
                        can't give me. In some ways it's even stronger types than languanges
                        as Java and ObjectiveC. C++ it however at least four different
                        languanges, in one ball of soupe.

                        And yes you can do it, that doesn't mean you have to dio it. As
                        _functions in python or __, you can use them from anyware, you don't
                        have to.

                        / Balp


                        --
                        http://anders.arnholm.nu/ Keep on Balping

                        Comment

                        • Nicola Musatti

                          #13
                          Re: c++ for python programmers

                          On Feb 14, 12:26 am, Sam <free.condime.. .@gmail.comwrot e:
                          [...]
                          C++ is -not- strongly typed. You can cast anything to void *, and
                          manipulate it in ways unimaginable. Plus there's the whole mess that
                          is pointer arithmetic and a weak typesystem...
                          The previous poster wrote "strongly typed", not "a straight jacket".
                          The fact that you may do certain things doesn't mean that you have to
                          nor that they are going to be done to you against your will.
                          Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and wholly
                          believe that if you want proper strong, static type checking, use
                          Haskell, or if you want proper, complete object-orientation (C++'s
                          primitive types compromise its object system's integrity, and I
                          believe I've already discussed casting and pointers), use Python, and
                          if you want under-the-hood pointer-fu, use C.
                          The trouble is that in addition to proper, strong, static type
                          checking people often also want their daily bread, fancy that. As to
                          the merits of complete object orientation, I'd like to hear about
                          them, because nobody managed to explain them to me in a satisfactory
                          way yet.

                          There are many valid reasons to dislike C++ and to prefer Python to
                          it, but dismissing it as "C++ Is Evil" is just plain stupid. Moreover,
                          C might be a valid competitor for small projects and it probably
                          covers most Pythonistas' needs for "closeness to the metal", but it
                          just doesn't scale.

                          Cheers,
                          Nicola Musatti

                          Comment

                          • jkn

                            #14
                            Re: c++ for python programmers

                            Hi Thomas

                            On Feb 12, 6:00 pm, "Thomas Nelson" <t...@mail.utex as.eduwrote:
                            I realize I'm approaching this backwards from the direction most
                            people go, but does anyone know of a good c/c++ introduction for
                            python programmers?
                            >
                            They are not particularly aimed at Python programmers, but Bruce
                            Eckel's "Thinking in C++" books are (a) excellent, and (b) freely
                            downloadable, as well as purchasable in book form:



                            Bruce is a python fan FWIW ;-)

                            HTH
                            Jon N

                            Comment

                            • Neil Cerutti

                              #15
                              Re: c++ for python programmers

                              On 2007-02-13, Sam <free.condiment s@gmail.comwrot e:
                              On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn
                              ><grahn+nntp@sn ipabacken.dyndn s.orgwrote:
                              >Well, C++ is a better language than C in many ways. So, if he
                              >needs to learn one of them, why does it have to be C?
                              >>
                              >Another reason some people choose C++ over Python for some
                              >tasks is that they feel that larger programs benefit from
                              >strong, static type checking. I like both ways, but depending
                              >on the task, one or the other is better.
                              >
                              C++ is -not- strongly typed. You can cast anything to void *,
                              and manipulate it in ways unimaginable. Plus there's the whole
                              mess that is pointer arithmetic and a weak typesystem...
                              Don't forget the lack of standard garbage collection.

                              Also there's the hell known as exception safety.

                              Python conceptually has many of the same issues with exception
                              safety, but at least memory leaks aren't one of the consequences.
                              I imagine most Python programmers don't even think about
                              exception safety, but probably should be. We just happily raise
                              exceptions willy-nilly, without worrying about our objects
                              remaining in a reasonable state. Or do we? Maybe it's better not
                              to think about it. ;-)
                              Disclaimer: I am unashamedly in the "C++ Is Evil" camp, and
                              wholly believe that if you want proper strong, static type
                              checking, use Haskell, or if you want proper, complete
                              object-orientation (C++'s primitive types compromise its object
                              system's integrity, and I believe I've already discussed
                              casting and pointers), use Python, and if you want
                              under-the-hood pointer-fu, use C.
                              C++'s standard library seems such a huge win over the C library,
                              that I'd hate to switch back. Of course it has its warts and
                              cancers, but it's an awesome accomplishment. And you *can* get
                              harder-to-use C versions that are basically portable.

                              --
                              Neil Cerutti
                              A billion here, a billion there, sooner or later it adds up to real money.
                              --Everett Dirksen

                              Comment

                              Working...