Learning the iPhone way

So in my update of a few days ago, I promised some information about iPhone programming.  Some of this will apply to everyone, some of it will only apply to certain people, and some of it may very well be unique to me.  So, without further ado, let’s open the ball on this series of “mini-lessons” – I can’t quite call them tutorials, but they’re awfully close and may serve as tutorials for some.

This first post won’t really cover any programming, it will cover more of the mindset I found I had to be in to be successful at programming for the iPhone.  The biggest thing I had to learn was how to forget.

That’s right – I had to learn how to forget.

Seems a bit of a paradox, huh?  Well, let me explain.  As a systems administrator, a role I’ve had across 6 jobs and over 13 years, I have to know a moderate amount about a whole lot of things.  I have to know shell scripting, Python scripting, Perl, a bit of C, some C++, a dash of Java (the programming language, not the caffeinated beverage), and a few other things I’ve thankfully managed to forget.  The hardest part of all that is sorting out what environment / language you’re in and using only that language for whatever task you’re undertaking.  When I’m working on a Python script to make my life easier, for example, it’s far more difficult to switch to helping a programmer with a Perl question than it is to start helping a coworker who’s mouse has just started acting wonky.

When I first looked at iPhone programming, I thought to myself, “Oh, Objective C – I can handle that, I know C, it shouldn’t be too hard to translate.”  Just because it has the same last letter, C, doesn’t mean they are at all similar.  The syntax is, at a very high level, somewhat akin to C or C++, but getting anywhere close to the code you find there are more similarities between C and Java than C and Objective C – and it’s even more different from C++ than from C.

Enough with the alphabet soup, you’re saying?  Okay, enough with that.  Put in to plain English, the experience was for me a lot like assuming I could speak French with a reasonable degree of accuracy although perhaps not a collegiate conversational level just because I already knew Spanish.  I really don’t know Spanish, actually – I barely passed Spanish 4 in college, and that only by the kindness of Fate and my instructor taking pity on my poor non-existent language skills.  But I digress. The point here is that I had to get to the point where I realized all of my assumptions about the language, and my expertise therein, were wrong.  That took quite a bit of banging my head against virtual walls, let me tell you.

See, I actually have another app I’ve written, as a contractor, called Successful Roads.  It’s a commercial app designed for assisting construction contractors with raw material amounts needed for road construction projects.  If you’re curious, you can look up the website at http://www.roadformulas.com/. That app was, once I go my head wrapped around Interface Builder (IB), fairly simple to build.

That relative simplicity is what led to my later downfall.  I was thinking I could handle myself since I knew a similar-sounding language, and I’d already done one app.  Boy was I wrong. The first thing I had to realize was that IB was actually hindering my understanding of what was going on underneath the covers. I was hiding code implementation details from myself – hiding details from consumers is okay, hiding them from yourself, not so much. Then I had to realize that in Objective C, things are truly objects, not just fancy bits dressed up as objects. The convention for making “function calls” was sufficiently different that it took me almost two full weeks just to fully absorb it.

After the fact, it seems so incredibly intuitive that things work the way they do, but while I was slogging through, it wasn’t at all.  The biggest lesson I can give you from this experience is a simple one – forget everything you think you ever knew about programming and get a good intro book to iPhone development.  There are several out there; I’ve picked up three or four of them over time.  I’m not going to mention them specifically as I don’t want to be seen as endorsing any one over another, but if you’re curious and wish to contact me privately please feel free to do so.  Once you’ve managed to “forget” everything you ever knew about other languages, any programming experience you’ve had previously should stand you in good stead as you learn what I’ll call “the iPhone way” and begin your journey as an iPhone developer.

Comments are closed.