Learning how to program

Discussion in 'Mac Programming' started by gsrol, Jul 11, 2008.

  1. gsrol macrumors newbie

    Joined:
    Jul 10, 2008
    #1
    Hello forum,
    This is my very first post and will get right to the point.
    First, I have no programming experience at all.
    I want to learn how to program using Xcode.
    I'd like to do it at home self paced and I also understand that this is going to be a very long journey and I'm ready for it.

    So, I ask you for suggestion/inputs and please don't hold back. If it's not possible I'll understand.

    If it is possible, since I'm on 10.4.11, would the latest version of Xcode be 2.5to download?
    And does it include everything I need?

    Thank you all for reading
    very much appreciated
     
  2. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #2
    If you have no programming experience, then forget about xCode, Cocoa and programs with a graphical interface (GUI). Start simple. You are right, it's a long but interesting path you are about to embark on.
    I recommend you start with a plain text editor (one that can do code highlighting (coloring of the syntax) is nice) and the command terminal. Type the code in the editor, compile and run it on the terminal. Just plain text input and output. Obj-c is a nice language to start with, and which is used by apple and Cocoa. However xCode is not limited to obj-c. You could also use it with java, c++ or plain c, among others.

    You could even start with something like php or perl to learn the basics of programming.

    First learn the syntax of your chosen language and basic programming stuff (loops, conditionals, etc), then start playing with user input/output to the terminal and file input/output. There is a lot you can do, without having to resort to a GUI. A GUI just ads unnecessary complexity.

    The first language you learn is the hardest. Everything is new, lack of experience, etc. The second and third language, you pick up faster and faster.
     
  3. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #3
    I agree with MrFusion. Before learning Cocoa and Objective C (that should be your final goal) you should learn something else. BASIC is the easiest to start off with but I'm wishing I never knew it existed because I picked up so many bad habits and learned terminology wrong. C is probably the second easiest, it's the most common, and Objective C just adds to it so I 100% advise you learn C first. (Don't get C confused with C++, two totally different languages really)
    Since you have no prior programming knowledge, you should probably get to know C pretty well to pick up everything you need to know. Like I said, I come from a BASIC background so I already knew a lot of general programming stuff. So when I got to C so I could learn cocoa, I only learned the basics. (How to create a variable, loops, if-endif, structs, that stuff) I can't really tell you HOW far to go with C, but at least be comfortable with it. If you find out you're not ready for cocoa yet when you try it, you can always continue with C and try again later.

    post-note: I just remembered something I wish I had known about before... my favorite all time tutorial is BecomeAnXcoder at www.cocoalab.com/. This tutorial not only assumes you don't know C, it assumes you have NO PROGRAMMING KNOWLEDGE prior to starting the tutorial. You'll learn programming basics, you'll learn C basics, you'll learn how to use xcode, and you'll learn objective C and cocoa. I wish the tutorial was longer and covered more because I love it so much but it's only a small introduction but it'll prepare you nicely.
    I have to tell you one more thing about that tutorial though. Unless it's been updated very recently, the pictures it shows of xcode will be a little off. But don't worry, if you have half a brain you'll be able to figure out the slight differences.

    Good luck!
    Nate
     
  4. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #4
    I am not sure you have to start with c, before tackling obj-c. I didn't for example, but I did came from java, and pascal before that.
    Kochan, in his book on obj-c, for example also says you don't have to know c before starting with obj-c.

    But this is an old and long discussion, on which many threads can be found on this forum. You could find a few of those threads, to help you decide which path to choose, before we start repeating this old story again.
     
  5. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #5
    Oh I know you don't have to, there are plenty of paths to objective C and cocoa. But it is my experience that C is the second easiest language to learn, and it's also the closest to objective C so it IS a natural place to start especially if you have no prior programming knowledge. But I agree lets not turn this into a debate :rolleyes:
     
  6. newb16 macrumors regular

    Joined:
    Feb 27, 2008
    #6
    Given that OP stated "no programming experience" - with regard to operators, arithmetic, control, loops - c, c++ and objc are equal. And I would recommend to know some C pointers knowlendge just to eliminate questions like "why my NSArray*a; a[10] does not fetch 10th element of array"
     
  7. Enuratique macrumors 6502

    Joined:
    Apr 28, 2008
    #7
  8. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #8
    enuratique I get your point, but I disagree to an extent. /underline
    1. Everyone's case is different. Each of us has a different programming background, whether we're from the same language but different versions or levels of expertise, or we learned something wrong so it doesn't matter WHAT language, etc..

    2. When I start a new thing, for example a new programming language, I don't want to just find some tutorials and start. It's a lot better to be able to talk to others, even if they will just tell you the same thing.

    That being said, we ARE getting a bazillion and one new threads asking the same exact thing. :D
     
  9. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #9
    enuratique I get your point, but I disagree to an extent. /underline
    1. Everyone's case is different. Each of us has a different programming background, whether we're from the same language but different versions or levels of expertise, or we learned something wrong so it doesn't matter WHAT language, etc..

    2. When I start a new thing, for example a new programming language, I don't want to just find some tutorials and start. It's a lot better to be able to talk to others, even if they will just tell you the same thing.

    That being said, we ARE getting a bazillion and one new threads asking the same exact thing. :D
     
  10. Enuratique macrumors 6502

    Joined:
    Apr 28, 2008
    #10
    I agree with your sentiment. This has been (and hopefully will always be) a fantastic resource for programmers getting stuck on something. I've just seen lately there are a lot of people with little to no experience coming in here wanting to develop for the new hotness. Even if we tell them what they should learn first (C/C++/ObjC/etc) and where to look for resources - odds are they have no interest in that and just want to know how to get cracking on iPhone development without investing the time and energy into learning how to program well first. One of the first skills you hone in a traditional CS program is how to look in to documentation and what not. If people are so jet set on programming for the iPhone, why not go straight to the source - everything you need to know about how to program for the iPhone is there... Unfortunately these are people who haven't been trained to look first and ask second; and when they're told to read the Objective C 2.0 Programming Language Reference, they see it as a chore and just won't do it, preferring to ask "how do I ....." or "why is my program breaking...." questions each step of the way.

    That being said, I wouldn't mind the one-off questions if people had just searched first...

    Just my $0.02
     
  11. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #11
    This is very dependant on what you mean. If you mean learning the C language is easy then yes you are correct, there are very few keywords in C. You could learn them all in an hour (or less). If you mean learning to program in C then I would argue there are a whole host of languages out there that are easier to learn and still enforce good programming technique. Python would be a prime example.
     
  12. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #12
    incremental learning

    My suggestion for someone who has never done any programming, and doesn't currently plan a career as a computer scientist, is to start with some language that has simple basic syntax which allows you to start writing just a few lines of code that can do something interesting.

    Try some simple Javascript on a web page, maybe with one of the "hello word" tutorials. Or try a simple Basic interpreter, there are several available for the Mac and even online:
    http://www.nicholson.com/rhn/basic

    Then switch to C and Obj C after you are already comfortable with writing more than a page of code. There are lots of online tutorials, but the path is a little steep if you don't even know how to add two numbers or display your name yet using code you've written.
     
  13. Denarius macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #13
    I never actually learned C in its own right and am picking it up as I go along while going through Cocoa Programming for OSX. That said I started programming with PHP about 2 years ago and am finding that my PHP knowledge is making it pretty straight-forward to get the hang of the C fundamentals behind Objective-C and the Cocoa framework as, by sheer luck on my part and not judgement, PHP turns out to be very C-like syntax wise: the only significant thing that I seemed to be missing was the c-struct and that's not a big deal really (actually seems pretty similar to an object itself on the whole).

    Anyway, bottom line is, starting off with object-oriented PHP'll set you up well for Cocoa, plus you'll have learnt how to make dynamic websites to boot.:)
     

Share This Page