How to survive the behind-the-scenes-magic of Objective C
By Matthew Campbell, author of Objective-C Recipes: A Problem-Solution Approach
The glazed look on some developers’ faces usually emerges on Day 2 of my three-day Objective-C intensive. Having taught several hundred students this programming language, I know this deer-in-the-headlights expression well. It means the developers – aghast, frustrated or worse – realize they simply don’t have a handle on the concepts behind Objective-C.
There’s a good reason many developers fall victim to what I call “the stare.” They’ve honed their programming expertise and gotten into a groove of expectation: every programming action they input produces a result they can account for and see. But that’s not how the engineers at Apple wanted Objective-C to work, which means the language doesn’t particularly care what you think or what your ingrained programming habits are. Apple is indifferent to your inability to figure out the “magic” of Objective-C that happens behind the scenes.
Magic is not the sort of concept you’d find in most developers’ dictionaries. Magic suggests a loss of control, something every programmer that I know is loathe to consider. But, for a fruitful relationship with Objective-C, programmers literally need to get with – or, better yet, inside – it.
Here’s the crux of it. Apple wants to be helpful. Actually, it forces its helpfulness on you by providing frameworks – so you don’t have to spend hours of coding – that you accept on faith will work. But it’s sort of a left-handed generosity that smacks of my-way-or-the-highway. Apple says, “Here’s an easy way to do this procedure, as long as you follow it to the letter.”
At your end, you might appreciate that they’ve given you a short-cut. But make no mistake about it – what Apple is handing you on a plate is very complicated stuff. Which is why it’s often better to just surrender to it, and accept that you can be well served without knowing the why’s and how’s of what’s hidden from view.
I advise my clients and students to recognize that their frustrations are surmountable psychological barriers and to pretend they’re brand new programmers, open to certain programs’ idiosyncrasies. And I assure them that once they become more experienced with Objective-C, there’s a good chance they’ll love how much they can accomplish with it.
You might have to adjust your programming handbook to accommodate Apple’s looking out for you. But you’ll sleep better at night.
Matthew Campbell is an app developer and owner of Mobile App Mastery, a training company for software developers. He’s the author of Objective-C Recipes: A Problem-Solution Approach (2012, Apress).
- » Apple is giving iOS apps which handle real cash in an HTML5 wrapper a bit longer to transition to native
- » Beijing warns Apple to ‘think about the consequences’ after Hong Kong app controversy
- » Apple doubles use of Swift in iOS 13 as it shifts away from Objective-C
- » App revenue is soaring with $21.9bn spent in Q3 alone, up 22.9% YoY