1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

What's Programming??

Discussion in 'Mac Programming' started by hob, Aug 14, 2006.

  1. hob
    macrumors 68020


    Hey everyone, I'm a totally newbie to programming on the mac!

    Infact, the furthest I ever got was doing a tiny bit of Visual Basic at school.

    So I was just reading the wiki guide, and I am still confused. I don't know what I need to start learning in order to make a nice app. There's nowhere I can see that nicely defines all the concepts such as cocoa/carbon etc.

    I just want to make a program that interacts with the iTunes library, and helps users add MP3s to the library a little easier (I just got annoyed after adding a new album and having to number all the tracks one by one...)

    So do I need to learn C++?
  2. macrumors 6502a


    You should get a book. O'Reily books are really good. You could probably start with cocoa. It's muchly derived from C++ that if you ever needed C++ you would have a firm grasp on it already. And cocoa will make it easier when dealing with OS X.
  3. macrumors 6502a

    He or she should start with objective-c, and then move on to cocoa.
    If you can program shell-like programs with obj-c, then it's time to move on to a GUI. If you don't know how to program, GUI's are nothing but distractions. Don't assume that because you know how a for loop or while loop works, that you know how the program in obj-c or any other syntax than the one you learn the basics with.
  4. macrumors 603


    Could this be done with an AppleScript?

    or even Automator?
  5. macrumors 68040


    Take a look at Automator first. It's a pretty simple way (for me anyway - I've heard that it's still difficult for non-programmers, but I can't see that myself since there's no programming involved.) of creating small apps like what you're suggesting. There are built in tasks for e.g. interacting with iTunes.
  6. macrumors 68040


    I'm not by any means trying to discourage you from learning programming, including C/C++/Objective-C/Java (in fact I would encourage it), but I have to say that what you're talking about can be done with AppleScript, and it probably already mostly has been done. For example, I already have a script that will automatically number tracks. I have another script that will automatically name them based on the contents of a plain text file. Some of the scripts I have I downloaded, others I wrote myself.
  7. hob
    macrumors 68020


    Yeah it's not such an Automator kinda thingy, and I thought it'd be a good way of getting into making my own little apps! Thanks for the advice :)
  8. macrumors 68000


    I'm not trying to discourage you, but programming is much more difficult than you think. But when you have learnt the basics, programming in general can be very rewarding.

    First of all, you will have to decide what programs you want to make, and for what platform. Forget GUI programs at the moment, since you firstly have to know the basics for a language, then use that language with the Application Programming Environments distributed with each system to create User Interfaces.

    C is a good language to start from, and it's cross-platform too. It is widely supported by every modern operating system. C++ is the Object-Oriented evolution of C, but it is 2 times harder to master, although the basics of it can be easily learnt. It is widely supported on modern operating systems, and is the programming language of choice of most professional programs. Objective-C is required to program in Cocoa on OS X, but it is not widely supported on other platforms.

    My advice: Start with C++ or Objective C. They are both Object-Oriented, which I think is the most important thing in modern programming languages. Then, you can move to Cocoa with Objective C, or Carbon, with C++.

    But forget graphic user interfaces for now. If you are a complete newbie, you will have to do a lot of work to create the applications you want (especially if you use C++). But the most important thing is that programming is the most rewarding thing in the world. Once you get the basics, you will feel that nothing can stop you, and everything will be easier from then on...

    Also, do not be discouraged by the number of all the languages that are out there. Learning a language doesn't prevent you to from learning somehing else, too! In programming you learn ways to solve many problems in general, and not just simple commands. The way in which you solve the problem is a matter of good thinking, and that can be applied into every aspect of programming life (and real life, too!).

    Good luck!
  9. Moderator emeritus

    Learn AppleScript. It's easier and can interact directly with iTunes. Anything else would be too complicated for a beginner trying to do complex interactions and you'd probably give up.
  10. macrumors regular

  11. macrumors 6502

    have you tried "Get Track Names" under the "Advanced" menu item?

    whenever i import a CD with iTunes, i just go to Advanced -> Get Track Names and it automatically adds the titles, album, artist, etc..

    edit: nvm didn't read your post carefully, you want to number your tracks
  12. macrumors 6502a


    Java is a pretty good language to learn. Can run on most any OS. Also very prevelant in the work force, so good skill to have.


    Good tutorials and what not on sun's site. You dont need a complex IDE (Integrated Development Environment) to get going. Just a text editor, and download the JDK (Java Development Kit).
  13. macrumors G3


    It's a lovely language, but it's painful to do Mac GUI programs with it. It works very nicely as an embedded interpreter though, so you can have it both ways.
    Python for people who don't want to admit they like Python :D

    Check out this thread for an awkward but functional way to make it work.
  14. macrumors regular

  15. hob
    macrumors 68020


    Applescript seems really stupid to me.

    I get why it exists, it's to make programming easier for people who aren't programmers, like me. But in truth, it's not near-english, it's in english, but that's about as close as it gets.

    Near english would be: "Make a big box that the user can drag some tracks into, and arrange how they would like. Then make a big button with the words "import into iTunes" on it. When this button is pressed, transfer all of the files from the box, into iTunes in the order specified - making sure to add track numbers to each track in order".

    Which is basically the thing I want to make.

    But at the same time, I do want to break into programming, so I guess obj-c would be a good place to start :)

    EDIT: I forgot the point I was trying to make! Which was that you write an AppleScript in English, you have to learn a whole new way of writing english. Which defeats the point. I'd rather go straight into Obj-C

    (Oh, and iMeowbot, plinden! I believe we have crossed paths before - but I didn't know this was where you hung out! )
  16. macrumors 68020


    The English language is a pretty complicated thing...compromises are needed...
  17. macrumors 68040


    Gee I didn't realise there were so many Apple languages to learn. I thought as a hobby over the holidays I could try and learn a programming language for macs. I did a LITTLE visual basic when I was younger but nothing major. I wouldnt mind learning javascript or C++ I'm going to ask a REALLY stupid noobie question *waits for people to pounce* but what compiler do you use to write those languages? I literally know nothing about programming but I would like to do some :)
  18. Moderator emeritus

    Natural language programming has never been successful. Compromises must be made to facilitate effectiveness. AppleScript is pretty useful, regardless of level.

    When your tiny 20 minute AppleScript application requires months in Objective-C or some other language, you start to realise that simple tasks are better out of the way. :)
  19. macrumors 6502a


    Uhm, why on earth would you want to number the tracks themselves? You can create a playlist in iTunes in any order you want without changing the file's on-disk name at all.

    You should think of iTunes as a "Finder" for music files (and videos, and podcasts, and...). What the file is named on disk is almost immaterial as iTunes *knows* what and where all the files are.

    Are you trying to kludge some DJ-ing software into existence? Or what?

    I often read about people wanting to manage the *files* iTunes uses/creates for some reason instead of managing the *playlists* and smart playlists, which makes the most sense (to me, at least, and I have been using computers a long time). Files on disk are just an implementation detail for music these days.

  20. macrumors G3


    There is a track number field in the iTunes database. If you rip music from vinyl or tape, or from a CD that isn't in CDDB, it won't automatically be filled in. So, if you want to play that album in its original order, you have to fill in the numbers.

    A little program to help with that task makes oodles of sense.
  21. macrumors 68030


    1 - Programming is awesome, you can control any aspect you'd like of your application as long as you know how to.
    2 - A good book and a great place to start is to buy the book Programming in Objective-C by Steve Kochan
    3 - After learning Objective-C play around with it, make some test apps, learn the flow and use of Objective-C
    4 - After that get the book Cocoa Programming for Mac OS X by Aaron Hillegass to learn how to make GUI apps.

    Any time - Ask questions here on the forums, send myself PM's, cotact me on AIM or MSN and I can give you advice or tips - or I can refer you to someone else and have them help you out.

    5 - Read the Apple Documentation for the intricate parts of your apps, such as how to interact with iTunes, QuickTime, etc.

    To get you started here's a simple app that just display's "Hello World!" - it's file type is .m which is an Objective-C file, but its C Programming - don't worry when you read the books you'll find out the difference.

    #import <stdio.h>
    int main()
     printf("Hello World!\n");
     return 0;
    When you execute this program this is what happens:
    [i]computer-name[/i]:~ [i]username[/i]$ ./a.out
    Hello World!
    [i]computer-name[/i]:~ [i]username[/i]$
    EDIT: In response to the title of the post, I personally define programming as the way a user uses code that tells the machine to execute specific operations depending on an algorithm. -- its somewhere on that line - you use a language to communicate with the machine components - e.g. video output, print output, keyboard input. and you can execute specific items depending on the algorithm that is defined in order to achieve a result.
  22. macrumors 68000


    I have never used Python or Ruby, but I keep hearing that Ruby has great potential, and that it definitely has a bright future. I heard that from the creator of The D programming Language during an interview.

    Oh, and as for the greek characters, I think this site, has not support for greek characters.

    **Giati, ti eixes grapsei kai emfanistike me erwtimatika?**
  23. Moderator emeritus

    Γιατι, τι ειχεσ γραπσει και εμφανιστικε με ερςτιματικα?

    Does that work for you?
  24. macrumors 68000


    WTF is going on here?

    Oh, here it is!

    Skeeball236, γιατί, τι είχες γράψει και εμφανίστηκε με ερωτηματικά??
  25. macrumors regular


Share This Page