Skip navigation.
 
mlGuidance for Cocoa's steep learning curve
FROM : Erik Buck
DATE : Thu May 15 03:19:25 2008

The obstacles, misconceptions, and prerequisite concepts that need to 
be mastered when learning Cocoa vary dramatically based on the past 
experience of the learner.  I am a very experienced Cocoa programmer. 
I am also an author of the thickest Cocoa Programming book and have 
another Cocoa book due out real soon.  I have some guidance.

To relate my background, I started using NeXTstep (the precursor to 
Cocoa) that included Interface Builder and Objective-C and App Kit in 
late 1988.  I had heard of object oriented programming but didn't "get 
it".  I had attended a one day seminar on "C with Classes" which later 
became C++.  I left the seminar no wiser than when I arrived.  I had 
worked for eight years with C and a variety of assembly languages.  I 
had been using Ada for a year.

I became excited about NeXTstep software development, worked on many 
hobby projects, and from 1991 on I worked extensively with NeXTstep/
Openstep/YelowBox/Cocoa as well as C++ and many other technologies.  I 
founded a company in the early 90s and developed an industry leading 
application.  I sold the intellectual property to a Fortune 500 
company in 1996, and my company continued to work in the industry 
until late 2002.  I am now "Senior Staff" for a different Fortune 500 
company in a related industry.

Here is my guidance based on some arbitrarily chosen categories of 
learners:

=== If you have never programmed before
1) Learn any programming language (it may seem hard, but every 'real' 
programmer knows many languages and you have to start somewhere)
2) Learn C and at least learn to recognize low level operations like 
bit manipulation, pointers, intrinsic types, pointers to pointers, 
pointers to functions, etc.  Without this, you will be lost and 
dangerous when writing Cocoa programs in Objective-C.
3) Learn Objective-C.  It takes about 1 day for an experienced C 
programmer.
4) Start the long process of learning the Cocoa frameworks, the C 
standard library, and some of the Unix libraries.
4A) Learn Cocoa conventions and common patterns.  These are not 
optional.  Clear understanding of the following is required to write 
graphical Cocoa applications: two stage allocation and initialization, 
designated initializers, memory management, selectors, dynamic 
messaging, accessors, the responder chain, delegates, target/action, 
data sources, archiving & unarchiving (e.g. freeze dried objects 
in .nib files), the view hierarchy, key and main windows, and above 
all the Model View Controller pattern.
4B) Study Apple's sample applications, work tutorials, experiment, and 
build a few hobby projects.

=== If you are primarily an experienced "dynamic" language programmer 
(perl, Ruby, Python, Smalltalk, TCL, etc)
1) Learn C and at least learn to recognize low level operations like 
bit manipulation, pointers, intrinsic types, pointers to pointers, 
pointers to functions, etc.  Without this, you will be lost and 
dangerous when writing Cocoa programs in Objective-C.
2) Learn why C and therefore Objective C use a pre-processor with 
separate headers and separate implementation files.  Come to grips 
with the edit, COMPILE, link, debug cycle.
3) Learn Objective-C.  It takes about 1 day.  You will realize the 
Objective-C is very dynamic and flexible but has its own idioms.
4) Start the long process of learning the Cocoa frameworks, the C 
standard library, and some of the Unix libraries.
4A) Learn Cocoa conventions and common patterns.  Many will be 
familiar to a Smalltalk programmer.  These are not optional.  Clear 
understanding of the following is required to write graphical Cocoa 
applications: two stage allocation and initialization, designated 
initializers, memory management, selectors, dynamic messaging, 
accessors, the responder chain, delegates, target/action, data 
sources, archiving & unarchiving (e.g. freeze dried objects in .nib 
files), the view hierarchy, key and main windows, and above all the 
Model View Controller pattern.
4B) Study Apple's sample applications, work tutorials, experiment, and 
build a few hobby projects.
4C) If you object to Cocoa's memory management conventions, learn to 
love them because in the world of C, automatic garbage collection can 
not solve all of your problems.

=== If you are primarily an experienced C++ programmer (In my 
experience you will have the hardest time)
1) Forget everything you think you know about Object Oriented 
programming (no offense intended).
2) Break every ingrained C++ habit and idiom because the design 
philosophy of Objective-C and Cocoa is exactly the opposite of almost 
everything C++ encourages.
3) Learn Objective-C.  It takes about 1 day for an experienced C 
programmer.  You will realize the Objective-C is very dynamic an 
flexible.  Many patterns and idioms in C++ are unneeded in Objective-
C.  Objective-C classes tend to be more high level and straight 
forward, and you tend to use fewer of them.  You may feel disoriented 
without the accustomed "bondage and Discipline" [http://c2.com/cgi/wiki?BondageAndDisciplineLanguage
], but I strongly advise you to learn an appreciation for freedom and 
the flexibility to send any message to any object even if the receiver 
did not exist when your application was compiled and linked.  For 
many, an appreciation for Cocoa's undo mechanism breaks the ice. 
(although dynamism is ubiquitous in Cocoa)
4) Start the long process of learning the Cocoa frameworks.
4A) Learn Cocoa conventions and common patterns.  These are not 
optional.  Clear understanding of the following is required to write 
graphical Cocoa applications: two stage allocation and initialization, 
designated initializers, memory management, selectors, dynamic 
messaging, accessors, the responder chain, delegates, target/action, 
data sources, archiving & unarchiving (e.g. freeze dried objects 
in .nib files), the view hierarchy, key and main windows, and above 
all the Model View Controller pattern.
4B) Study Apple's sample applications, work tutorials, experiment, and 
build a few hobby projects.


=== If you are primarily a Java programmer
1) Learn Objective-C.  It takes about 1 day.  You will realize the 
Objective-C is very dynamic and flexible.  Many patterns and idioms in 
Java and C# are unneeded in Objective-C.  You may feel disoriented 
without the accustomed "bondage and Discipline"[http://c2.com/cgi/wiki?BondageAndDisciplineLanguage
], but I strongly advise you to learn an appreciation for freedom and 
the flexibility to send any message to any object.
2) Start the long process of learning the Cocoa frameworks, the C 
standard library, and some of the Unix libraries.
2A) Learn Cocoa conventions and common patterns.  These are not 
optional.  Clear understanding of the following is required to write 
graphical Cocoa applications: two stage allocation and initialization, 
designated initializers, memory management, selectors, dynamic 
messaging, accessors, the responder chain, delegates, target/action, 
data sources, archiving & unarchiving (e.g. freeze dried objects 
in .nib files), the view hierarchy, key and main windows, and above 
all the Model View Controller pattern.
2B) Study Apple's sample applications, work tutorials, experiment, and 
build a few hobby projects.


=== All
Once you understand in principal how all of the basic Cocoa patterns 
are implemented, learn about Key Value Observing, Bindings, Core Data, 
etc.  These use advanced patterns that seem like magic until you have 
mastered the basics.

Related mailsAuthorDate
mlGuidance for Cocoa's steep learning curve Erik Buck May 15, 03:19
mlRe: Guidance for Cocoa's steep learning curve Ricky Sharp May 15, 04:26
mlRe: Guidance for Cocoa's steep learning curve Scott Ribe May 15, 05:33
mlRe: Guidance for Cocoa's steep learning curve David Wilson May 15, 07:16
mlRe: Guidance for Cocoa's steep learning curve Jens Alfke May 15, 16:59
mlRe: Guidance for Cocoa's steep learning curve Scott Ribe May 15, 17:18
mlRe: Guidance for Cocoa's steep learning curve colo May 15, 17:21
mlRe: Guidance for Cocoa's steep learning curve Uli Kusterer May 15, 17:54
mlRe: Guidance for Cocoa's steep learning curve colo May 15, 18:03
mlRe: Guidance for Cocoa's steep learning curve Jens Alfke May 15, 21:06
mlRe: Guidance for Cocoa's steep learning curve Stefan Werner May 15, 21:17
mlRe: Guidance for Cocoa's steep learning curve Scott Ribe May 15, 21:53
mlRe: Guidance for Cocoa's steep learning curve Bruno Sanz Marino May 16, 00:39
mlRe: Guidance for Cocoa's steep learning curve mmalc crawford May 16, 02:03
mlRe: Guidance for Cocoa's steep learning curve Jens Alfke May 16, 03:06
mlRe: Guidance for Cocoa's steep learning curve Joseph Ayers May 16, 03:33
mlRe: Guidance for Cocoa's steep learning curve Jens Alfke May 16, 04:07
mlRe: Guidance for Cocoa's steep learning curve mmalc crawford May 16, 06:12
mlRe: Guidance for Cocoa's steep learning curve James Merkel May 16, 07:04
mlRe: Guidance for Cocoa's steep learning curve John Terranova May 16, 07:32
mlRe: Guidance for Cocoa's steep learning curve Ilan Volow May 16, 08:55
mlRE: Guidance for Cocoa's steep learning curve john darnell May 16, 15:30
mlRe: Guidance for Cocoa's steep learning curve Michael Ash May 16, 15:49
mlRe: Guidance for Cocoa's steep learning curve I. Savant May 16, 15:57
mlRE: Guidance for Cocoa's steep learning curve john darnell May 16, 16:19
mlRe: Guidance for Cocoa's steep learning curve I. Savant May 16, 16:27
mlRe: Guidance for Cocoa's steep learning curve Jeff LaMarche May 16, 16:29
mlRe: Guidance for Cocoa's steep learning curve Michael Ash May 16, 16:31
mlRe: Guidance for Cocoa's steep learning curve Jens Alfke May 16, 16:50
mlRE: Guidance for Cocoa's steep learning curve john darnell May 16, 16:57
mlRe: Guidance for Cocoa's steep learning curve I. Savant May 16, 17:04
mlRe: Guidance for Cocoa's steep learning curve Michael Vannorsdel May 16, 17:41
mlRe: Guidance for Cocoa's steep learning curve Andy Lee May 16, 20:05
mlRe: Guidance for Cocoa's steep learning curve Scott Ribe May 16, 20:22
mlRe: Guidance for Cocoa's steep learning curve Shawn Erickson May 16, 21:51
mlRe: Guidance for Cocoa's steep learning curve Michael Ash May 17, 08:56
mlRe: Guidance for Cocoa's steep learning curve Torsten Curdt May 17, 11:53
mlRe: Guidance for Cocoa's steep learning curve Michael Ash May 17, 12:02
mlRe: Guidance for Cocoa's steep learning curve Torsten Curdt May 17, 12:46
mlRE: Guidance for Cocoa's steep learning curve john darnell May 19, 15:26
mlRe: Guidance for Cocoa's steep learning curve David Casseres May 22, 05:59
mlRe: Guidance for Cocoa's steep learning curve David Casseres May 22, 06:12