How hard is it to learn Cocoa - Survey ?
-
I have been working with Cocoa and its predecessors for so long that I
can't remember how long it took me to learn to use the frameworks.
One of my first non-trivial NeXTstep applications was a Tetris game.
It was about 1989 or early 1990 when a friend was admiring my NeXT
cube. She asked if there was a Tetris game, and when I said there
wasn't, she said, well what kind of computer doesn't have Tetris? It
must be useless.
I spent two days with little sleep - maybe 40 hours straight- and
coded up a Tetris game. Of course, it was 2 bit gray scale, but it
had synthesized "stringed instrument" background music, and you could
supply your own images to be used as backgrounds. In fact, every user
could have different background images. My friend said she wasn't
impressed, but she spent about two hundred hours playing the game that
summer. She asked me to enhance the game so that the music tempo
increased with the game level and sliding or rotating blocks had their
own sound effects that were mixed with the background music. Stacking
up blocks transposed the music to different keys. At first she played
the game to get the highest score in our social circle. Later she
played the game to see what kind of cool "music" she could produce.
NeXT's DSP was was very cool, and the examples I used to get started
later became MusicKit (I think). I never was able to digitally record
her music in real time though...
So, anyway, I implemented lots of student projects with Objective-C
and the NeXT. I wrote a recursive descent parser for my compilers
class. There was a separate class for each scan-able token. A class
method +newWithPartialString:(const char*) nextPosition:(int
*)nextIndexPtr returned an instance of whatever token subclass could
make the longest match. Then each token know about the previous and
next tokens and contained the applicable grammar rules to identify
syntax errors along the lines of "I am not allowed to follow my
predecessor so there is a syntax error at my position..." My
professor thought it was really nifty. Everybody else in the class
used Pascal or Ada to implement their parsers as direct copies of the
textbook examples.
By the time graduated in December 1991, I was thoroughly familiar and
comfortable with most NeXT APIs including the Unix layer and Display
Postscript. I would say I went from newbie to advanced in about two
years or maybe a little less while working and attending school full
time. I used Interface Builder and File's Owner and First Responder
and targets and actions and delegates. Since then I have been along
for the ride with the separation of FoundationKit, DBKit, EOF, 3DKit,
NeXTtime, MusicKit, Renderman, the transition to Openstep, the years
in the wilderness with Apple... Of course, there is a lot more to
learn now, or is there really?
So this is a survey:
For those who consider themselves intermediate to advanced Cocoa
programmers, how long was the journey from newbie to competent and
from competent to advanced ? What percentage of your time did you
dedicate over how many months ?
Maybe we can establish a standard distribution of learning time
required. Just having a basis to set expectations might help future
newbies. -
I think it'll be very hard to compare learning times then to learning
times now because the frameworks involved are quite a bit different. I
started working on Cocoa stuff for Omni near the end of 1993. A lot of
the concepts behind the AppKit class hierarchy have changed
surprisingly little since then, and we even had binding equivalents as
part of DBKit (an ancient database layer that was rewritten into EOF
and then into WebObjects Obj-C and then into Java...). But there was
no Foundation framework back then, no retain/release, standard
Objective-C style was even quite a bit different (set methods normally
returning self instead of nil, et cetera).
With that caveat: I'm pretty sure I was usefully productive in Cocoa
after two weeks or so. Note that this was a full-time job, so I had
both time to come up to speed, no distractions, and was working
directly with people who were already experts. That is a very
different learning environment from a spare time, on-your-own method
of learning.
-- Greg
On May 25, 2008, at 1:18 PM, Erik Buck wrote:
> I have been working with Cocoa and its predecessors for so long that
> I can't remember how long it took me to learn to use the
> frameworks. One of my first non-trivial NeXTstep applications was a
> Tetris game. It was about 1989 or early 1990 when a friend was
> admiring my NeXT cube. She asked if there was a Tetris game, and
> when I said there wasn't, she said, well what kind of computer
> doesn't have Tetris? It must be useless.
>
> I spent two days with little sleep - maybe 40 hours straight- and
> coded up a Tetris game. Of course, it was 2 bit gray scale, but it
> had synthesized "stringed instrument" background music, and you
> could supply your own images to be used as backgrounds. In fact,
> every user could have different background images. My friend said
> she wasn't impressed, but she spent about two hundred hours playing
> the game that summer. She asked me to enhance the game so that the
> music tempo increased with the game level and sliding or rotating
> blocks had their own sound effects that were mixed with the
> background music. Stacking up blocks transposed the music to
> different keys. At first she played the game to get the highest
> score in our social circle. Later she played the game to see what
> kind of cool "music" she could produce. NeXT's DSP was was very
> cool, and the examples I used to get started later became MusicKit
> (I think). I never was able to digitally record her music in real
> time though...
>
> So, anyway, I implemented lots of student projects with Objective-C
> and the NeXT. I wrote a recursive descent parser for my compilers
> class. There was a separate class for each scan-able token. A
> class method +newWithPartialString:(const char*) nextPosition:(int
> *)nextIndexPtr returned an instance of whatever token subclass
> could make the longest match. Then each token know about the
> previous and next tokens and contained the applicable grammar rules
> to identify syntax errors along the lines of "I am not allowed to
> follow my predecessor so there is a syntax error at my position..."
> My professor thought it was really nifty. Everybody else in the
> class used Pascal or Ada to implement their parsers as direct copies
> of the textbook examples.
>
> By the time graduated in December 1991, I was thoroughly familiar
> and comfortable with most NeXT APIs including the Unix layer and
> Display Postscript. I would say I went from newbie to advanced in
> about two years or maybe a little less while working and attending
> school full time. I used Interface Builder and File's Owner and
> First Responder and targets and actions and delegates. Since then
> I have been along for the ride with the separation of FoundationKit,
> DBKit, EOF, 3DKit, NeXTtime, MusicKit, Renderman, the transition to
> Openstep, the years in the wilderness with Apple... Of course, there
> is a lot more to learn now, or is there really?
>
>
>
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
>
> Maybe we can establish a standard distribution of learning time
> required. Just having a basis to set expectations might help future
> newbies.
-
On May 25, 2008, at 1:18 PM, Erik Buck wrote:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
Back in 1989 when I learned NeXTSTEP, there was an excellent NeXTSTEP
concepts manual, and using that and the rest of the NeXT docs for 2.0,
I was about as productive as I had been on the Mac after a month or
so. Three months after I'd started using NeXTSTEP, I got to take the
DevCamp course from Randy Nelson at NeXT's office in Pittsburgh, and
that moved me from newbie to competent in a week. I would say that I
was a NeXSTEP expert by the end of that year, which would be about
nine months from when I first got my hands on a NeXTStation.
As Greg mentioned, there's a whole lot more to Cocoa than we had in
NeXTSTEP. We got some things that save us an enormous amount of time,
but we also lost some great things like the SoundKit, the DriverKit,
and the MusicKit.
-jcr -
On 25 May '08, at 1:18 PM, Erik Buck wrote:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
I spent a week in an Apple training class in 2000. A lot of the time
was spent writing an expense-account application, involving the usual
text fields and table view, and then adding features like copy and
paste, drag and drop, and undo. By the end of that class I felt I
basically knew what I was doing. (As I described it to people
afterwards, I felt like I'd climbed into some kind of powered mecha
exoskeleton and was lifting girders and assembling buildings single-
handed. I was coming from Java, where building GUIs was a pain in the
butt.)
I'm not sure if I was generally "competent" after that week, but I was
ready to start putting together a prototype of my app. It probably
took another month before a competent Cocoa programmer would have
called me "competent" :) Of course I was lucky to have several experts
in neighboring offices, and the AppKit team down the hall in case I
really got stuck.
I think what made a big difference was blocking out a whole week to
just learn and tinker. It's so much easier to absorb new concepts if
you don't hear the clock ticking and feel your boss's eyes on your
back. If you're learning Cocoa, and you have a big project you've been
assigned (or are just dreaming of), then for god's sake don't start on
that project right away. Build toy apps first. Take a sample app and
play with it, adding new features or changing things around.
Humans (like all mammals) learn best through play.
—Jens -
On May 25, 2008, at 4:18 PM, Erik Buck wrote:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
Unlike the other respondents so far, I'm a relatively recent
immigrant. I was a Unix guy in a Mac shop, and in 2000 or so a friend
there who had installed Mac OS X DR3 on his PowerBook showed it to
me. I bought a Mac the next day, and learned the basics, how to
manage memory, connect things in IB, the MVC and KVC design patterns,
and so on, over the mostly-sleepless following weekend.
After that, I spent the next year or so just playing with it in my
spare time - my day job was web programming, and my employer was
still using MacOS. So it was a matter of an hour here, a Saturday
there, etc. Just poking at areas of interest that came up as I tried
different things. One idea often led to another. For instance, as
part of learning how to supply data to table views, I wrote a simple
database front-end using MySQL's C API. Once I had it supplying the
data, I noticed that it beachballed while it was fetching rows, and
that triggered an investigation of runloops, and how to use timers to
avoid blocking them.
After I left my web dev job, the learning pace picked up because I
suddenly had a lot of time on my hands. I wrote the first version of
CamelBones in about a month, using NSProxy objects to forward
messages across the bridge. Maybe six months after that, I had
mastered the runtime well enough to integrate Perl classes directly,
without proxies.
sherm-- -
Quoting Erik Buck <erik.buck...>:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and from
> competent to advanced ? What percentage of your time did you dedicate
> over how many months ?
>
> Maybe we can establish a standard distribution of learning time
> required. Just having a basis to set expectations might help future
> newbies.
>
Hi,
I started at a young age with BASIC and C, and worked my way into
AppleScript after that on pre-Mac OS X systems. It was a little bit
of a jump to get into AppleScript Studio, but it made me appreciate
how beautiful Mac OS X programming could be. Unfortunately, AS Studio
was not sufficient for what I wanted to do (that is to say, grow and
properly refactor my code), and after noticing how much example code
Apple and others had provided, I jumped into Cocoa by modifying
samples and patching together my own ideas from them.
It was not an easy road in some regards -- memory management, although
now second-nature to me, took a long time to get right, since I had
*not* done much C prior to my Cocoa experiences -- and the MVC
paradigm took a long time to get used to. Overall, though, I'm glad
that I persevered -- and just for the record, I was able to get my
first "experiment" in Cocoa up within a day or two, even if its
purposes have been lost to history and even if its code would make any
novice cringe.
How long did it take me? I'm still learning, and it's been something
like six years; from "newbie to competent" probably took about four
years, before I stopped making some really basic mistakes. Was the
time investment, hours and hours a day sometimes even, worth it?
Absolutely. I have grown to love Objective-C and Cocoa more than any
other language or framework that I've ever seen on a computer.
I feel bad, though, for the people on this list who had to put up with
me in the early and even the intermediate stages of my learning. I
may have worn out my welcome, or I may not have, but I'm trying to
give back now in the hopes that I can assist others. I know how it is
to be a newbie!
Cheers,
Andrew -
Erik Buck wrote:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
>
> Maybe we can establish a standard distribution of learning time
> required. Just having a basis to set expectations might help future
> newbies.
I think it depends a lot on the nature of the newbie. I came to Cocoa
already quite comfortable with Smalltalk (and a bit of dabbling in
Objective-C some time in the early '90s) and familiar with several
frameworks and class libraries. Getting comfortable with Cocoa really
didn't take very long.
In trying to help other people along over the last several years, I
think I'd say that the single biggest stumbling block I see is not
with the framework but an aversion to the "weirdness" of Objective-C
syntax. That seems to be a huge problem for a surprising-to-me number
of people. -
On May 25, 2008, at 2:21 PM, Erik Buck wrote:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
>
> Maybe we can establish a standard distribution of learning time
> required. Just having a basis to set expectations might help future
> newbies.
I wouldn't consider myself an intermediate to advanced Cocoa
programmer, however the time span between when I started looking at
the Aaron Hillegass book to when I released a Cocoa application was 1
year (mid 2002 to mid 2003). So you could consider this moving from
newbie to competent . I did this in my spare time -- weekends and some
week nights. My daytime job had nothing to do directly with
programming (and certainly nothing to do with Mac programming). My
previous experience was C-programming, Forth (MacForth and Mach II),
and 6502 assembly. These were also self-taught.
By the way, prior to looking at Objective-C, I didn't "grok" OO
programming at all (to use the vernacular). It was only after reading
Aaron Hillegass a while that I started to "get it". The other book I
used was "Cocoa Programming" by Anguish, Buck, and Yacktman (two of
the authors on here). That book is now a little "long in the tooth"
since it uses Project Builder and the old version Interface Builder.
However it is still a good reference for the basic Cocoa classes. Also
it has stuff on Cocoa Design Patterns. Interestingly, the book (even
with 1200+ pages) barely mentions File's Owner -- a topic of great
interest around here lately.
Jim Merkel -
I would definitely not consider myself intermediate or higher with
Cocoa, but I would definitely share what has helped me make sense of
things.
I started with Cocoa after C, but it didn't sink in at all.
Then I went the long way around through doing some web development.
With web development I learnt a lot of things that are still useful,
web design being one of them, just enough xml being another. But the
most useful was definitely Ruby and Rails. Ruby taught me exactly how
and what objects should be (and it's got a great mailing list that
rambles around all sorts of topics). Rails taught me how a good
framework works for you and leverages the capabilities of the
language it uses.
In the same way, Cocoa really highlights the strengths of Objective-
C, which really builds on what is possible with C.
After all of a year with C and a year and a half with web
development, 4 months of my spare time ( a few hours on a few
weekdays, a lot of hours on a lot of weekends ) has gotten me to
building a useful Cocoa app that a few dozen coworkers at Apple use
every day.
I wrote it for my work, they liked it for theirs. It's not an amazing
app, just very usefully specific to their needs (and mine).
My point: Ruby is a great way to learn OOP by having everything be
objects all the time.(almost anyway)
My other point: You don't learn Cocoa or any framework, you look it
up a lot, and use what you need, eventually remembering a lot of
details with more experience.
My last point: The secret to good development is having a good idea
for an app that is useful and necessary. Other than that, just play
with features of the framework by working through the books, and
monkeying with the sample code. -
On 25 May 2008, at 21:18, Erik Buck wrote:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
Hi Erik,
I bought my first Mac back in 2003 (G4 iBook. Wow, was that really
nearly 5 years ago?!), coming from using a lot of Linux/Unix. At that
time I started looking at programming Cocoa, but it's never been a
real "endeavour" for me (Day job is silicon design). So I'd say if
I've probably spent 6 months over that time actually working on stuff.
I'm now getting to the point where I don't know the class library well
enough to work without documentation, but the concepts are solid.
In essence slow, but steady.
Two key points on my path to Cocoa enlightenment:
1) I came from a long stream of procedural programming, starting way
back on the Apple ][ with Basic, going through forth, pascal, 68000
assembler, C, perl, python and others. Along the way I've used C++ and
Java, but OO has always been what I like to now term as the "C++ OO"
style as opposed to "Smalltalk OO" style(*).
It took me a long time to realise this wasn't just a new language, but
a new way of designing applications. This isn't just MVC (a relatively
simple concept), but more how to architect problems into objects. To
restate in broader terms, it's not the design patterns, but knowing
when to use the patterns. I think that comes with time playing with
things, and is a difficult thing to impart knowledge on.
(*) These terms have nothing really to do with the languages, but what
I've tended to see as a style of code when reading those languages.
2) I got very frustrated with it a year ago. I done the O'reilly book.
I'd done Hillegas. I'd done various apple tutorials. I could design
UIs, I could put actions behind buttons, data behind views, but I
didn't feel I could take that knowledge and build a real app. It was
too big a jump.
All the things I'd worked through seemed to write applications
starting with the UI (in MVC terms, the view) and fleshing out
functionality from there. I've never liked this way of programming as
it feels like I'm building a house from the roof down. I like the data
structures (the models) to be my foundation. Get those right and the
rest falls into place.
What I couldn't find, and what was making me angry was worked examples
on the Foundation (and other low lying) frameworks. Looking back I'm
not sure that makes sense, but there was a hole I couldn't fill.
What I did in the end was join ADC as a select member. I have to say I
was disappointed with what I received for the money (Betas I
personally didn't need, and the same documentation I can download
anyway), but going through and watching the WWDC fundamentals
presentations got me over the hump. It's a shame you have to pay to
get these videos, but for me they did the trick. To me, the
fundamentals videos should be available to everyone.
I'm no longer a member (expired last month), but I've made sure I've
kept hold of the videos (most from 2004/5) as reference. So much of
the docs seems to want to sell the great new shiny technology (e.g.
bindings, properties, GC), but not having that fundamental foundation
to work on just means it confusing those coming to it new.
Hope somebody finds that interesting.
Paul -
On 25 May 2008, at 21:18, Erik Buck wrote:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
## History
Programming minicomputers in the mid-'70s, my first personal computer
1977, read The Elements of Programming Style in 1976(?), which was
very influential to me. I, too, did a lot of 8080, 6502, Z80, 8088,
BAL, and 680x0 assembly. I stumbled on event loops in 1982. I'd become
proficient in the Mac Toolbox in 1984, and really took to heart the
concept of a manager for a data type -- exhaustively providing
operators for an opaque pointer that was the first parameter to the
function.
My first introduction to O-O programming was reading about
Smalltalk-80 in the early-'80s. (Using it? Hah! Not on affordable
hardware.) In 1987, when I was part of a team working on an O-O
relational database, I got the 30-minute briefing on Objective-C at
Stepstone from Brad Cox. Teaching myself C+-, and then C++ (the MUCH
smaller language of 1989, where reading the cplus preprocessor's
output helped a ton), took only a few months. I had exposure to
MacApp, but not enough to be very good at it. Proficient at the THINK
Class Library (wrote an SGML hypertext renderer in 1993) and
PowerPlant. Java/AWT in the late '90s.
This is not to brag. It's to show I had a long ramp-up time on
concepts similar to Cocoa's before I came to it in Mac OS X 10.0. My
learning curve is probably not common.
## Cocoa
Using an actual Objective-C compiler was trivial for me. A day for 90%
competence. The full implications of duck typing took a month or so.
My style is to read the manuals exhaustively before I take up coding.
I had to print them out, and read them two or three times. The
historical oddities hurt. The conceptual docs, mostly abbreviated in
the class references, did not lay out the core tasks clearly enough
for me. There was very little to bridge the gap between
CurrencyConverter and nontrivial programs. (This is 2000; eight years
have essentially solved this problem.)
At 60% effort, I'd say I got beyond trivial applications within 4
weeks of starting with the manuals. Document-based applications were
intimidating enough to take another 4. By then, I understood every
question and answer on this list (2001). (Competent) In another 3
months, I was answering questions, mostly correctly. (High-competent)
Advanced? At 10% effort, a year.
There are still some basics I don't have complete command of -- a
recent answer on this list involving NSDocumentController was a
revelation to me.
With today's documentation, I'd think the time to work up to
NSDocument could be about halved.
With the growth of the Cocoa frameworks, the time till you could
usefully answer questions may have gone over a year.
Once I had the concepts and patterns down, I was usefully competent on
Core Data within 3 weeks of release (50% effort). I find the
documentation to be good enough that if I need it, I can use a new
technology within a week, and get back to competence at a forgotten
one within an hour (100%).
Having the basic skills, and drilling hard on the concepts of a new
part of the framework, are paramount. Skim the class reference
_without_ an application in mind when you're about halfway through the
concepts; read the reference carefully after the concepts; and only
then read the reference for your application. It took me a week to be
confident of the division of labor in the text system. (Competent) I
wrote an NSLayoutManager (including a custom renderer for some
characters) for monospacing in a terminal emulator, from a standing
start, in a couple of months. (Advanced on the subject in maybe a
month, the rest in a design/debug/refactor loop.)
I don't know if this is helpful, or even responsive, but that's my
story.
— F -
On May 25, 2008, at 1:18 PM, Erik Buck wrote:
> So this is a survey:
> For those who consider themselves intermediate to advanced Cocoa
> programmers, how long was the journey from newbie to competent and
> from competent to advanced ? What percentage of your time did you
> dedicate over how many months ?
>
> Maybe we can establish a standard distribution of learning time
> required. Just having a basis to set expectations might help future
> newbies.
OK, WWDC is over and I have some time again...
I bought my NeXT station in the late autumn of 1990 and by the mid of
1991 I could program almost any task. I learned it in my after-school
hours. My previous experience included Unix, C, PL/1, Fortran, Modula,
and Lisp, and some 3-D graphics and vector processing.
cheers
georg



