Learning C++ on mac using PC literature

Discussion in 'Mac Programming' started by Aikiman, Jan 11, 2010.

  1. Aikiman macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
    #1
    I got over zealous while browsing at some programming books on Amazon and ordered them without thinking they were books on C++ but Windows specific and not OSX.

    Is it still possible for a newbie to use these books while coding with Xcode and the OSX environment?

    What are the big things to watch out for so I know when I come to them I can say, "Well I know that wont work" for example?

    The book I have is on gaming but the output is through the console window so there are no graphics libraries to access just the built in std libraries Im assuming.
     
  2. SRossi macrumors regular

    Joined:
    May 27, 2009
    Location:
    Glasgow, Scotland
    #2
    There shouldn't be any real big differences although if it is on gaming it may go into graphics using a different library and these libraries may be PC specific so you'll need to have a quick look through each chapter before starting.

    But there are no differences in a PC's C++ and a Mac's C++ except the libraries that are available for them.

    Stephen
     
  3. Aikiman thread starter macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
  4. Ti_Poussin macrumors regular

    Ti_Poussin

    Joined:
    May 6, 2005
    #4
    I would suggest you to use the STD lib and Boost library. Those are highly portable and may help you greatly. You may want to wait a bit for boost, it's usage may be a bit confusing for a beginner, but well worth the effort, especially if you do multithreading.

    As said above, the graphic may be different, unless you use OpenGL. There's a few difference you may get from time to time, but nothing too troublesome. Take care of ownership and file path under OS X (or any Unix/Linux base).

    getch may be an example of function not available. But the standard C++ is all there.

    I would recommend you to learn how to make a makefile and then move to xCode. This way you gonna learn what you do and what are those option of compiler and linker.

    Next think you should really get under control, is design pattern, a good design for starting is always time saved after. http://en.wikipedia.org/wiki/Design_pattern_(computer_science)

    It's a must to understand this to do good C++.

    And finally, have fun, don't let a difficulty take you down, see them as a challenge and you may go far into it!
     
  5. Aikiman thread starter macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
    #5
    Can you tell me a little bit more about Boost?

    In terms of 'design pattern' Im working through a book on Beginning Games on Python and he uses this thing he labels as...

    "IDEA ALTER"

    meaning I = Import/Initialise, D = Display, E = Entities etc etc the point is you work your way down the letters fulfilling each one as you go. The author says this concept can be used in any language relating to gaming.

    Is this what you mean by 'design pattern'?
     
  6. Sander macrumors 6502

    Joined:
    Apr 24, 2008
    #6
    The first paragraph of that Wikipedia page explains what a design pattern is in SW engineering. Boost is a collection of extremely high-quality, peer-reviewed C++ libraries. Some of the libraries from Boost ended up in the next revision of the C++ standard. See www.boost.org.

    Have fun programming!
     
  7. Aikiman thread starter macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
    #7
    Thanks for the info, I did have a look at the Wiki page but it didnt really make too much sense for me, I will try reading it again though.
     
  8. SRossi macrumors regular

    Joined:
    May 27, 2009
    Location:
    Glasgow, Scotland
    #8
    I think what sander is trying to get you to look at is a design pattern like UML find the wiki page here this is a way of designing your application before actually doing any code.

    It will make your life easier if you do design your project out before actually doing any code.

    Stephen
     
  9. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #9
    If you are really really new then a lot of the stuff the guys are mentioning above will be over your head (although its all great information).

    The C++ language is pretty much standard on any OS. The same stuff I wrote in Windows would get put on Mac, and sometimes *gasp!* on my eeePC running linux.

    As others have stated there may be a few things that will trip you up. Also XCode can be a little complex to a beginner so if you find it a little foreign you can always download and use something like Netbeans.
     
  10. Aikiman thread starter macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
    #10
    That UML looks like really interesting read, thanks for the link. Currently I dont intend on creating applications....yet....I want to use C++ in conjunction with an exisiting application to extend its usability, the application is Maya 2010.

    Im am very fresh with OOP but quite familiar with Mayas interpreted language MEL and a little bit of Python, so one would say I am quite a newbie really.
    Perhaps after many many months I will take a look at creating a basic app, this is so exciting ;)
     
  11. Aikiman thread starter macrumors member

    Aikiman

    Joined:
    Jan 24, 2008
    #11
    I saw this book on Amazon...
    Use Case Driven Object Modeling with UMLTheory and Practice by Doug Rosenberg & Matt Stephens
    Has anybody read this book and can recommend this or perhaps something else similar?
     
  12. rrpalma macrumors member

    Joined:
    Sep 21, 2008
    #12

Share This Page