Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've recently started to work on some iPhone apps, starting from a base where I had essentially no programming experience (I studied Maths & had very few programming modules)

I worked my way through Beginning Mac Programming: Develop with Objective-C and Cocoa and found it useful, while it gave me the feeling that I needed to quickly address my lack of a real foundation in programming.

For the forseeable future my work will involve developing iPhone apps - I want to have a real grasp of objective-c before things get more pressurised in the coming months.

Is my best bet to study c first of all, before worrying about the finer points of objective-c?

If so has anyone had any experience teaching themselves through an online resource? It would be great if someone could recommend a website with which to self-teach c.

Sorry if this covers some old ground but nothing in the similar questions quite answered my question.

Any help is greatly appreciated :)

share|improve this question

5 Answers 5

up vote 4 down vote accepted

May I recommend K&R.

It is a C programming standard. The book has many exercises and most of the exercises are solved on the web so you can get help when needed. They even have an answers book (sold separately)

The C Programming Language (Brian W. Kernighan and Dennis M. Ritchie) ISBN 0131103628

This will teach you the lower level stuff, then you can appreciate the high level convenience that the iOS SDK offers.

To improve you objective-c skills in general stick to the basics. Classes, Memory-management, and read the ViewController Programming guide.

Here is a step by step plan for you.
1) Create an app that you find useful and slightly challenging.
2) Goto step 1)

Before long you will realize what resources you need to improve (whether it is a more solid C programming background, a wider understanding of the available classes within the iOS sdk, or a deeper knowledge of Objective-C and object oriented programming)

share|improve this answer
    
Thanks for the help, I hadn't reaslised there was a compact guide to the ViewController, I'll check it out –  Octave1 Jan 15 '12 at 19:22

Programming knowledge is incredibly versatile. If you know how to program, then picking up a language (like objective-c) is as easy as learning the syntax - which you can often find in seconds with a good search engine.

Don't get too caught up on what language you're learning, but what information you're learning. Having graduated(?) with a math emphasis I would feel pretty confident in saying that you have a good grasp of logic, so I'm guessing you have no problems with your standard branching (if, else, functions) and looping (while, for, for-each).

If that's the case, then you'll want to get a good grasp of the other more important concepts (not important because you'll use them more often, but because being able to grasp these other concepts helps you everywhere else). These are some things that helped me:

Concepts/Algorithms

  • Pointers
  • Recursion
  • Tree traversal
  • Sorting
  • Prime number generation
  • Closures
  • Monads (still haven't wrapped my head around this one)

Sorting

  • Quicksort
  • Bubble sort

Data structures

  • Arrays
  • Dictionaries
  • Linked Lists (single and double)
  • Hashtables/dictionary
  • Sets
  • Trees (binary, balanced)
  • Circular arrays
  • graphs

The issue with these isn't to say "Oh yeah, I can write X feature" but that they teach you how to think about issues that crop up in programming. So far I haven't written one single linked list, hashmap, or graph traversal. Heck, I haven't used pointers or iterators really at all (at least not the C/C++ variety). I don't even think that I've used recursion. Granted I've been out of school for less than a year... but I definitely credit my current skill and successes to the foundations I laid in school.

share|improve this answer
    
Cheers, it's reassuring to know that learning the concepts is the important part, & that the languages follow after that. –  Octave1 Jan 15 '12 at 19:20

When you mention you need to bolster your programming foundation, I think of language agnostic things like basic logic/reasoning/algorith skills (being able to take a problem and split it into logical steps so you can walk the computer through performing the tasks) and fundamental programming concepts like flow control, value vs reference types (heap vs stack), etc. Since it sounds like you will be mostly working with Obj-C, I'd add in basic OOP concepts as well (what is an object? inheritance, polymorphism, etc...)

Any language (with the caveat that you obviously need to use an OOP language to practice OOP concepts) will help you learn the above. Additionally, there are many non-programming related tasks I like to do to work on my logic - learning more about math, solving brain teasers and puzzles, and learning how to think and solve problems in an efficient manner.

Now, if you have a need to learn Objective-C, there's no reason not to study that exclusively for awhile. At some point, it will definitely be in your best interest to branch out and study a number of languages - my path has taken me all over the place. Obj-C, C, C++. C#, Java, PHP, etc...). The more languages I study, the more I can see and appreciate the pros/cons of each one, and understand why you would use one over the other for a particular project.

However, since you say you will be programming iOS - start with that. Pick up books that focus on iPhone projects. Learn the APIs and methods available to you. There are a ton of great books, blogs, tutorials, etc... which focus on iOS apps and their particular constraints (for example, no garbage collection means you have to be very aware of releasing objects after you are done with them, and understanding retain counts).

Start with what you need to know, and let your curiosity guide you.

share|improve this answer
    
I've taken your advice & started to get down to basics with Objective-C, it's given me a lot more confidence as I program my first real application. I plan on checking out a Cocoa guide next. Cheers :) –  Octave1 Jan 15 '12 at 19:26

Start with objective-C material first - you'll learn a little C in the course of doing that, but for the iPhone you probably want to just do everything the Cocoa way. Learning old school C will not be very useful for that, and will probably just be confusing.

The basic concepts will be similar in both languages, but there's no point in learning two ways of doing things right off the bat - get comfortable with one, then explore alternatives.

share|improve this answer
1  
Thanks for the advice, I've been reading programming in objective-c (Kochan) & have found it very good so far, clearly explained concepts & short to the point exercises. I think the little bit of experience I gained over the past few months has helped speed my progess :) –  Octave1 Jan 15 '12 at 19:15

I myself do come from a similar background, after completing my Btech(BE) in Mechanical it took some time and research for me to get into Programing world (Computers).

I think read Objective C than C, because there is a difference in the way you would think in C and in objective c and From My opinion if you understand Obective C, it would be easier for you to go thru C language concepts.

Apart from that: There is a constant need of Learning and you may need to connect those dots. Be a part of a Group where you can discuss any thing (StackExchange for e.g.)

  1. Do lot of Google / Stack Exchange / Stack Overflow for any curious question. There is lot of content available online.
  2. Understand the concept of Memory in an Operating System. Ram VS Hard Disk Memory. Understand how a source code (in any language in general) is converted to an Executable. Don't go into the details, but get a feel of whats happening inside the box.
  3. Understand Objective C first, give importance to the concepts then to syntax. But Yeah be familiar with one language syntax also. Then move Cocoa framework, using which you would be able to do iphone /ipad apps. For that you have Apple Programing Guide, which covers all of it in details and in depth.
  4. Understand and read about Data Structures, understand what it is and why do we need it, try to use your knowledge in objective c and practice data structures. Eg. try to create a linked list using objective c. Try to write your own implementation of NSMutableArray and NSArray.
  5. Later read about algorithms and understand the concepts there.
  6. Try to solve puzzles (use programing if required).Be good with Logic and thank your Brain for always being there for you!!!
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.