Should you memorize syntax or know how it works?

Discussion in 'iOS Programming' started by Simmons, Jan 14, 2010.

  1. Simmons macrumors newbie

    Joined:
    Dec 28, 2009
    #1
    I have read Beginning iPhone 3 Development (by Dave Mark and Jeff LaMarche) and I can't really make an app on my own. If I see the syntax I understand what I am reading, but I can't think of it when I am doing my own programming. Should you memorize what to put where or do you just know what is what and where to put it. I also what to know, is it normal not to be able to do it at this stage of learning? Is it like guitar where you can play tabs all day long but after a while you will get your own style and can just jam?'

    Thanks,
    Simmons
     
  2. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #2
    If you're talking about learning the Cocoa frameworks, it's going to be a lot of memorization (method calls and class names). You can get a "feel" for different design patterns (like delegation) that will help you to "play by ear", but you will always be referencing the documentation to look up methods that you just can't quite remember.

    The actual Objective-C (and straight C) syntax comes to you with practice.

    I'm not sure that "memorizing" the Cocoa frameworks is really a great way to approach learning Cocoa programming. I would focus on getting a feel for design patterns and the Objective-C syntax.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    This seems a little troubling. Is it the specific syntax (method names, properties) for what you are trying to achieve that confuses you? If so, Code Sense can be a big help in this area. As can being able to access the Developer Documentation directly from with the code (Option + double-clicking a symbol, if you've never tried it). If it's just a general discomfort with syntax, I fear there are deeper issues at work here. After having read that whole book you should at least be able to be creative enough to have ideas of things you want to try that are not specifically covered in the book. Perhaps you might want to pick up a copy of Stephen Kochan's "Programming in Objective-C 2.0", which has exercises at the end of every chapter. These give you direction in other things you may want to try without giving you the answers. It covers only Obj-C mostly but should help you to become more comfortable with thinking beyond code given to you. Hope that helps.
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    You shouldn't just READ the book you have to do the exercises also. The next step is to write an app yourself. Pick a simple app idea and do the whole thing.

    Memorizing UIKit isn't how it's done. You need to understand the underlying principles. Copying code from something you wrote before or from Apple's sample code or from the web somewhere is something you'll do a lot of. But you need to fit it into your current app design and make it work.

    Different musical styles demand more or less improvisational skills. All demand technical skills. If you want to learn Jazz guitar or Rock lead guitar you need to learn improvisational skills. If you want to play rhythm guitar it's mainly just technical skills. To write iPhone apps you need both technical skills and improvisational skills. More like Jazz or lead guitar. Obviously you need the ability to write music not just play it.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    To which book are you referring?
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    Beginning iPhone 3 Development.

    But I will admit that I don't have the book. Doesn't it have any homework?
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    Nope. I seem to recall a few suggestions of "try this..." but nothing close to Kochan's chapter-ending Exercises.
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    OK.

    My main point though is that if you've read the docs then it's time to start in on a simple app. Expect to go back to the docs and the books you've read for clarification. That's normal.
     
  9. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #9
    everyone's learning curve is different, but you will learn if you continue. read as many books as you can. besides Programming in Objective-C 2.0, which was suggested, there are a few other iPhone SDK books being released very very soon such as the sequel to the book you already have, "More iPhone 3 Development: Tackling iPhone SDK 3", as well as "Beginning iPhone Games Development" just to name a few.

    after studying programming part-time for the past 2 years, i recently has a sudden realization concerning one aspect of object oriented development that seriously changed everything for me. quite literally overnight it all became so much more clear. i'm not going to say what it was because it's embarrassing :eek:, and i probably should have realized it much sooner, but that's the way it happened to work out for me.

    also, i remember feeling overwhelmed by apple's documentation when i first started trying to read/use it, but now i'm trigger-happy with Option+double-click. the docs are invaluable.
     
  10. Simmons thread starter macrumors newbie

    Joined:
    Dec 28, 2009
    #10
    Well, I understand the syntax fully, but if I were to try to sit down and write an app with no help than I don't think I could do it.

    Although, while I'm here I do have one question about something that wasn't explained fully in my book, which is the asterisk (*). What does it mean? For example:
    (NSFetchedResultsController *)
    NSString *sectionKeyPath
     
  11. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #11
    I think it is a little irresponsible for a text to give you code like that without explaining what a pointer is.

    The asterisks are pointers. This is straight C, not Objective-C.

    Pointers were one of the hardest parts of the C language for me to learn and it sounds like a lot of people have a hard time getting their head around it.

    In addition to your current text, I strongly recommend picking up a C reference.
     
  12. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    The "Beginning iPhone Development" book assumes you are familiar with Objective-C and even says so in the Chapter 1 section "What You Need to Know Before You Begin".

    True, but Objective-C is pretty useless without them.
     

Share This Page