Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
I’m sure most of us remember being in school when the teacher showed us the tedious, painful, hard way to do something. Then, after we’d struggled through doing things the hard way, the teacher showed us the easy way. This is when we vowed revenge.
As hard as it may be for us to admit, the teachers were right. If I simply showed you the easy way (Automatic Reference Counting) without explaining regular reference counting or memory leaks, you wouldn’t have any way of knowing how much good stuff is being done on your behalf and, more importantly, you wouldn’t know why.
Doing things the manual (I try to avoid calling “difficult”) way involves paying very close attention to which objects our code owns, which objects we sort of need to keep track of, and which objects we don’t particularly care about at all. Even with all of that tracking being done in our heads, we still need to make sure that we call release at the right time.