programming newbi reporting

Discussion in 'Mac Programming' started by hhyy6634, Aug 25, 2010.

  1. hhyy6634 macrumors newbie

    Joined:
    Aug 25, 2010
    #1
    hi everyone,i am not sure if here is the right place to post this, but i will give it a try,here we go:

    i am about to start studying programming(self-learnning), and i love macs:
    1. People says that C++ is a good language to start with,is it ture? or i should start with something else
    2. Is there a C++ developing environment(like Visual Studio for windows) for OS X?
    3. Is it possible to write windows applications on OS X or i have to bootcamp window to do it.

    Thank you :)

    PS:there might be some grammar error in what i write above,english is my second language(i am a chinese),there are tons of mac lovers in china,bad thing is that most of(by that,i mean 99.999%) the chinese programs(programs that developped by chinese, and only release in china)are only support windows, there are some applications have Mac version but some function doesnt work or not working currectly(chinese Mac programmers suck,but cant blame em coz apple only have around 5% of the computer market in china,no company wants to spend lota money for those 5% mac users),for instance, every banks in china have their own online banking software,and only one of them have Mac version(1 out of 10 banks, so sad), that would be a pain in the ass for mac users who loves OS X but use online banking alot. My goal(in long term) is to make mac users in china a batter life!!and also make some useful applications for mac lovers worldwide too :)

    Sorry about the long @$$ PS...@.@
     
  2. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #2
    I started learning a few months ago. You need to download Xcode from the apple site and sign up as a developer. I bought the book Programmimg in Objective C 2.0 and it's a good book. It can get boring from time to time but still put together well.

    The last part you need you already have, membership to this forum. When I get lost or ask a stupid question the folks on here are pretty cool and answer very fast.
     
  3. hhyy6634 thread starter macrumors newbie

    Joined:
    Aug 25, 2010
  4. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #4
    Start out with a book on vanilla C and from there you will learn the foundations of programming you can then move right on to Objective C for Mac OSX application or C++ for Windows development(Linux and Mac OS are also C++ but the books on it are geared more towards Windows).

    With vanilla C or vanilla C++ you can write a CLI application and compile it on Mac OS, Windows or Linux and i have had some success in using GTK to make a cross platform graphical application.

    For development environments Xcode is terrific, but start of with a text editor and the terminal, most C books will start by teaching you to compile your applications using the terminal.

    If your end goal is making Mac applications learn C followed by Objective C and learn C++ as need arrises(Programming games), and its wise to learn Java if you ever need to do any web programming or something like Ruby.
     
  5. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    If you want to do Windows development I'd stick with C# rather than C++. It is Microsofts equivalent to Objective-C (although the language has fundamental differences - it is more Java like than Objective-C).
     
  6. ChristianJapan macrumors 601

    ChristianJapan

    Joined:
    May 10, 2010
    Location:
    日本
    #6
    As said before: start simple C on the comand line ( the good old "Hello World"); learn to manage memory; different types and visibilty of variables, learn to read files/streams.

    Staight jumping into the wonderful world of GUI programming is not helpful for learning. You might have quick nice results but it adds too much complexity.
    Specially if you want to learn the philosophy of the languages.

    XCode on Mac would be a good base; easy to jump into the documentation for learning and debugging.

    If you also want to develop programs for Windows it might make sense to look into Qt. That would help you (later) to have one source for Mac and Win (and Linux) and a harmonized GUI programming model. As far as I know Bibble Labs uses Qt for their Raw-file converter.
     
  7. ranguvar macrumors 6502

    Joined:
    Sep 18, 2009
    #7
    C++ is not bad, but I'd recommend Java as a first language. It doesn't bother you with pointers, memory management, namespaces, templates, etc. while pretty much enforcing the use of object orientation.
     
  8. PatrickCocoa macrumors 6502a

    Joined:
    Dec 2, 2008
    #8
    As a differing viewpoint, I'd recommend that if you even see Java that you run screaming in the opposite direction. Of two people in my family that wanted to get into programming, both took Java in school. Java scarred them for life, now neither will have anything to do with programming.
     
  9. ChristianJapan macrumors 601

    ChristianJapan

    Joined:
    May 10, 2010
    Location:
    日本
    #9
    ... But very soon those nasty things are needed. If you start Cocoa and ObjectiveC you are back to it: "NSObject *" are everywhere. I have quite some years of C/C++ experience, but had also to spend some time to understand the magic of reference counter in ObjectiveC memory management and still find leaked objects.
    What I want to say: Java might be too "easy" by hiding those essential aspects you need to develop for Mac OS X and/or iPhone/iPad. No official Java on regular iOS-Devices.
     
  10. hhyy6634 thread starter macrumors newbie

    Joined:
    Aug 25, 2010
    #10
    thanks for all these advise everyone~! Seems C is a good starting point for me.I heard that C# and C++ are developped base on C, would that be easier to learn if i learn C first?
     
  11. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #11
    C# is really not based on C, aside from some surface-level similarity in syntax. Objective-C and C++ are the two main direct descendants of C.
     
  12. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #12
    Obj-C is completely based on C. Anything[1] you can do in C is legal in Obj-C and you can freely use C code and libraries inside Obj-C code. That is unlike C++ which does have real incompatibilities with C (but the problems are not devastating). That all being said, when you write in Obj-C you often focus on the Foundation and AppKit layers and so spend little time mucking about in C. So while it is occasionally really helpful to understand pointers in Obj-C (especially for over/under retain/released objects), you generally don't have to play with pointer math all the time like you usually do in straight-C. So things feel very different.

    [1] I have been told that there are some really obscure things in C that you can't do, but don't know what they are, and am unlikely to ever use them.
     

Share This Page