Programming language recommend?

Discussion in 'Mac Programming' started by spick, Dec 14, 2009.

  1. spick macrumors member

    Joined:
    Aug 17, 2007
    #1
    Hey guys I'm new to Mac programming and I kind of need to know which Mac programming language I need to learn to make a small application.

    Basically what I want to do is make an application that can generate a random string of text with a click of a button. This string of text can be store in a database or typed out in the program file itself, it doesn't matter as long as I can pull it with a click of a button.

    I have done this with visual basic, but since I'm doing this for a friend and he only has a Mac so yeah.

    Thank you guys
     
  2. ethical macrumors 68000

    Joined:
    Dec 22, 2007
    #2
    Objective-C is what you want.

    If you're doing the programming on a mac then download the SDK from the apple website (also included on the discs that came with your mac). Also check the stickies at the top of the Mac Programming sub-section.
     
  3. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #3
    Is this a one-time thing? or are you trying to use this project as a learning experience with the intent to progress onward after it's done?
     
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    Why not JavaScript and HTML? Then it's usable on any platform.

    -Lee
     
  5. Transporteur macrumors 68030

    Joined:
    Nov 30, 2008
    Location:
    UK
    #5
    If you're not intending to do something web based, write it in Java.
    Java is platform independent.
     
  6. spick thread starter macrumors member

    Joined:
    Aug 17, 2007
    #6
    This is for learning experience, I'll check objective C and see how it goes.

    For JavaScript/HTML, is it possible to end up with 1 file as the finish project? Like I said this is for a friend so I don't want something that would end up overcomplicated for him.
     
  7. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #7
    There should be no problem having an HTML page with embedded JavaScript, so the "deliverable" is a single file.

    Is the purpose to display a fixed "random" string, or a new random string each time the button is pressed?

    -Lee
     
  8. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #8
    So, you click a GUI Button and a random string is selected and then what is done with it?
     
  9. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #9
    3. Profit!
     
  10. spick thread starter macrumors member

    Joined:
    Aug 17, 2007
    #10
    Okay basically this is what I want, a button to click and a text field to display the randomly selected string of text. The text strings are going to be fixed.

    Did a little digging for javacript and it looks like I'm going to go with this since it's a small application.
     
  11. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #11
    You should start with an Objective-C command-line tool to run from the terminal first just to get a feel for the logic. After you get that going it should be pretty easy to wire up your code to a NSButton and a NSTextField in Interface Builder (the app for making native GUI's on the Mac). If you search around the forum you'll find plenty of links to tutorials for learning Objective-C and Cocoa.
     
  12. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #12
    spick,

    Is your intent to simply provide a solution for your friend or is it also your desire to learn to program Mac applications?

    Ether way I took 30 minutes and threw together a hybrid ObjC/C++ solution. If you're interested I can post it.
     
  13. spick thread starter macrumors member

    Joined:
    Aug 17, 2007
    #13
    My primary purpose is to provide something for my friend, but also want to learn on the way. I already started something with Javascript, but it's not perfect. So if you got something for me then yeah I would love to have it. I can use it for comparison and as an example. I'll pm you my email.
     
  14. Winni macrumors 68030

    Winni

    Joined:
    Oct 15, 2008
    Location:
    Germany.
    #14
    If you already have Visual Basic experience, you --might-- like REALbasic. REALbasic can also target Linux and Windows.

    If writing for the Mac is all that you ever want to do, use Apple's native language Objective-C. However, if you're not religious about the Mac and want to learn something that's also useful outside the Apple microcosm, then do NOT go down the Objective-C alley.
     
  15. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #15
    Well I've attached the Xcode project folder for anyone else that maybe interested.

    It a very simple Application, started from an Xcode "Cocoa Application" template, called "RandomStringPresenter".

    Added the code for your purposes to the default "RandomStringPresenterAppDelegate.h" and "RandomStringPresenterAppDelegate.m" files.

    Renamed "RandomStringPresenterAppDelegate.m" to "RandomStringPresenterAppDelegate.mm" in order to compile it as ObjC++.

    Added the text file "Spick Quotes.txt" to the Xcode project file such that it gets copied to the resulting applications embedded "Resources" folder. This is the file that contains the text that is to be displayed when the "Speak" button is pressed.

    3 GUI elements were added to the file "MainMenu.xib" using "Interface Builder". A static text label, an editable text field (to receive and display the message) and button that when pressed will cause a random line of text to be pulled form the embedded "Spick Quotes.txt" file and displayed in the editable text field.

    Enjoy


    http://att.macrumors.com/attachment.php?attachmentid=207456&stc=1&d=1260983342
     

    Attached Files:

  16. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #16
    Spick,

    Were you able to get this working and modified to suit your purpose?
     
  17. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #17
    If you already know how to program in Basic, there are several free Basic interpreters for MacOS (Google them).

    Simple Basic might be fine for your purposes, but no longer currently recommended for anything much over several dozen lines of code.

    For something more future-proof, I would make a small Javascript/HTML page.

    Objective C might be overkill, unless you plan on reusing your code or extending it to a much larger app for the Mac or iPhone, or need a Cocoa UI.
     

Share This Page