Learning Cocoa. Should I delve into Apple's documentation? - objective-c

I have built some basic apps for iPhone and Mac with a general understanding of Cocoa, but haven't had a detailed understanding. Now I want to go deeper.
I have just finished the Objective-C documentation at MacDevCenter. It was great to get in-depth look but took far too much time, specially because a lot of it is conceptual, and it's hard to build detailed examples to make use of the concepts.
Now I am on to Cocoa, but feel like it would be too much work to go through 250 page documents for Cocoa itself, then KVC, Cocoa Bindings, and Core Data.
Would I be better off at this stage picking up a good book on Cocoa (Hillegass' is too sparse I think) or should I just bite the bullet and go through the docs?

Apple's documentation is generally excellent. The API reference in the very least is some of the best I've read (right up there with Java's API reference), and is a very valuable asset.
I'd suggest reading the overview pages for topics you're interested in to get a general "feel" for how they work and a starting point, and then just start writing code. You can refer to the documentation to fill in blanks that you encounter while writing code.
Writing a small project to exercise your use of APIs you'd like to learn is a great way to get started.

I've found Hillegass's book to be far from sparse. In fact, I've found it to be one of the most dense books on programming I've read. I've re-read most of the chapters at least 4 times, and each time understood more. By re-reading, I've understood the reason he included a certain paragraph and how it fits with the bigger picture. He spells everything out very clearly and doesn't waste words. I'm amazed at the amount that's contained in that book.
You mentioned that you want to learn by doing, instead of by reading. The Hillegass book has a section at the end of each chapter where you put what you've learned to the test, by building an application.
Of the three things you talked about, KVC, Cocoa Bindings and Core Data, the first two are covered very well. I did find the Core Data chapters to be a lot more sparse. That's the only part of the book that I haven't been able to understand without other documentation. The Pragmatic Programmers book covers it much better.
Anyway, the answer to your question is: it depends. If you've managed to work your way through the Mac Dev Center documentation, it may be that you're the kind of person who learns easily from that style of resource. If you like learning from books, the best one is Hillegass.

I'd recommend an excellent book released some time ago: ‘Cocoa Design Patterns’ by Erik M. Buck and Donald A. Yacktman.

Of course you can dive into Apple's documentation, but to me, I found Hillegass' book is a good start for learning Cocoa. The value of the book, I think, is the introduction of the conventions and idioms of Cocoa.
Is it really clear for a new Cocoa developer to find out information on issues like when and when not to send message autorelease to an object? You can argue that a single Googling will do, but how do you know there are these kind of issues in the first place?
Go get a good book, look through it and take notes. It could save your time. For me, on Cocoa, the book is Hillegass'.

Hillegass' book will drive you to the free documentation every time he fails to make sense in order to be "funny" (i.e. every other paragraph) anyway, so unless you just want to give him $40, you will be much better off sticking to what Apple gives you au gratis. At the very least you won't pick up any of his horrible UI design habits.
You don't really need to go through ALL the bindings and Core Data docs page by page--half of it is stuff you'll likely never use. Knowing where to look for more information is far more valuable a skill than memorizing APIs.

The reference is great and invaluable, but might not be the easiest way to start coding (as people have mentioned).
I started looking at the stanford lectures on iphone development, then coded as I went along. I've actually used them as reference once or twice as well... They are available on itunes for free.

It depends on what other programming experience you have and how you learn best. If you're fairly new to programming in general, I'd recommend Hillegass to start. If you're fairly competent at OOP but don't know Objective-C, you can go for Apple's "Introduction to The Objective-C Programming Language" to learn ObjC's language features. If you've programmed using paradigms other than OOP, you could look for general OOP book recommendations here on SO (e.g. "Best Referece to learn OOP independent of languages?"). I also second Jonatan's recommendation to check out what programming videos iTunes University offers. They are recordings of lectures from top-tier universities and generally of good scholastic quality (I only qualify this with "generally" because I haven't seen them all; the ones I have seen invariably were of quality). No matter where you go to learn ObjC and Cocoa, you'll still yourself using Apple's docs as reference.
As you learn, you might also find CocoaDev a useful ancillary source.

Aaron Hillegass's book is the text for his one-week cocoa development seminar, and it has been revised over several years of teaching Cocoa to beginners. Aaron's course is where Apple sends their own employees, now that they don't do the Cocoa course in-house anymore.

Apple's documentation is an excellent reference, but I agree that it's a huge resource to try to learn Cocoa from in the first place. Besides, you probably don't need to know the whole API up front -- just learn each part as you need it.
When I started learning, I just picked a project, sat down and started trying to code. When I ran into something I didn't know, I just googled it, which led to a tutorial and/or the relevant page of Apple's documentation.
In my experience, the best way to learn something like this is, well, experience.

Apple's documentation generally contains excellent API references, but (in my opinion) lacks equivalent topical guides. This makes it a bit hard to follow for beginners (Jacob Kaplan-Moss in the link I just gave makes the point that Python's documentation is like this, but I think Apple's is much more).
My recommendation would be to pick up Hillegass's book, alongside a project. The first few chapters explain fundamentals, so make sure to read those (and do the exercises!), or you won't be able to get far. Then try and implement your project idea; when you reach a wall, look through the Table of Contents and the glossary of the book and see if there's something that covers it. If you find something, use this as an excuse to read it fully and understand it. When you're finished, you'll have both a greater understanding and a project to show for it. Furthermore, you'll know what to search for in Apple's API references next time you try to implement something. This helped motivate me to finish the book, maybe it'll be helpful for you.[1]
[1]: (disclaimer: I have an odd learning style)

Related

Route for learning Smalltalk aka Squeak

Calling Jedi Masters of the Smalltalk universe,
I have knowledge of C++/Python/Perl and have been coding for 5+ years now.
I have to fork Scratch - MIT's Visual programming language to add support for a robotic kit. Scratch is created using Squeak, which is an implementation of Smalltalk.
I am planning to read A Little Smalltalk - By Timothy budd followed by Sqeak By Examples - By Oscar Nierstrasz [http://squeakbyexample.org/]
Do you think this is a good idea ?. What would you suggest ?. Are there free video tutorials I can watch.
End objective is to be able to make sense of scratch codebase. I want to get hang of smalltalk once before I can make sense of the (as of now) weird looking Squeak development environment and its ways.
Luke Smallwalker
Actually, I work with the core developers of Scratch for Arduino! It may be a good start for you to take a look at its code.
I think A Little Smalltalk goes a bit too deep for what you'll need. Squeak by example is, IMO, much better suited as an entry point to the language.
Also, you may want to take a look at Prof Stef for Amber, which is not an intro to Squeak but to Amber Smalltalk. Anyway the syntax is pretty much the same and it will get you a first good idea of what Smalltalk feels like.
HIH, good luck!
[edit] Yesterday I stumbled upon this great article explaining how to read Smalltalk code for Java/C++ developers.
check out my youtube tutorial series Squeak from the very start
http://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=viewall
I have read through "Squeak By Example" and I would say it is very good. I haven't seen "A Little Smalltalk" I think it might be a little outdated because it is from 1987.
after reading "Squeak By Example" I came across BotsInc it might be useful to go BotsInc even though it might seem a bit childish at first. Squeak By Example would be better to understand Smalltalk more fully.
this is a small squeak tutorial that might help too http://scratch.mit.edu/forums/viewtopic.php?id=39196
Stephan B Wessels has a Laser game project that was really useful for me when learning Smalltalk (in Squeak). You can follow and code along here: http://squeak.preeminent.org/tut2007/html/index.html
On to Smalltalk by Patrick Henry Winston is a succinct introductory book that you can get pretty cheaply used at http://www.amazon.com/On-Smalltalk-Patrick-Henry-Winston/dp/0201498278/ref=cm_cr-mr-title

What are the most valuable parts of Computer Science studies for Cocoa developers?

What are the most valuable parts of Computer Science studies for Cocoa developers?
Another way I might word this question is:
If I’m not going to go to school for Computer Science but want to be a developer working primarily with Cocoa, what are the things I should make sure I learn that I otherwise might miss by being self-taught, and be worse off for it.
Update: Replaced the term "professional Cocoa developer" with "developer primarily working with Cocoa", in hopes that the intent of my question is somehow clearer.
To be clear, I've been working with Cocoa for two years and am comfortable with Objective-C and the Cocoa frameworks, as well as Cocoa design patterns and the developer toolset, and thus am for the most part fluent with the Mac and iPhone platforms. But I have wondered whether I'm missing important CS or SE elements due to being self taught/no formal training, and not coming from other languages or platforms.
This question is for Cocoa developers.
There are many, but things that come to mind imediatly
-Design Patterns (the Cocoa framework relies on many Design Patterns, if you follow them it will make your life very easy, most obvious example is MVC)
-Algorithms and Data structures(this applies to any framework really)
-Memory Management (No garbage collection on the iphone!)
I would question whether there's really such a thing as a "professional Cocoa developer" (from a philosophical standpoint), or if you would want to be one. There's "professional developer", who may work with Cocoa primarily. A professional developer is language-agnostic and as such has a solid career ahead of him/her. A language- or platform-specific hacker has very limited usefulness.
The question to ask is do you want to be a developer or not? If there aren't any good Cocoa jobs available at the moment, or Cocoa is replaced by something newer and better and very different, a professional developer changes gears and follows. Are you OK with that?
If so, a computer science degree definitely cannot hurt. If not, you should probably not put all your eggs in the Cocoa basket and pursue a non-CS degree.
In addition to what's been pointed out already, I highly recommend reading "The Pragmatic Programmer". It contains a wealth of information on how to write software, how to manage projects, and how to develop your career, advice that goes well beyond the documentation you look at every day in Xcode. Some of the topics they cover are ones that you might have been exposed to during a standard computer science degree.
"Professional" is a relative term.. but anyways, this is what i had to go through so that i could easily learn a new language anytime i want and also master it:
started by learning a simple console language (pascal or c++, but i consider pascal being simpler than c/c++), then learned another language just to see if i can do it (c++)
i learned a lot of algorithms and data structures, until i was able to recreate them and even create my own
i moved to a visual approach on programming with Visual Basic 6 (another simple one to start with), and tried to copy lots of apps just to see if i can do it
i learned about Object-Oriented Programming and finished by mastering it
from this step on, learning a new language was like a hobby, like playing!
then i wanted to learn some different topics, like design patterns, multithreading, and so on..
moved from windows to mac, and started learning objective-c: because i already knew lots of languages, it took me 5 days to learn objective-c, and yes, i took breaks like any human being :P
after i learned obj-c, i now had to learn cocoa... this one took me a lot of time to learn, and i still don't know it all.. but i do know most of it :D
What are the most valuable parts of Computer Science studies for Cocoa developers?
Learn that it's important to understand the differences between languages, not learning a particular language.
Are you writing numerical method solvers with a Cocoa frontend? You'll want to take numerical methods. Writing a 3-D plugin with a Cocoa UI? Better learn about Catmull-Rom splines.
A good understanding of computer graphics is required if you want to make some good looking animations :)

Open source Objective-C projects with high quality code?

I think one of the best ways to learn a new programming language is to dive into source code and see how experienced coders write. I've found this kind of question asked here on Stack Overflow for other languages, but none targeted at Objective-C. The closest I've found is this question about good-looking Cocoa user interfaces, but I'm thinking in terms of general code quality, such as good use of idioms and design patterns, and usable documentation. Another good characteristic would be a code-base that is large enough to require real organizational discipline, but small enough that a beginner can fit his/her head around.
What do you think is a high-quality open source project that meets these criteria?
There's a decent list of open source Mac projects on CocoaDev: http://cocoadev.com/CocoaOpen
Not all of the projects are still active, but a decent number of them are. I particularly recommend:
BWToolkit - http://bitbucket.org/bwalkin/bwtoolkit/
BGHUDAppKit - http://www.binarymethod.com/bghudappkit/
CHDataStructures - http://cocoaheads.byu.edu/code/CHDataStructures
MGTwitterEngine - http://mattgemmell.com/source
Sparkle - http://code.google.com/p/sparkleplus/
Colloquy - http://colloquy.info/project/wiki/Source%20Code
CocoaRest - http://github.com/sdegutis/CocoaREST
CorePlot - http://code.google.com/p/core-plot/
I've found Adium to be a well-designed and written Objective-C project. It has a huge codebase, too.
I don't think there's any one place to learn all the Objective-C idioms and best practices, but you can pick them up here and there over time and practice. Cocoa mailing lists and blogs are good resources for this. (There are several SO questions relating to that.)
I haven't dived into the source myself, but the Omni frameworks are well-respected in the Mac community.
I work on a framework of my own that's still rough around the edges, but I strive for quality documentation in addition to understandable, well-structured code.
Google Quick Search Box [ qsb-mac - Google Code ]
I think The Google Quick Search Box (QSB) is worth a look. IMHO it's pretty much a cleaner googley rewrite of Quicksilver (Note: N. Jitkoff, the QS programmer, is also involved in the Google QSB).
Apple has tons of downloadable examples on their developer website. You get to see the source, and the license is BSDish from what I recall (use it for whatever, but don't repost original code without the license).
http://developer.apple.com/samplecode/Cocoa/index-date.html
Check Out lots off open source project here.
http://code4app.net
http://code4app.com
https://www.cocoacontrols.com
Here's a test app I wrote earlier today. Download links under “get source” in the top-right.
It's small, but it demonstrates good organizational discipline (separate controller object, instead of everything crammed into AppDelegate), a simple model layer with one model class (Header), and correct use of Cocoa Bindings.
I used to work on the GNUstep sources, they've got a good consistent coding style and the code is well-organised. Of course the project is hardly small, but given that you know what most of the classes do as you've used them in your Cocoa projects it's easy to zoom in on a piece that interests you. Some of the GNUstep Applications Project or Étoilé apps may also be a good place to start.
Check out PSTreeGraph, a view control for iPad applications.
iMedia Browser
, shows support of 10.4 - 10.7 strategies, is neatly and purposefully organized, and deeply commented. inherent problems using ImageKit have been boldly approached and solved.
i aspire to this level of thought mixed with practicality.

How to learn C and Objective-C [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am learning programming. I plan on learning C and Objective-C this summer. I bought the C for Dummies book but it is a complete waste of time. It's way too many pages! Are there any good books I should read? Or should I just learn C from websites? What would be the fastest way because I really want to learn it fast and start learning Objective-C too.
Thank you
Also, how long does it take to learn C? Until I move to Objective-C 2.0
There's no need to rush. Learn at your own pace and find your optimal way of learning.
If reading is your thing, then try to read some books and take it slowly.
If you find a concept you grasp, practice. If you find a concept that you don't quite get, experiment. Once you think you understand the concept, try re-reading the material to see if you understand it the second time.
I found out that I wasn't really good at learning though books -- I generally had to get the first kick-start with a structured lessons in a classroom. A semester course at a community college on Java was able to nudge in the direction of being able to begin effectively learning on my own. See if there are any programming courses offered in your school.
(Although at your age it may be a little bit difficult to find -- I didn't get any formal classes until community college -- my high school did not offer any programming courses.)
One of the things to be careful of is learning it the wrong way.
Rushing through material, or reading poorly written, inaccurate learning material can lead to a situation where you'll need to "un-learn" the concepts and re-learn it the right way.
In that respect, the K&R book (The C Programming Language by Kernighan and Ritchie) would be the "right way" of learning, but it's not a very approachable book. That isn't to say that it is the definitive book on C -- but even after programming in C for a couple years, I still try to take read it a bite-size at a time.
But then again, I can't really think of other "great" sources for learning C. My recommendation would be to take a look at K&R and work on a few pages at a time. Don't think about reading it like a regular book -- read one section, try it out. Do it little-by-little. Once again, don't rush. Work at your own speed.
And be sure to write code. Without seeing it working, it's going to be difficult to learn programming. And don't have huge expectations at first, as most of learning C at the beginning will involve programs that deal with only text.
Once you get a handle of things, try to write clean code that is readable by others -- that should be a motivation to write clean and clear code, and it will force you to think harder about what you're doing.
It's going to be a long adventure, so take it a step at a time. Good luck!
For learning C, I highly recommend Learn C on the Mac, by Dave Mark. Not only is it aimed at beginners, but it also teaches you a lot about the important fundamentals of programming and computer science (e.g. data structures, recursion, etc.). It's very accessible, well-written, and easy to read. Plus, I found the examples engaging and interesting to work with. After that, if you really want to solidify your foundations in C, I'd recommend trying to moving on to The C Programming Language. It's a challenging book, so take it slowly. If you find yourself having too much trouble with it, I'd say you can just skip to Objective-C, and then come back to The C Programming Language later, once you've gained more familiarity with programming in general.
A lot of people will probably recommend The C Programming Language (a.k.a. "K&R") as your first book to read on C. No doubt it is a very well-written C book (and it's short too—only around 200 pages), but I'd say it'd be a little intimidating as a 12-year-old's first exposure to C: it's pretty dense and hardcore. You can tell that it's definitely aimed at an older audience with a strong background in computers/engineering. But nevertheless, if you already know the basics of programming, reading K&R will give you invaluable insight and understanding of C. You should definitely read it at some point in your programming endeavors.
Anyways, for Objective-C, if there's only one book I could recommend, it would most definitely be Cocoa Programming for Mac OS X, by Aaron Hillegass. It's really not that long (~400 pages or so, although I'd reckon that a lot of that is due to the number of illustrations in the book), and you can get some pretty cool projects up and running in an afternoon. It's very clear and easy to read, the examples are practical and interesting to follow, but most importantly, it's got this right blend of not being too intimidating while still managing to provide you with solid information. Plus, it'll teach you more than just Objective-C: I found that I had learned some very useful design patterns, for example, by learning how some of the components of Cocoa worked.
When I look at the title of this question, I am guessing you are 12.
I started programming when I was 13 (I am now 14).
I found that learning depends on what kind of a learner you are!
I hate reading, I have the attention span of a moth and I learn best from videos. Therefor, I am a "visual learner". Try to find out what kind of "learner" you are, then do it that way. Remember, the easiest way is the fastest.
PS, here is a little tip. It may be frustrating (aseptically at our age). If you get frustrated, just put it down for like 10 minutes. Then come back and do research on what your learning. Programming WILL get very frustrating at times.
EDIT:
By the way, I like to learn through video :p
Stanford University posts online the lectures, class notes, and assignments for CS193P (an iPhone development class). If you don't know C or Objective-C at all, it might be tough, but I highly recommend this if you intend to do iPhone development.
I think I've read every Cocoa and Objective-C book out there, and most enjoyed Aaron Hillegass' Cocoa Programming for Mac OS X.
I would take a look at The C Programming Language (K&R C). It's much less than 1000 pages and I think you'll find it well worth your while. As htw said, books do serve a purpose in that they provide a thorough and structured approach. K&R C in particular will give you real insight directly from the creators of C.
That's not to say you shouldn't Google things, read open source code, write little practice programs, etc. It all helps. Just remember to be patient. There's a lot out there.
Checkout out http://www.cprogramming.com/ or and online K&R type book
Don't be impatient; take your time. Follow tutorials, dissect short snippets of code, you'll get the hang of the language. Most importantly, write code yourself and learn from your bugs/errors.And follow Stack Overflow ;)
I've been where you are. It wasn't fun. This is what saved me:
(Apparently new users aren't allowed to post hyperlinks, so google for "steve summit C", use either the first or the third link, and then click "introductory C programming class notes")
It's a C class by a guy named Steve Summit. Super easy to follow, much easier than K&R, imo.
Also, it's free, and there aren't any ads. I loved it. It's how I learned C. I hope it'll do the same for you.
There is nothing so educational as a piece of code you can run and tweak. Code examples in books can be really bland and not very applicable. The exception to this rule was the Perl Cookbook which is jammed packed with really useful little snippets for your perl programs.
The topics (or 'idioms') in it were so useful and so applicable across languages that some smart folks have taken to replicating them in different languages. Each has a varied level of completeness, but it's interesting to see how different languages do the same things.
Take a look here http://pleac.sourceforge.net/ for nuggets of programming wisdom that you can shake a stick at. At the very least its interesting to see how simple things written in one language require reams of code in another.
Were I starting to learn programming again I would probably pick something easy and forgiving, a dynamic language, like Python, Ruby etc. Once you get your head around the basics in one of these (flow control, data structures etc) it will make learning C/Objective-C so much easier. Also you'll find that you'll want to write once-off tools and scripts to help you in your Objective-C development that would be tedious and time consuming to write in C but are a matter of lines in a modern dynamic language. Never hurts to have another tool in your belt.
Good luck
Honestly, I learned Java as my first programming language (I discovered it in high school and decided programming was fun and it was what i wanted to do)
I just now picked up Obj-C in a few weeks, reading a little bit from some books, but not a whole book, and using the internet a lot if i can't figure out the syntax (format/grammar of how the program should be structured and written) for something etc.
How fast you can pick up a language depends on how much you understand the fundamentals of programming. You will only get better at it with time and practice.
If you can understand the fundamentals of programming in general then you should be able to apply it to any language, the hard part is learning and remembering the syntax of different languages. Like in Java, you don't have to do memory allocations, but in C, C++ and Obj-C you do. I've never written a C or C++ program, but now that I've learned and written some programs in Obj-C (i've been making iPhone stuff, it is fun) I'm sure I could pick up C and C++ like it's nothing.
You don't have to learn C first in order to learn Obj-C is what i'm trying to say. But it never hurts to know multiple languages.
It is all about your level of understanding how a program works, how to structure one. I love objective-C because it is Object Oriented like Java so it was easier for me to understand and learn quickly, just had to get used to some of the differences in syntax
(I'm also getting close to graduating from college now so I'm surrounded by programming stuff, from procedural languages like ada to object oriented like java, and knowing the nitty gritty behind the scenes stuff that makes a program work, so understanding and learning a new language has gotten a lot easier for me, you start seeing how they relate and don't relate and it is cool)
It is great that you are starting so young. I'm sure you'll pick up on this stuff real fast, and if it is something you really enjoy, it will be even easier.
Good Luck! and have fun! programming can be so frustrating... like, spending 3 hours debugging when you find out it was because you if statement used a grater than instead of grater than or equal too or something like that. but, once you are done with the program, it is so rewarding, and then you just want to make it better and better haha.
I dunno if this helped at all, I hope it did, somehow...
=)
the way i learned quickest was to watch short video tutorials.
If you really want to start with C, I would start by just reading the first three or so chapters of C for Dummies, just to get a feel for how the language works. After that, I recommend going through web tutorials. Good web tutorials will have short code that explain specific functions, and the like.
As a 13-year old, though, I recommend starting with PHP. It's a simpler language to learn than C, but it's based off of C, so it won't be hard to make the transition, whenever you do so.
Different people have different preferred ways of learning. You can see that in the variety of responses above.
So how do you like to learn? Do you like to sit by yourself with a book and a computer? Do you like to sit in a classroom and absorb learning? Do you prefer set exercises, or mini-projects?
When I learn new programming languages, I find it helps me if I have a small application or problem to work on. I prefer to have a problem to work on. If you have a little project of your own that you always wanted to do, use that. If not, as someone above suggested, join a robotics group. Set up a web page and write some programs to do stuff for that.
Look on the web for programming challenges. Google has a fun one every year.
If you want an idea, write a sukoku checking program. Then later, write a sudoku solver!
I like to use a variety of books, rather than just sticking to one or two of the ones suggested above. Find a book whose style you like. Try a few from the library until you find one or two that really click for you.
Personally, I like O'Reilly Publishing books for their chatty and readable style. I learnt C from Deitel, which is more of a classroom style textbook, but it has lots of examples and discussion points.
As you work through examples on your computer, you might wonder how things change if you tweak the code. I learn a lot by first running the example code suggested in a text, but then changing it to see what happens. If I get what I expect, it's a sign that my understanding is pretty good. If I get something unexpected, I try to figure out how I misunderstood what I did.
One last suggestion. Why not start with Python rather than C? I hear that a lot of schools are teaching Python to their kids. The reasons I suggest this are:
Python is pretty easy. You don't have to lay out memory, declare variables and such. No tedious bookkeeping.
Python gives you a nice growth path. You can start off just writing script style programs, using the built in types like lists and dictionaries. Then you progress to using new modules as you need them, and advance into object-oriented coding using classes. There's some functional programming stuff in there too, which you can start learning once you have the basic mechanics of the language under control.
I just love visiting new parts of python all the time.
You can get a lot done in python. It comes with a whole lot of built in modules to do almost anything you like - email, web, xml, graphics, gui, etc.
:)
When I was learning to program in C, I found that Practical C Programming was a good resource. It's a very approachable book with lots of examples.
The fastest way in my view is through learn through websites.
Set a goal of what you want to do and start a simple project
Instead of reading too many books theoretically,google what you want to know to get it instantly as you go through your project.This way you get PRACTICAL knowledge.
Watch online videos as well.Check out my question on VIDEOS here
Ask whatever you don't understand on stackoverflow. We're here to help :)
Follow these steps and I can assure you that you will be a great programmer soon!
Cheers!
With others, I highly recommend Kernighan and Ritchie—perhaps the best language book ever written. I'd also recommend that you slow down and enjoy yourself: don't be wide and shallow; start out narrow and deep. If you like programming, you will want to master the craft rather than be in a hurry. This essay by Peter Norvig explains how not to be in such a rush.
P.S. I started programming at age 12 with APL/360. I had a blast and have been doing it ever since—35 years and counting. Good luck and don't forget to have fun!
By far the best way (and usually the fastest) to learn programming is to find a good mentor. That's easier said than done. But I think you'd be surprised how many people would be willing to help you out. My advice would be just don't be afraid to ask.
If I were you I would find a local FIRST robotics team and see if you can hang out for some of the coding. Odds are you'll be working on a similar problem and will have some support from people who have a decent amount of experience. That's what I would have done, anyway.
I started learning to program in Basic in about 1981 when I was 10. Not many years later it was 6502 assembly to try to get more speed out of a 1 MHz Apple IIe clone.
Pascal was a revelation in 1988 - programming without line numbers.
Modula-2, C, Eiffel, Miranda, Haskel, and Prolog at university as well as scripting in any number of languages.
C++ professionally for about 6 years.
C#, then Java, Ruby, and now back to C# for the last 18 months.
Python somewhere along the way.
My advice, pick the language that is best suited to the problem you need to solve today.
The first problem you have is to learn the basics ie how to break down a problem and express it in a clear and concise manner. I suggest you choose something other than C. I recommend Python as the online documentation is excellent and the libraries are great and you will spend more time writing interesting code and less time trying to figure out why your code stopped due to a segmentation fault.
When you've got the basic concepts under your belt, try some assembly and learn what's going on under the hood. If nothing else, you'll learn how fast CPUs really are. C is a good step after that. I also suggest you try Java or C# before Objective-C.
As to how long before moving to Objective-C, it really depends on how talented you are. If you're really good, then once you've learnt your 3rd or 4th language you'll can be more productive than most coders within 6 weeks of starting a new language (although changing language families (ie imperative, functional, object oriented) takes longer). If you're no good then don't expect to get past the first. Hopefully you make it into the first category.
In addition to whatever books and websites you end up using, you might consider looking around your area for local support groups. Many areas have a Linux user group or a group for Java or Ruby programming. Professional programmers use these groups to help each other with their programming problems, but the groups are generally friendly to young people and beginners. Don't feel embarrassed or awkward because of your age and inexperience. Most people will admire your initiative and curiosity and be happy to help you when you run into problems.
Assuming you have some basic programming knowledge, Cocoa Dev Central have a series of articles that explain basic C then Objective-C, in a somewhat-less-than-1000-pages way..
Learn C for Cocoa, then Learn Objective-C
Shouldn't take even an hour to go through. The articles don't cover anything remotely advanced, but if you're learning ObjC to write OS X applications, the ObjC bit is basically trivial, it's Cocoa that is difficult to learn!
If you want to learn Objectif-C to create iPhone application, don't waste your time on C and learn Objectif-C now, then a book on iPhone programming. It will be more than 1000 pages but if you want to program in your life, you have to be used to read these types of book.
I created an online interactive C tutorial, you can start using it without installing an IDE.
http://www.learn-c.org

How to develop *real life* oop skills?

I've been studying OOP for quite a while now and I have a good grasp of the theory. I read the Head First book on OOP and, while it reinforced a lot of the theory, I found the case studies to be somewhat trivial.
I find that I'm applying OOP principles to my code each day, but I'm not sure if I'm applying them correctly. I need to get to the point where I am able to look at my code and know whether I'm using inheritance appropriately, whether my object is cohesive enough, etc.
Does anyone have any good recommendations (books, online guides, blogs, walk-throughs, etc.) for taking the next step in developing solid OOP skills?
I am working primarily in .NET (visual basic), but I welcome suggestions that incorporate various platforms.
Read Refactoring by Martin Fowler, and apply it to your own work.
It will take you through a litany of malodorous characteristics of software code that describe how to detect improperly constructed classes, and even more importantly, how to fix them.
Consider looking into Design Patterns. Although it seems like they aren't commonly used in enterprise applications (I've seen them more commonly used in API's and Frameworks than embedded into enterprise code), they could be applied to make software simpler or more robust in a lot of situations if only developers knew how to apply them.
The key is to understand the design patterns first, then with experience you'll learn how to apply them.
There is a Head First book on design patterns that teaches the concept pretty simply, although if you want a book that really covers design patterns in detail, check out the Gang of Four design patterns book, which is basically what made design patterns mainstream and is referred to almost every time the topic is brought up.
Design patterns can be applied in pretty much any object-oriented language to some degree or another, although some patterns can be overkill or over engineering in some cases.
EDIT:
I also want to add, you should check out the book Code Complete 2. It's a very influential book in the world of software development. It covers a lot of different concepts and theories. I learn something new every time I read it. It's such a good book that if I read it every 6 months to a year, I look at it from a different perspective that makes me a better programmer just by re-reading it. No matter how much you might think you know, this book will make you realize just how little you really know. It's really a great book. I can't stress how much you should own this book.
If you already have the basics, I believe only experience will get you further. You say you are not sure if you are applying the principles correctly, but there is no one correct way. Code you write today, you'll look at in 6 months time, and wonder why you wrote it that way, and probably know of a better, cleaner way of doing it. I also guarantee that after 10 years, you'll still be learning new techniques and tricks. Don't worry too much about it, it will come, just read as much as you can, and try and apply what you read in small chunks.
I am currently half-way through the following book:
http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0131489062
I cannot recommend this book strongly enough in terms of learning a real-life, professional-grade, practical approach to drafting and applying a well-formed and iterative design strategy before diving into code.
I, too, read the "Head First" book and felt that I was much better off for having read it.
After having a few years of working-world experience, I now view the Craig Larman book that I am recommending to be a perfect "next step" for me.
About the Presence of "UML" in this Book Title:
Whether you have positive feelings or negative feelings about UML notation, please do not let that influence your decision to buy the book (ISBN 0131489062) in either direction.
The prominence of "UML" in the title is misleading. While the author does use and explain UML notation, these explanations are extremely well-woven into relevant design discussions, and at no time does this book read like a boring UML spec.
In fact, here is a quote taken directly from the book:
What's important is knowing how to think and design in objects, which is a very different and much more valuable skill than knowing UML notation. While drawing a diagram, we need to answer key questions: What are the responsibilities of the object? Who does it collaborate with? What design patterns should be applied? Far more important than knowing the difference between UML 1.4 and 2.0 !
This book at times seems like it is "speaking to" a lead architect or a project manager. What I mean to say by that is that it assumes that the reader has significant control over the planning and direction of a software project.
Nonetheless, even if you are only responsible for some very small piece of your company's projects and products, I would still recommend this book and encourage you to apply some "scaled down" modifications of the book's advice to your piece of the project.
My OOP epiphany came from Grady Booch's book, way long time ago. Suddenly I realized why objects were good.
While polymorphism is cool, encapsulation is 75% of why objects are cool. It is sort of like an interface: you see the buttons but not the wiring. Before objects, only the most disciplined coders kept their grubby fingers off the internal bits of other people's procedures (it was called "structured programming").
Object make it easy to Do the Right Thing. Inheritance and polymorphism are little bonuses.
One way to learn about objects is to read other peoples' code. I learned a lot by reading the source code for the Delphi VCL framework. Even just looking at the documentation for Java will help you see what a single object class should do and how it is designed to be used by other objects.
Start a project of your own and pay attention when you want to sub-class your own classes and find that you have to go back and break up some protected methods so you can override just one piece of a process instead of replacing all of it. See how ancestors talk to descendants by calling abstract functions. In other words, go make a lot of mistakes and learn from them.
Enjoy!
Frankly, re-reading old David Parnas papers on information hiding helps me get in the right state of mind. The case studies may not be directly applicable but you should be able to get some useful generalizations out of them.
My epiphany happened when I tried to implement a very OO problem (dynamically and recursively building SQL statements) in VB6. The best way to understand polymorphism or inheritance is to need it and not be able to use it.
One thing that will definitely help you is working on a well-known, respected open source project. Either dig through the source code and see how things are done or try to make some additions / modifications. You'll find that there isn't one style or one right answer for most problems, but by looking at several projects, you'll be able to get a wide view of how things can be done. From there, you'll begin to develop your own style and will hopefully make some contributions to open source in the process.
I think you have to attempt and fail at implementing OO solutions. That's how I did it anyway. What I mean by fail is that you end up writing smelly code while successfully delivering a working solution. After it's written you'll get a feel for where things didn't quite feel right. You may have some epiphanies, and/or you may go and hunt for a slicker solution from other programmers. Undoubtedly you'll implement some variation of standard design patterns by accident. In hindsight, a light will click on (oh! so that's what a visitor is for), and then understanding will accelerate.
As others have said, I think tooling through some good OO open source code is a good idea. So is working with more experienced programmers who would be willing to critique your work. However understanding comes through doing.
You might want to try to read (and write) some Smalltalk for a while. Squeak is a free implementation that can show you the power of a fully object-oriented environment (unlike java or .net). All library code source is included. The language itself is incredibly simple. You'll find that java and c# are slowly adding the features well-known to Smalltalk since 1980.
Tortoise HG is extrodanarily well designed piece of OO open source software (written in Python).
If you already understand the basics, building something from scratch in a fully object oriented language will be a good step in fully understanding OOP software architecture. If you don't know Python, Python Essential Reference will take you through the language in full in a few days to a week.
After you understand the language take a look through the software above and you'll have all sorts of epiphanies.
To understand basically anything thoroughly, you need to have a decent knowledge of at least one abstraction level above and one level below it. In the case of OO, others have mentioned design patterns as the layer above OO. This helps a lot to illustrate why OO is useful.
As far as the layer below OO, try to play around with higher-order functions/late binding for a while and get a feel for how these relatively simple constructs are used. Also, try to understand how OO is implemented under the hood (vtables, etc.) and how it can be done in pure C. Once you grok the value of using higher order functions and late binding, you'll quickly realize that OO is just a convenient syntax for passing around a set of related functions and the data they operate on.