Mac Programming, Xcode....ahhh

Discussion in 'Mac Programming' started by yettimillan, Sep 8, 2009.

  1. yettimillan macrumors regular

    Joined:
    May 28, 2009
    #1
    Hi,

    I really wan't to get into programming, I love my mac and just want to be able to create some simple basic apps of my own.

    The thing is I don't really know the first thing about programming, I don't really understand how it all works.

    My question is could someone please explain to me how it all works and how they got all of their knowledge about it. Would it be possible to learn the basics online by myself or do I need to go to college for that?

    Im really enthusiatic about this so I don't mind spending a little money on a book if that will help but i am only a student so free would be best.

    Thanks, I hope someone understands and can help :)
     
  2. yoavcs macrumors regular

    Joined:
    Apr 7, 2004
    Location:
    Israel
    #2
    Steps to becoming a programmer:

    1. Understand that this is a LONG journey. You won't be a programmer three weeks from now. Not even three months. Maybe, if you are real diligent, you'll be an OK programmer 3 years from now.

    2. If you want to do it right buy a book. Fame costs blood and sweat.

    3. Search for Stephen Kochan's Objective-C book on Amazon, or get the C and Objective-C books from apress.com

    4. Move on up from there. Step 3 is enough to tidy you over for a few months.

    5. Reread #1.

    6. There are no free lunches.

    7. There is no spoon.
     
  3. yettimillan thread starter macrumors regular

    Joined:
    May 28, 2009
    #3
    Well ok...I understand its gonna be a long road.

    But could you please explain to me the steps I have to take and what objective-C actually is.

    Thanks
     
  4. mongrol macrumors regular

    Joined:
    Jul 16, 2007
    #4
  5. yettimillan thread starter macrumors regular

    Joined:
    May 28, 2009
    #5
  6. Rhalliwell1 macrumors 6502a

    Joined:
    May 22, 2008
    #6
    i would start learning java first but don't expect to be programming anything other than command line programs for a few months.
     
  7. yoavcs macrumors regular

    Joined:
    Apr 7, 2004
    Location:
    Israel
    #7
    I already did. Buy a good intro to Objective-C bbok. That's the language one uses to program Macs and iPhones.

    The Kochan book will take you by the hand from step 1.

    The Apress book is Objective-C only so you need a good C book too (which they also sell), seeing as how C is the language on which Objective-C is based.

    Just buy one of the two book sets I listed and go from there.
     
  8. dawnraid macrumors regular

    Joined:
    Nov 9, 2007
    #8
    The way I went about figuring things out was, to do a degree in computer science!
    I learnt slowly with java, then C and C++ and now im just starting to write apps for the iPhone, and that all started 4 years ago. Do not underestimate the complexity of programming even in high level languages like Objective-c.
     
  9. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #9
    Start by spending a little time on Wikipedia.

    http://en.wikipedia.org/wiki/Programmer

    http://en.wikipedia.org/wiki/Computer_programming

    And remember, follow the links in the articles. If you come across something that doesn't make a lot of sense, skip it and come back later.

    A lot of learning to program is learning how to skip details (and what to skip) because you don't need to know it in detail yet. In fact, much of programming revolves around using an appropriate level of abstraction for a given task, and being able to change levels of abstraction as needed. An ability to mentally navigate between levels of abstraction without getting lost is a quintessential programming skill.

    You can start programming using AppleScript. Or use Automator. There are also languages like Python provided in the basic OS install. You can find references with google, and books by searching Amazon.com. Being able to track things down from only the barest of clues is another quintessential programming skill: it's the essence of debugging.
     
  10. Heinekev macrumors member

    Joined:
    Feb 19, 2007
    #10

    I'm on a similar path, but I have a bit of familiarity with programming (tinkering with Visual Basic as a kid, and Quake C ironically enough). I've always been employed in technology, currently a network engineer at fortune 6, but have never really been able to find that "breakthrough" into programming.

    Just a quick note: I prefer a hardcopy book to electronic documentation, so much of what I am going to recommend are physical books. Don't, however, overlook the power of Apples own documentation. It's highly technical, dry, and loaded with details... but it's invaluable. I have spent many nights combing through Apples official documentation to find out what I was doing wrong, and very rarely have I left without a solution.


    When the iPhone was first released, I figured what the hell and bought the Beginning iPhone Development book from Apress. Predictably, it was way over my head, but it did pique my interest in programming again.

    Let me be the first to say that programming books have come a long way since I first cracked one.

    I bought Learn C on the Mac by Dave Mark (apress) a few days later, and quickly went through it. He clearly explains all the basics of the C language, gives the technical details behind variable types and lays a very strong foundation with which to begin to learn Objective-C on. I've tried to work through many books on C, and have never come close to getting it. His chapter on pointers is spot on. This book was the breakthrough I needed. My only gripes with the book are that it doesn't really go into advanced topics in detail (binary trees and recursion for example). It goes far enough to tell you what they are, but that's it. Those are important data structures, and I'd encourage you to pursue that on your own... but they aren't essential to begin developing software on the Mac.

    Cocoa and the iPhone SDK are based in Objective-C, so that's where you'll want to focus next. Objective-C is a superset of the C language, meaning it just adds on a ton of features (and makes life easier!) to C. That also means that you'll have to have a good handle on C before tackling Objective-C.

    After I finished Learn C on the Mac, I picked up the follow-up book Learn Objective-C on the Mac by Mark Dalrymple and Scott Knaster (apress). It's a little more dry than Dave Marks book, but presents all the basic ideas behind Objective-C clearly and by the end of the book, I feel I was fairly proficient in the basics of Objective-C programming.

    It's extremely important that you do the exercises and follow along with the code. It'll solidify what you are reading.

    But C and Objective-C are just languages. To really begin to make things happen, you'll need to know Cocoa, a set of Mac and iPhone specific APIs. Each window, button, textfield, etc is a Cocoa class. Objective-C is the language Cocoa is written in, which is why you need to be proficient in the language to take advantage of it. So understand that learning the language is the most basic prerequisite to beginning to program the Mac.

    So where does that leave you?

    To learn Cocoa, pick up "Cocoa Programming for Mac OS X" by Aaron Hillegass. That book is widely considered the Cocoa bible. Every Mac programmer should have a copy of that on their desk, if even just for reference.

    If you are interested in iPhone programming, you'd be hard pressed to find a better book than Beginning iPhone Development: Exploring the iPhone SDK by Dave Mark and Jeff LaMarche (apress).


    Hope that clears things up a little bit for you. I'm still learning myself, every day is a new discovery. It's fun, exciting, and has me interested in technology again. My career has long since burned out the nerd-spark in me, but learning how to develop on the mac has rekindled it :apple:



    Learn C on the Mac (Dave Mark)
    Learn Objective-C on the Mac (Scott Knaster, Mark Dalrymple)
    Beginning iPhone Development: Exploring the iPhone SDK (Dave Mark, Jeff LaMarche)
    Cocoa Programming for Mac OS X (Aaron Hillegass)

    Apple Developer Site:
    http://developer.apple.com
     
  11. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #11
    You MUST get a beginner book. Programming in Objective-C by steven kochan is perfect. Then read Programming in Objective-C by Aaron Hillegass.
    Steven Kochan covers the basics of terminal and iPhone development. Aaron Hillegass covers advanced GUI coding. But reading these books would only teach you the basics. You need to practice practice practice.

    Learning C is a step in the wrong direction. C is not object orientated.
     
  12. Joyus macrumors newbie

    Joined:
    Aug 17, 2009
    #12
  13. Heinekev macrumors member

    Joined:
    Feb 19, 2007
    #13

    I disagree. Objective-C is based on C, and C is still heavily used. Skipping C will leave you with an incomplete understanding of what you're working with. Being Object Oriented really doesn't come into play.

    Learning Objective-C first is like learning how to run without learning how to walk.

    C is a basic enough language and it shouldn't take you more than a couple of weeks to have a good hold on all the concepts. That's not implying that you're going to be belting out enterprise class C applications after a few weeks, but you'll have the foundation knowledge of pointers, arrays, structs, signed and unsigned integers, file I/O, and general use things like precompiler directives. That is vital to beginning Objective-C in my opinion.
     
  14. foshizzle macrumors regular

    Joined:
    Oct 17, 2007
    #14
    I'm in my 3rd year as a ME major, but i've started a CS minor/(hopefully) Double major this semester.

    The flow of classes is java(now)-> C -> C++, then I'm not sure, but I know they don't teach anything mac around here.

    My question is this: With snow leopard having come out, will any of these books be updated anytime soon? I've got the Objective-C by Kochan, but does anyone expect the Cocoa book to be updated, or anything new to come out detailing any of the new technologies within Snow Leopard?
     
  15. sanPietro98 macrumors 6502a

    sanPietro98

    Joined:
    May 30, 2008
    Location:
    28.416834,-81.581214
    #15
    To really understand programming, you really need to understand how a computer works. I'm not talking about the icons and mouse-clicks, and window behaviors. I mean you need to understand how a computer handles memory, understand what an operating system does for your application.

    Then you need analysis skills. Learn how to look at a problem and break it down to its most atomic, constituent parts, then solve those smaller problems, and put your solutions back together.

    You'll need to learn the "control structures" of programming, such as loops, if-then-else statements, subroutines (e.g., functions, methods).

    This is all programming language independent. Once you understand the concepts, the language you pick (like Objective-C) is secondary.

    Get a good book.
     
  16. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #16
    Aaron Hillegass told me he didn't have any plans to re-write "Cocoa Programming for Mac OS X" for Snow Leopard (I took a class from him in June), but I believe he's in the process of updating his Advanced OSX book for the 10.6 release. I think you're safe with the current version of "Cocoa Programming for Mac OS X".

    I'm pretty sure Aaron said he's working on a new text that would fall between his "bible" and his advanced book to be used as the textbook for his "Beginning Cocoa Bootcamp II" class at the BNR. You can check out the syllabus for that course to get a sense of the topics such a book might cover.
     
  17. zippyfly macrumors regular

    Joined:
    Mar 22, 2008
    #17
    Sorry, obviously we have many opinions here.

    I don't agree with some of them.

    I don't agree you should start with BASIC. It is a terrible language to learn. Forget it. I know BASIC inside out, and it's screwed me up. (I had no choice when I started learning because back then we had BASIC and then we had Assembly Language -- I know both). Fortunately I have almost forgotten basic. At least, no more line numbers for me ;-)

    I also learned Pascal and Java by myself. Both useless (for me). You can learn a lot from books (I did) but in today's world we get... YOUTUBE!

    This is how I suggest you start: Go to YOUTUBE and then search for "STANFORD PROGRAMMING METHODOLOGY."

    That is the best way to start for free. You won't believe the quality of the education you are getting for free. I am so envious of you kids. I wish I had this stuff when I was a teenager (I did not study computer science in university because I wanted to study something else that I did not already know, how crazy is that hahaha).

    Be sure to dig around and find out the web page to download the Eclipse software so you can have a FREE environment to learn Java.

    In my opinion, Java is pretty useless on the desktop (but good as a server language) but it's great to learn with, especially Object Oriented concepts. (No offense to the Java gurus here.)

    After that, do the objective-C stuff that people here have mentioned. You might actually want to learn C first (like the structs stuff, etc.) because despite what people say, I think it's still confusing if you don't understand the basics and jump right into Obj-C's paradigm.

    You need the basics. Linked lists. Data structures. Binary trees. Basic "design patterns". Stuff like that. You won't know what I am talking about but you will after all that.

    Good luck and I don't think it will take 3 years to be an OK programmer. If you really are into it, I think a year or two is fine. The trick is to be so interested in it that you are always interested to learn more and more and more until you have no social life. Hahaha. ;-)

    By the way, even with all this computer background behind me, I still got tripped up by the unintuitive syntax of pointers (not the concept but how it is written sometimes in code) so don't worry if it seems confusing. Just keep at it.
     
  18. zippyfly macrumors regular

    Joined:
    Mar 22, 2008
    #18
    By the way, and this might not even be a problem at all, but you need to be "OK" with basic algebra. And basic geometry. Unless you're doing advanced maths computations, basic algebra and geometry are sufficient.
     
  19. Maxpilot macrumors member

    Joined:
    Jun 24, 2009
    Location:
    Midwest
    #19
    Install XCode on your Mac and dive in! Download and compile as many sample apps as you can to see that they do. Open the source code and look at it. Experiment by changing the code and see what happens. Add extra windows and controls to the sample apps and see what happens. You can't hurt anything.

    I teach pilots how to fly too. I tell them the same thing. Pull back on the wheel and see what happens. Turn the wheel a little and see what happens. Push the wheel forward and see what happens. You get the picture. Learning is the result of experience. So dive it and start experiencing it! :)
     
  20. starbucksroger macrumors newbie

    Joined:
    Sep 10, 2009
    #20
    diving into xcode python

    hey i'm a newbie and would like to play around with python on xcode. I open up a new project for cocoa-python (there are a few options), and there are two sources main.m and main.py. i've tried deleting the code and typing in a basic hello world print ('hello world') but it always seems to break. for coding in python in xcode are there certain files where the code needs to be typed? is main.m in c, and main.py a link back to main.m?

    any help would be great. basically i just want to be able to use xcode to fool around with python and get some simple programs to work. maybe a one (select this project), 2 goto this file and type python code here, 3 build and go.
     
  21. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #21
    A REALLY quick and easy way to try out python is to simply type in "python" into the terminal and you're ready to run python commands.
     
  22. newb16 macrumors regular

    Joined:
    Feb 27, 2008
    #22
    It's possible and you need not. However there are (probably) good online guides and there are (for sure) bad ones, and when you still need them, you can't tell good ones from bad ones.
     

Share This Page