Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Moving from C# to C++

Moving from C# to C++

Scheduled Pinned Locked Moved The Lounge
csharpc++questionlearning
108 Posts 36 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Kevin McFarlane

    Nickolay Karnaukhov wrote:

    Books - are only books. Books are just reference and "swap storage". Most important is to start real project, join any opensource for example, and get all that experience.

    But it's also important, especially with C++, to learn good practice which you will get from the better books.

    Kevin

    N Offline
    N Offline
    Nickolay Karnaukhov
    wrote on last edited by
    #79

    Kevin McFarlane wrote:

    But it's also important, especially with C++, to learn good practice which you will get from the better books.

    Sure it is! And you're absolutely right!

    ------------------------------------------------------------ Want to be happy - do what you like!

    1 Reply Last reply
    0
    • C c2423

      I already know C# and I'm trying to learn C++ (it seems to be more required by employers.) All the reference material I have on C++ is geared to learning from absolute basics and I get tired of reading about the difference between ++x and x++ etc (I still read it in case there happens to be something subtle that I wouldn't already know.) So can anybody recommend any good resources that are comprehensive, but won't re-cover stuff thats the same in C#? Thanks, Chris

      M Offline
      M Offline
      Mike Corley
      wrote on last edited by
      #80

      Hi Chris - Those are some good responses you received. Effective C++ by Meyers is indeed excellent! Also an excellent book along those same lines is the "C++ Coding Standards" by Andrei Alexandrecu and Herb Sutter. The critical component is understanding the object model differences. C++ is based on deep copy (value model) semantics. Implies user defined object conbstruction, copy and assignment semantics (implies object identity preservation). C#/java is based on shallow reference semantics (everything is a reference to an object on the managed heap -- object identity is lost). C++ carries its servers type information "#includes" for compilation which affects how you structure code using well known OOD principles (Interface Segregation), (Dependency Inversion) so on an do forth which make use of object factories or whatever. c# uses metadata for compilation which is great. c++ uses rich memory model, static, stack, heap etc. i.e you determine object lifetime C# uses a more spartan model... all objects reside on managed heap... lifetime is non-deterministic. There's more of course... but in short, don't try to write C++ the C#/Java way because you'll get frustrated. Check out the following link for good content and book information: http://www.ecs.syr.edu/faculty/fawcett/handouts/webpages/CSE687.htm good luck, Mike

      C 1 Reply Last reply
      0
      • A AmazingMo

        Essential C++ by Stan Lippman.

        C Offline
        C Offline
        c2423
        wrote on last edited by
        #81

        Thanks, I'll be sure to check that out!

        1 Reply Last reply
        0
        • Z Zamaro

          The best one that I found is http://msdn.microsoft.com/pt-br/library/ms235630.aspx#MtViewDropDownText have fun! :laugh:

          Zamaro .: http://anothernetprogrammer.spaces.live.com

          C Offline
          C Offline
          c2423
          wrote on last edited by
          #82

          Not sure my foreign languages are up to reading 100% of it, but the English version looks good! Thanks.

          1 Reply Last reply
          0
          • T TpB

            C++ From The Ground Up (Third Addition) by Herbert Schildt, Osborne Publications If you are developing for Windows, read up on MFC until you get board and then study with Win32 and Win64 API's. There are several API Bibles available - all read about he same.

            C Offline
            C Offline
            c2423
            wrote on last edited by
            #83

            Sounds worth a look - thanks!

            1 Reply Last reply
            0
            • K Kevin McFarlane

              Not read Schildt myself but (although popular) he's widely detested by C++ gurus.

              Kevin

              C Offline
              C Offline
              c2423
              wrote on last edited by
              #84

              Jealousy perhaps? Maybe after I read it I can work out why...

              K 1 Reply Last reply
              0
              • D dboone

                "C++ FAQ" by Cline, Lomow, and Girou, second edition. Herb Sutter's books, "Exceptional C++", "More Exceptional C++", and "C++ Coding Standards" The "C++ FAQ" is excellent about explaining why things work the way they do in C++ so you'll get the subtle differences. "C++ Coding Style" is also excellent in the 'Do it this way because that way is going to hurt.' The Exceptional * books are more advanced, deeper dives into specific features.

                C Offline
                C Offline
                c2423
                wrote on last edited by
                #85

                Thanks for the recommendations - these look like they should help with style as well as the basics, which is always good.

                1 Reply Last reply
                0
                • J James Lonero

                  I have found that companies doing 3D modeling, like CAD, use C++. But, beware of pointers. They can bite you badly. Under C#, they are managed for you. Under C++, you need to manage them. Learn about smart pointers. The BOOST C++ Libraries have really good smart pointers and make using pointers much like using C# references. (Go to: www.boost.org for more information.)

                  C Offline
                  C Offline
                  c2423
                  wrote on last edited by
                  #86

                  James Lonero wrote:

                  But, beware of pointers. They can bite you badly.

                  Yeah, so I'm told. This is why I'm trying to do some reading *before* I start coding.

                  1 Reply Last reply
                  0
                  • L laniakea development

                    Hi, man! I wish to recommend You the Bruce Eckel's C++ books; you can download them free, and as I know, there was the whole standard C++ language described. The right studio supporting it is VS2005 or 2008; in Visual Studio 6, there is no full support for C++ language, for example, You can't use multiple templates as parameters in templates. So, try with Bruce Eckel's C++. You can find Eckel's site using google or like. Btw, I'm somehow impressed with Your expression that it seems C++ is more wanted by employeers than C#. Although personally I preffer C++ programming, I thought that C# was most wanted. OK, this is a nice news for me! Best regards!

                    C Offline
                    C Offline
                    c2423
                    wrote on last edited by
                    #87

                    Thanks for the recommendations - its always good that there are free materials! I guess the demand for each depends on how much code the company has already written in C++...

                    1 Reply Last reply
                    0
                    • J Jason J Chase

                      In addition to others mentioned I also found the Wrox book Professional C++ and C++ Coding Standards by Herb Stutter and Andrei Alexandrescu helpful. If you want to apply to Windows, you can't go past Jeff Richter's Programming Windows via C/C++.

                      C Offline
                      C Offline
                      c2423
                      wrote on last edited by
                      #88

                      I don't get on with Wrox books (I find they are unnessesarily wordy in places), but the others sound worth a look. Thanks!

                      1 Reply Last reply
                      0
                      • D dazfuller

                        I'd strongly recommend the Learn C++[^] site, it does cover the basics but you can skip ahead to more interesting stuff. I found myself in the same position as you a few months back and this is how I got going. I'd also recommend at least skimming over the basics again as your likely to pick up subtle differences between the two languages and possibly remind yourself of things you may have forgotten. Book wise, I've got a copy of the C++ Pocket Reference Guide by O'Reilly (ISBN: 978-0-596-00496-5) which is great as a quick reference, I also picked up a second hand copy of Stroustrup's "The C++ Programming Language" which I don't use as much but is useful if your not sure why something is happening in a particular way. Once you get into it it's fairly good fun, some things will annoy you and you'll be longing for a C# project but then some things are actually easier in C++ (such as manipulating byte arrays).

                        C Offline
                        C Offline
                        c2423
                        wrote on last edited by
                        #89

                        Thanks - its good to get some recommendations from someone who has been in the same position!

                        1 Reply Last reply
                        0
                        • K Karen Saxby

                          you could try : www.freecomputerbooks.com/langCppBooks.html

                          C Offline
                          C Offline
                          c2423
                          wrote on last edited by
                          #90

                          Thanks - I do like free reference material!

                          1 Reply Last reply
                          0
                          • M Melvin Holt

                            I like "Thinking in C++" by Bruce Eckel. He assumess a reader working from C to C++, so it might be pedantic on OO concepts, but at least it won't spend much time on fundamental C syntax.

                            C Offline
                            C Offline
                            c2423
                            wrote on last edited by
                            #91

                            I must admit, I hadn't thought of approaching from the "C to C++" angle - very good idea, thanks!

                            1 Reply Last reply
                            0
                            • S SteveL12234

                              If you want something more advanced, an option are Herb Sutters books. A lot of the material from those books comes from http://www.gotw.ca/gotw/[^] Also if you want to read more than you ever cared about templates, C++ Templates The Complete Guide by Vandevoorde and Josuttis. To see how far templates can be taken, read Modern C++ Design, by Andrei Alexandrescu.

                              C Offline
                              C Offline
                              c2423
                              wrote on last edited by
                              #92

                              Great, thanks. I'll make sure I check out the link first to save myself some money!

                              1 Reply Last reply
                              0
                              • J jjjm

                                I suggest C++ Primer by Lippman & Lajoie. It should be about the right level.

                                C Offline
                                C Offline
                                c2423
                                wrote on last edited by
                                #93

                                Thanks for the suggestion - I'll be sure to take a look at this.

                                1 Reply Last reply
                                0
                                • M Mike Corley

                                  Hi Chris - Those are some good responses you received. Effective C++ by Meyers is indeed excellent! Also an excellent book along those same lines is the "C++ Coding Standards" by Andrei Alexandrecu and Herb Sutter. The critical component is understanding the object model differences. C++ is based on deep copy (value model) semantics. Implies user defined object conbstruction, copy and assignment semantics (implies object identity preservation). C#/java is based on shallow reference semantics (everything is a reference to an object on the managed heap -- object identity is lost). C++ carries its servers type information "#includes" for compilation which affects how you structure code using well known OOD principles (Interface Segregation), (Dependency Inversion) so on an do forth which make use of object factories or whatever. c# uses metadata for compilation which is great. c++ uses rich memory model, static, stack, heap etc. i.e you determine object lifetime C# uses a more spartan model... all objects reside on managed heap... lifetime is non-deterministic. There's more of course... but in short, don't try to write C++ the C#/Java way because you'll get frustrated. Check out the following link for good content and book information: http://www.ecs.syr.edu/faculty/fawcett/handouts/webpages/CSE687.htm good luck, Mike

                                  C Offline
                                  C Offline
                                  c2423
                                  wrote on last edited by
                                  #94

                                  Hi Mike,

                                  Mike Corley wrote:

                                  Those are some good responses you received

                                  Yeah - with the number of things I will need to look at before deciding which ones to read first, I'm not sure I saved any time at all getting suggestions... I hadn't realised yet that C++ uses deep copy semantics - I think knowing this now will save me quite a bit of frustration! Thanks for taking the time to write such a complete answer. Thanks, Chris

                                  1 Reply Last reply
                                  0
                                  • N Nickolay Karnaukhov

                                    It's easy - real languages are based on the endless struggle between flexibility and efficiency. In this case C, C++ is real languages. As long as Perl, PHP, Basic, Pascal, etc... All these languages were developed by developers for developers of students who are willing to be developers. In most cases these languages are developed by one, two or three bearded guys in old shabby jeans like Stroustrop, Richie or Wirth. They were (and are) scientists acted for good and with all good in their minds. In other hand we have not real languages - build by marketing departments with all these wise guys with one thing in their mind - "Attract as much developers as possible". This languages are designed by companies and their software frameworks. There's no soul in these languages as they weren't built by one, two or three bearded scientists. And in this list we have Java and C#. Javascrip, Actionscript could also be listed here as they are only some kind of derivatives designed for specific purpose. So final idea is - if something is designed by one bearded scientist - it will live much longer than shaved greedy hired servant. You can treat it in any way you want - it is joke and truth same time. Now you've got definition!

                                    ------------------------------------------------------------ Want to be happy - do what you like!

                                    D Offline
                                    D Offline
                                    Drozzy
                                    wrote on last edited by
                                    #95

                                    Right... :doh: I don't know how I missed that obvious definition! Hm.. one thing bugs me though. Guide is more bearded than Bjarne. What gives? Do you meat to tell me that.. that ... C++ is not real, and it was python all along???!!!

                                    N 1 Reply Last reply
                                    0
                                    • C Carlosian

                                      I'll third the Meyers book(s). They are on the shelves of every good C++ programmer I know. If you already know C# well I would go ahead and get the Meyers books whether you think you are ready or not. Then as you read them and if he talks about a topic you don't understand in C++, go back to a C++ reference to understand it. By the time you are done you will have a much deeper understanding of how to use the language than if you just read a primer etc. For a comprehensive reference I like the C++ In a Nutshell O'Reilly book by Ray Lischner.

                                      C Offline
                                      C Offline
                                      c2423
                                      wrote on last edited by
                                      #96

                                      Third...The number of responses now I'm not sure you got in third necessarily... Thanks for the recommendation - I guess the more times it gets mentioned the higher it goes on my priority list (should that be queue?)

                                      1 Reply Last reply
                                      0
                                      • K Kevin McFarlane

                                        c2423 wrote:

                                        This is the second reccomendation for Stroustrup

                                        It's a book you should have at some point, but I'm not sure it's an appropriate first C++ book. I wouldn't know what a good starting-point is these days though.

                                        Kevin

                                        C Offline
                                        C Offline
                                        c2423
                                        wrote on last edited by
                                        #97

                                        Coincidently, I have problems recommending where to start for people learning C# - I'm never sure whether people should start with .Net 2.0 or any other version... Thanks, Chris

                                        1 Reply Last reply
                                        0
                                        • K Kevin McFarlane

                                          The problem these days, especially in the Microsoft world is that you'll struggle to find pure C++ roles. It will be C++ and some .NET-based technology. Don't know what it's like in the *nix world though. Maybe C++ + Java + some scripting language?

                                          Kevin

                                          D Offline
                                          D Offline
                                          Dave Parker
                                          wrote on last edited by
                                          #98

                                          Yeah you can kind of see why though, there are very few projects that benefit from the speed or control over the system to warrant C/C++ - most software is just boring data entry stuff and it makes sense to use something like C# for maintainability and less chance of bugs caused by typos.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups