Mac programming languages

Discussion in 'Mac Apps and Mac App Store' started by moron, Apr 9, 2003.

  1. moron macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #1
    Hi

    I'm a recent mac convert, and i need a little advice about programming languages for the mac.

    I've had light-moderate experience programming in Visual C and Visual Basic on the PC, and would be interested in continuing on the mac. What versions of C are available? Are there any freeware/open source C packages available? Does programming C on the mac differ that much from the PC? Does anyone know of any good sites that cater for mac programming, preferably with tutorials so i can get my footing again?

    Cheers in advance, and sorry for the noob-style question! :)
     
  2. benixau macrumors 65816

    benixau

    Joined:
    Oct 9, 2002
    Location:
    Sydney, Australia
    #2
    no question is to basic. we all start somewhere.

    i program for the mac in objective-c under the cocoa framework. apple likes this. It is easy (compared to saay, carbon (c++)) and the apps are fast.

    to program with you will need the apple developer tools. you an download the latest at the apple developer site or use the ones from your Mac OS X CD. I would recommend the downloaded ones for compatability and up-to-dateness but it is a 300MB odd download and so is a bit much for D/U connections.

    to start off in obj-c. visit cocoa dev.com, cocoa dev central.com and search in google for the O'reily cocoa programming site. It is really really good with downloadable examples to. If you want to see what can be achieved goto the apple cocoa sample code site. If you want any more i can send you a word doc (or rtf if you are anti-MS). I would just need time to type it up.

    to continue please email me at benjamingreenau@optusnet.com.au.

    good luck
     
  3. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #3
    Cheers chap, i appreciate the speedy response.

    I think my OS X cd is still at uni, so i'll start downloading straight away. I'll have a whack at some coding, see if i can get my programming mind back in order. If i get any problems i'll drop you a line.

    Thanks again.

    Mike
     
  4. irmongoose macrumors 68030

    irmongoose

    Joined:
    Dec 3, 2001
    Location:
    Sometimes Tokyo, sometimes California
    #4
    Just a little tidbit. Things seem to be moving towards Java nowadays, replacing C++ even at our school's programming class. Plus, Java creates cross-platform apps, so no need to code the same thing twice; just tweak it for either platform so it fits in with the overall GUI.



    irmongoose
     
  5. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #5
    Cocoa could be a bit advanced for a newbie (although I really like it). Realbasic might be better.

    If you have any problems, post 'em on macrumors and I'll see what I can do.
     
  6. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #6
    I have a tiny bit of java experience from one of my degree modules, but i never took to it in the same way i took to C. Also, i'm quite interested in game development, and as far as I'm aware C is better for this (although i may be totally wrong!).

    Cheers!
     
  7. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #7
    If you were accustomed to doing GUI programming on Windows, you probably used MFC.

    On Macintosh, you may programme for GUI in C much more easily than you can programme for Windows in C. You can, of course, create C and C++ programmes for the command line and it's so very simple.

    If you know Object-oriented programming, Objective-C is nice although you must learn Apple's nice but rather unusual tools to get anything done. Java is Java--it works equally well on any platform. I think this is the best choice for GUI programming, esp. after spending so much time with Windows.
     
  8. cosmicsoftceo macrumors newbie

    Joined:
    Oct 11, 2002
    #8
  9. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #9
    I'm downloading the demo version right now. I'm as broke as a joke, so i can't see myself affording it for a while, but if its really good then you never know!

    Cheers for the tipoff.
     
  10. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #10
    Re: Mac programming languages

    This fact conflicts with your MacRumors member name. So I'll assume that your member name moron refers to Morón, the city in Argentina.

    REALbasic is one of the easiest ways to get started with Mac programming. The programs can run under Windows too. However, if you are serious about real game development, you should look into the Apple developer tools as benixau suggests.
     
  11. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #11
    :)

    Actually its because when i try to sign up for web services, my surname (Morgan) is usually taken, and rather than being morgan_37 or something, i choose something which sounds similar - moron! Of course its ironic, i'm not a moron... :)

    I'm downloading the apple tools as we speak, and i have been for 8 hours now. I'm getting a paltry 6kbs down a ADSL line, which is total rubbish. No matter, only 2 mins left. Realbasic does look pretty sweet, but Visual Basic has never offered me the depth i've wanted, so i'll probably jump straight into Cocoa. I'll let you all know how it goes!
     
  12. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #12
    oh my god the download has stopped at 301.2mb out of 302.3mb. I'm ultra suicidal!
     
  13. benixau macrumors 65816

    benixau

    Joined:
    Oct 9, 2002
    Location:
    Sydney, Australia
    #13
    dont use RB if you can avoid it. i have it for demoing my app interfaces.

    in the end you will want the ease of adding powerful features that only cocoa offers.

    as for obj-c vs java: i chose obj-c cause in the 10.1 days the documentation was better by a mile and all of the APIs had not been java-ed.

    i find also, that while java is good it can be harder to learn. also, the cross-platform code can slow it down. It also makes the resulting app larger.
    althogh, if you need, and i mean absolutely need, cross platfrom compatability then use java or RB (it makes carbon apps, and can compile to OS9, OSX, Win32). just be careful not to use any OSX specific features in java. it will cause massive error. windows for example does not have sheets (duh! they are useful, why would windows have that :D). RB, on the other hand converts the sheets to modal windows etc for pre-OSX and Win32.

    good luck.
     
  14. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #14
    I would never suggest using Java for Cocoa programming although it can be easier, if you're already familiar with Java. Objective-C takes a little time to understand, even if the runtime coincides with most of what Java is doing, á la Smalltalk.

    While I'd never suggest using REALbasic for anything critical, it is a quick way to get things working. The only other thing that works this way would be Borland JBuilder. Drag-and-Drop programming was on Macintosh early and left it early too.
     
  15. benixau macrumors 65816

    benixau

    Joined:
    Oct 9, 2002
    Location:
    Sydney, Australia
    #15
    i dont know. i have never ever seriously given java a look. i just know that obj-c has all of the APIs and a few more at last count than java.

    besides, if he isnt programming for another platfrom then this doesnt matter. obj-c all the way for mac only programs.
     
  16. moron thread starter macrumors newbie

    Joined:
    Apr 9, 2003
    Location:
    London
    #16
    What about Carbon?

    I know almost nothing about it at all, but from what i read about it on the RB page, its as good as Cocoa, and would be better for someone who is familiar with C on other platforms. Would carbon be better for porting PC code to the mac?
     
  17. Fukui macrumors 68000

    Fukui

    Joined:
    Jul 19, 2002
    #17
    Don't fall into the RB trap, if you ever want to sell your app, dont use RB....They say its as "good" as cocoa, but...its not. Objective-C is based on C, if you know C, you can learn Objective-C pretty easily, just give it a try, you'll never know if you don't. And it doesn't really matter for porting code from the PC with regard to Cocoa or Carbon because of you look at apps ported from the PC on mac, some are Cocoa, some are Carbon, for example, apple's "Cocoa-Based" Safari is actually based on KHTML from Linux (written in C++ I believe)! Same for Camino, it was ported from Mozilla, you can wrap command line apps from Linux/Unix easily in Cocoa as well...besides the thing that is really going to limit the portability of your app from say windows is windows specific API's...

    You can program in cocoa using Objective-C, C++, Java, and you can mix C code in Cocoa because Obj-C is just a superset of C anyways...and you can access the carbon API's from Cocoa and vice-versa...

    Just give cocoa a try, and if its too hard, try carbon...
     
  18. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #18
    Carbon is actually quite good and is easier for Windows programmers to understand. It's not object-oriented but it's a very well-designed framework.

    Rather than listening to every message, whether it applies to your application and control, you add a listener for your control and a callback function to handle the event. MFC on Windows does the message cracking but it's not quite as nice as how Carbon handles it. I liked the way you could right click on a control in Borland C++ and found the message you needed to handle, then could use ClassExpert to create the empty handlers. Apple doesn't do anything so automatic, but again, the framework does a lot.

    Cocoa has another way to do it which relies on drawing lines in Interface Builder to establish the relationships. If you've worked with Smalltalk or IBM's VisualAge products, you're familiar with this sort of magic, behind-the-scenes coding.
     
  19. benixau macrumors 65816

    benixau

    Joined:
    Oct 9, 2002
    Location:
    Sydney, Australia
    #19
    Actually, you will like obj-c/cocoa (called cocoa from now on) better. In carbon to save preferences you must fiind the directory, create a code link to it, create the XML file (a bitch in itself) open it, place the code in, which has to be coded to suit, then close it etc. In cocoa, i just call an API and it finds the correct preferences folder for me, creates the XML file and names it, gives it the correct extension etc it also closes it for me when the app quits.
    All i have to do is put the values into a dictionary that is linked to a mutable array (an array that can be changed after it is created).

    I belive that obj-c is better. I fully support it and cocoa. BUT - in the end it is your chioce. If you like programming easily where everyhting is done for you almost (sorry, no calculus based code (probably if you look on google)) then choose cocoa. If you like to do it all yourself and have a slower app at the end choose carbon.If you want the slowest possible app, the biggest possible binary/exe and a really expensive app to boot, go RB.

    PS. if you go RB i will kill you - i.e. DONT
     
  20. irmongoose macrumors 68030

    irmongoose

    Joined:
    Dec 3, 2001
    Location:
    Sometimes Tokyo, sometimes California
    #20
    Yada yada yada... you programmers really confuse me! SPEAK ENGLISH!



    irmongoose
     
  21. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #21
    Sorry, but we programmers don't understand your language either. We only understand words like grep and blog and foobar and QueuePointerIndexHandle. Most of the time, we only speak in TLAs (where TLA is a three-letter acronym for "three-letter acronym"). When you normal people use strange words like "quality software" and "on-time project completion", we have no idea what you mean.
     
  22. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #22
    Awwww...kawaiso da. Gambatte ne.
     

Share This Page