Tag Archives: Apple

MacBook Pro – After the honeymoon

I really need to catch up on my writing!

After my initial analysis of my MacBook Pro, I thought I should point out a few things after using it for a few weeks.

In no particular order:

  • The edges on this thing are sharp. I’m not quite ready to take a file to it, but really! Did your ergonomic testers have bionic arms?
  • The battery life is phenomenal – most of the time. For the first week, I was regularly getting 7 or more hours from the battery every day. Then one day, I started to only get 4-5. Nothing was running, and I couldn’t hear the fans (although, they are so whisper quiet, you can barely hear them when they are running.) This went on for a week, then I happened to reboot. Suddenly, I’m back to 7 hours. This has happened twice since then and reboots always solve the problem. I can’t find anything running, but I think it may be tied to Xcode or Eclipse.
  • Despite the sharp edge, the laptop keyboard is still easier to type on when on your lap than the old MacBook was. Perhaps it’s just roomier.
  • The speakers have a really long delay when switching from internal to external, sometimes 3-4 seconds after the plug is in before it shifts to the external speakers.

Still… I love it.

I held an iPad – Now I Must Own One

Honestly, I don’t know which to write about first – The New Doctor Who or the new iPad. As I sit here on the sofa with my nice, shiny new MacBook Pro (which I love dearly, it’s a wonderful laptop) I can’t help thinking, “Hey, there’s an iPad version of WordPress just waiting for me.” Would it be wonderful, or painful to use?

Since I was holding an iPad thirty minutes ago and reaching for my credit card about the same time (spoiler: I didn’t buy one) I still have to say, “It surprised me.”

First, it’s a lot smaller than I imagined. Looking at Steve Jobs hold one on stage, I thought it was much bigger than it really it. It looked about the size of a typical school textbook, but instead it’s more about the size of a modern hardcover novel, but much, much thinner. I’d compare it to the Oracle, AZ phonebook, but only about 4,000 people in the world would get that allusion. It feels about as thick as a Blue-Ray DVD case.

Being smaller than I expected, the screen was better than I could have hoped. It’s bright, vibrant and alive, albeit smudged with greasy fingerprints from the great unwashed masses that were pawing the demo units. (I, of course, never exude grease from my fingers, the the iPad was cleaner after I used it than before.)

Like the iPhone, the iPad is defined not by its physical description, but by its applications. The pre-App Store iPhone was still a wonderful advance over old smart phones, but the post-App Store has leapt beyond the imagination. Much is made of the restrictions Apple places on the App Store, but it is still filled with clever, fun, outstanding programs.

Once upon a time – before PCs, before Apple – you didn’t buy computers because of the technology, you bought them because they had the software you needed to run. The App Store has brought thousands of programs and therefore thousands of customers to the platform.

The people I know who buy iPhones buy them because of what they can do. Oddly, the people I know who buy Android phones buy them because they don’t want to deal with Apple or AT&T. Sucks to be them – that’s not carving out a market, that’s cleaning up the crap left behind. An honest living, but not usually the fast track to success – just ask the zookeeper at the elephant house.

The demo units were fairly sparse on applications. There were a few games, which I didn’t bother with, the typical widgety stuff, like weather, and then the biggies – Email, Web Browsing, Photos iBook, Pages, Numbers, Keynote.

Email wasn’t setup, so I didn’t test it out and I gave web browsing only a mild glance.

Photos was gorgeous. I can easily imagine a photographer friend of mine carrying the pad around to show off photos. Yes, you can do the same on the iPhone, and I’ve done so, but the iPad’s picture viewer was stunning. It doesn’t hurt that the demo unit is loaded with professionally done photos, but I have no doubt that the picture of my latest pizza would be equally stunning.

Pages, Numbers and Keynote seemed like they might just need a little instruction. I had some immediate questions about editing spreadsheets, creating and saving word processing documents that didn’t spring forth magically from the touchpad just because I was thinking, “How the heck do I do this?” Clearly the brain-reading interface isn’t installed on these new models and the multi-touch metaphor didn’t quite make it easy enough to make it obvious. Still, from what I did do with it, it was quite capable, although, like others have no doubt pointed out, I probably wouldn’t want to write a novel on it.

iBook actually sold me on the iPad.

I’m not a fan of eBooks. I like having a book, I like my library to be full, the shelves crammed with books. They give me comfort, enjoyment, accessibility and the deaden the echo of an empty room. They are convenient, nearly foolproof and, although I might be upset when a friend dropped one of my time-travel sci-fi books into his sink, ruining it (and it was out of print), I don’t feel quite the loss I would If my expensive electronic gadget fell in the toilet – taking not just one, but all of my books with it.IMG_3817

I’ve played with a Kindle – it blows. I’ve played with the Sony eReader – it blows. The Kindle app on the iPhone – sucks, as do the other book readers. Some people read eBooks on their computer screen. I don’t read at my desk, that’s uncomfortable and ruins the experience. Even reading with the laptop just isn’t right. There’s nothing quite like reading a book.

The iPad is the first implementation I’ve seen that I said, “This isn’t so awful. I could read a book like this.” More, I’m looking ahead to magazines. Much though I love having a collection of back issues Skeptical Inquirer, New Scientist or Fortean Times, I rarely read them and they collect dust and waste space. I’m very open to (lower price) magazine subscriptions (or even single issue purchases) on the iPad. While iBook doesn’t do that, it does point out that the form factor and the capabilities of the iPad are perfectly aligned for magazines.

James was reading Winnie The Pooh and turning pages like a pro on the iPad in seconds. It is simple enough to be child-friendly, although I would worry about that glass screen and how James has a tendency to stand on his books.

I have a few ideas for applications of the iPad and now, having touched one, I can see that they really are viable. This is a device that could be used in a variety of non-traditional settings. There are places were even a laptop is too unwieldy and intrusive. Small, lightweight, and most importantly – an actual real computer, with a robust development system – the iPad could (and I think will) begine showing up in places where you’ve not seen computers before – or seen them used awkwardly.

Yes. I’m not saying anything that a lot of other reviewers have said before, and perhaps I’m just towing the party line, but playing with one makes you believe.

I had absolutely no intention of buying an iPad for at least 90 days, perhaps longer. I’m sure Irene had no intention to buy one at all – they are, after all, a minimum of $500. Yet still, she played with the one at the store, read some of the Winnie The Pooh book with James, plunked around in Pages/Numbers/Keynote and she was almost sold. If best Buy had been open for another hour tonight (and not closed for Easter tomorrow) I’d probably have one. They did have just a few left of all models at closing time.

You really do just want to play with it.

I love my iPhone. It’s like an extension of me. It does all sorts of neat things and I’m always pleased to have those things with me, but at the same time, some of them are still a little laborious. Writing blog posts for example. I can do it on the iPhone but… it’s a chore. The iPad feels like a device that will make even those chores easy. Sure, it wouldn’t as mobile and therefore I won’t always have it with me like I do my iPhone and that might be a deal breaker in the end but on balance I think not.

Time will tell. Perhaps Monday, even.

New MacBook Pro – Initial reactions

Haunted MacBook Pro By now you all know the sad tale of my home being burglarized last month and the villains getting both my wife’s laptop and her iMac. Luckily, my old laptop was with me, or it I have no doubt would be gone, too. My wife decided she didn’t need a desktop and a laptop and opted to get just a replacement laptop. And so, as a consequence, I’ve decided to sell my MacBook, which was getting a bit long in the tooth and replacing it with a newer, bigger model. Effectively, we’ve been reduced by one computer.

My new laptop is a MacBook Pro 15″ model, with the 2.66 GHz processor. (Shown in the picture with a phantom in the screen).

Like many people, I had to play the “should I buy or should I wait?” game. Rumors have been flying for weeks that a refresh to the MacBook Pros are due and while I doubt the prices would go down, certainly specs would go up, but in the end, I decided I’d rather have a nice, stable model, which already has plenty of horsepower.

So far, I think it’s pretty fantastic. I was put off by the unibody, sealed battery design, but in my first test, I got five full hours of near continuous use. Not quite Apple’s estimated seven hours, but by far the longest I’ve ever seen a laptop run on a single charge. There is a noticeable difference in the battery drain when using the high-energy consumption video subsystem, and after the first hour, I switched that off.

In comparison to my old MacBook (first generation) here are the things that really stand out:

  1. The LED backlit screen really pops.
  2. It’s obviously much faster
  3. The backlit keyboard is really nice in a darkened room, but at an angle, makes the whole computer look like a xmas tree because of light spilling out from under the keys.
  4. The light sensitive display takes some getting used to. The brightness will adjust if someone walks in front of your light source. It’s very quick and distracting.
  5. The larger speakers make for better sound
  6. The SD card reader… I haven’t used. The bastards stole our camera, too.
  7. The no-button trackpad is great – once you get used to it. After only one day, it’s hard to use the old MacBook’s pad because I forget I have to click the button. It’s cool to be able to write Chinese by just drawing the character on the pad, too.
  8. I’m not sure I like the feel of the aluminum. I almost feel like it’s always going to slip out of my hands.

So after one day, it’s thumbs up all the way. For now.

OSX Time Machine – Brilliant or Bust?

Aren’t backups a wonderful thing?

As an IT professional, I can tell you that most people never backup their computers.

Organizations are a bit different. Most recognize the need for backing up, but fewer actually test their backups.

In OSX Leopard, Apple recognized that people don’t backup their computers. Further, they recognized that, increasingly, our lives are recorded on our computers – from our personal documentation to our priceless photographic memories. In Leopard they introduced Time Machine, an automatic backup and recovery system designed to make the process painless and automatic.

I’ve used Time Machine since it first came out and, like most most people, I’ve had no real reason to need it.

Oh… I’ve restored the occasional file, but it’s never been critical… until now.

When we were burglarized two weeks ago, they took, amongst other things, my wife’s iMac. We know that the burglary occurred between 10:30 and 11:30AM because at 10:38, her iMac made one last Time Machine machine backup across the network. If there was any positive thing to take from this it was that we had a full and complete backup of her machine in Time Machine format. But how well would that work when we went to restore it onto a new computer?

For starters, we had some data that we needed immediately. Part of the Time Machine enhancements in OSX Snow Leopard is the ability to open other machine’s backups, so we were able to use my laptop to open and verify her backup, plus grab some important files right away.

Now that her replacement computer has arrived, it was time to put the backup to the real test: Restoring her entire old computer backup onto a new computer, with a completely different hardware configuration. The old computer was a 24″ iMac with 350Gb of disk – 200Gb used – the new one, a new model MacBook with 250Gb disk.

The first thing I did after the burglary was to backup her backup – before I started trying to restore files from it. Time Machine backups are stored in a single file and I copied that file from the network backup drive onto a spare external drive. I had hoped that I would be able to use the external drive to restore the backup as that would be faster than pushing the entire restore across the local network.

When the new MacBook arrived, I plugged in the external drive and fired up the machine per the instructions. When you setup a new Mac, it allows you to copy your data from another machine – a real timesaver if you’re migrating from one machine to another. One option is to copy from a Time Machine backup.

Unfortunately, this didn’t work. It simply failed to recognize the external drive as having a Time Machine backup.

My remaining option was to try to restore from the network. I joined the local network and the MacBook instantly spotted my Time Machine drive.

That’s when the next problem occurred. The drive I use is a terabyte drive, partitioned into 4 different drives, each containing the Time Machine backup for a different computer on my network. The MacBook spotted and reported all four drives. I selected the one associated with the iMac and it asked me to log in. It went into a never-ending wait, displaying simply the word “connecting…”

While that continued on for half an hour (before I gave up), one of the other drives almost immediately popped up stating “1 Time Machine Backup Found.” This was worrisome. Could it be that Time Machine was too confused by having four different drives? Certainly, I didn’t wish to restore the drive it was indicating was available. All the while, the “right” machine was failing to complete its connection.

I tried several times, using both my wireless connection and a hard-wired connection, with no difference in result.

Eventually, I decided that I’d see what happened if I selected the “wrong” Time Machine backup. Lo and behold, it presented a backup that was for the right computer. It somehow was showing me the backup for my wife’s computer on the Time Machine for my computer – probably because I had opened her Time Machine with my laptop to restore those files right after the burglary.

And so I began preparing for the restore. There was just enough room to restore everything and after it thought about the backup for about 10 minutes, I let me select everything at start the backup.

Estimated restore time over the gigabit LAN: 5 hours 10 minutes.

Here I am, six hours later and it has just finished.

And what’s the verdict? It was slow, a bit problematic to get going, not entirely intuitive, disappointing in that it couldn’t see the external drive with a copy on it but ultimately absolutely brilliant!

I am looking at an almost exact copy of my wife’s computer, intact and catching up on back e-mail and a few system updates.

Time Machine really saved our bacon on this one!

iPad… is there a gap to fill?

IMG_0139I’ve been shying away from reading commentary today about the iPad, mostly because I wanted to form my opinions in a vacuum (like I always do 🙂 ) on the device.

I’ll say in retrospect that I am one of those people who thinks a tablet computer is generally a bad idea… at least as a mass-produced consumer good. Apart from specialized vertical markets, I’ve just not been convinced that I’d have a reason to use such a device…

…and then there’s the e-book reader.

I can’t get thrilled about e-book readers, either. Certainly, I read enough books (see my pictured current bathroom reading stack) that I ought to appreciate the idea of a single, compact reading device, but I just like books. Equally certainly, I read a heck of a lot of material on a computer screen, so I’ve not got an aversion to screen-reading. The Kindle and the Sony ebook reader both leave me flat. As a small electric device, it will never be where I want it to be, while books are scattered about my house, ready for me to pick up and start reading.

So, given that I don’t like tablets and I don’t like e-books, will the iPad change my mind?

Maybe… but only just.

My iPhone, which I’ve now had nearly two years, was a game-changing device. Most of my e-mail correspondence is done on it. 20% of my blogging, nearly 100% of my Facebooking and 60-70% of my daily news reading is done on it.

I do these things because it’s on my hip or at least within arm’s reach most of the day from the time I get up until the time I go to bed.

I heave learned to rely on it being at hand. No more do I have to get up and toddle into the computer room to look something up or to kill some time reading news. Some might call that laziness, but I call it convenience. I also find that, with constant access, I look more things up. In short, I use more internet time now that I have the iPhone.

Given that, I can say that it would be nice to be using a larger screen, so, provided that the iPad becomes the world’s most expensive coffee table book and I keep it constantly next to my sofa… I might just find it a useful and cool device.

I’ll likely not be running out to the buy one any time soon.

iPhone 3GS Experience – The “buy”

I haven’t had my new 3GS long enough to really give a good account of what I think of the various upgrades, but I can, at this point, give my opinion on the Apple Store experience that I had getting the upgrade.

For the record, generally, I have had no problems at the Apple Store, and, in the grand scheme of things, my upgrade purchase experience wasn’t as bad as an impacted tooth extraction, but it wasn’t up to the standard I expect of Apple. Here’s how it went down…

I knew that evening that I was going to purchase the 3GS, so I went online to check availability of the model I wanted. I saw that you could pre-process yourself for the upgrade online, so I did so. At the end of the process, you are presented two options (1) Go pick it up at a store, (2) Have it mailed to you at no charge. At this point you have not specified which model of iPhone you’re after.

Since I wanted the phone immediately and live near an Apple Store that had them in stock, I chose the pick-up option. I was a little surprised that as soon as I chose that option I was, essentially, done. No further questions were asked, it simply told me which Apple Stores were nearby my zip code and that I should go see an orange-shirted concierge to complete my transaction.

At the front of (I assume) most every Apple Store are the twin tables of high sales, iPhones on one side, MacBooks on the other. I walked in and trundled right on past the iPhone table and headed for the one orange-shirted concierge visible in the store, who, upon explaining that I had pre-processed myself online for an upgraded iPhone, told me I needed to go back to the iPhone table and talk to one of the “guys” floating around there.

That was strike one. (Hmm, that’s a baseball metaphor. Don’t they have cricket metaphors for this sort of thing? How about, “Going on to hit middle stump, but just slightly pitching outside leg stump”?)

So, I proceeded back to the iPhone table, where there was one Apple employee “floating around.” He was, however, engaged with another customer. A customer who had an iPhone, another iPhone box, a folder full of papers, several of them spread out on the iPhone table, a phone in hand and obviously lots of problems with… something. I never did find out (or care) what.

The thing was, the Apple store guy was helping him. He was answering questions as the guy was on the phone, but most of the time, he was just standing by. After I’d been there for a minute or so, and there was a lull in the Apple guy’s time, I just mentioned to him, “Hey, I know you’re with this customer first, but when you get done, I’m pre-approved for a 3GS upgrade and I’d like to pick up my phone.”

“Great!” he said, “that’ll just take two seconds. Do you have MobileMe?”

“Yes, I do.”

“Oh, that’s great! It’s really useful.”

“Well, I have 6 Macs and the iPhone and it’s great for keeping them all synced up cleanly,” I said, trying to inflate my Apple capital as much as possible in the hopes that the two seconds to upgrade could start right now.

“Six Macs, really?”

“Yeah… about. I’ve got two laptops, an iMac, an eMac, a PowerMac G4… oh and a MacMini, so yeah, six.” (Knowing full well that I gave the G4 to my dad years ago.)

“Cool. Did you know when you buy an iPhone you can get MobileMe for only $69 instead of $99?”

“Well, I’ve already got it.”

“Is it due for renewal? You can still buy it with the phone and get the $30 off.”

Another Apple employee, who wasn’t apparently doing anything, drifted in from over near the MacBooks, and helped, for a few moments to try to sell me on MobileMe… a product I already own… not the product that I had already stated I was there to buy – right this instant, with credit card in hand, if only someone would take my money. Please! Take my money!

Apple guy 2 walked away when someone approached the MacBook table.

At this point, the first Apple guy, who was facing the large glass front of the store started staring out the window. He was staring a particular way. He was staring in that way that you do when you’re looking at hot women walking past the store. His head tracking as they passed.

The funny thing is, this being an Apple Store, for some reason, I didn’t want to look. The look should have been reserved for hot chicks in skimpy clothing but, being an Apple Store… I was a little afraid to look. I had my doubts that I’d see women outside that window. And, not because I had any indication that this particular Apple Store employee… as Stephen Fry put in a speech at Lords the other day, “…bowls off the wrong foot…” but just simply the Apple Store environment seems to divorce people from the ordinary world of human interaction.

“Did you just see what I saw?” he said. Apparently oblivious to the fact that I had my back to the window and was talking and looking at him at the time, in a vain hope that, while his other customer was still embroiled in a somewhat heated discussion on the phone, that he might start that two-second transaction I needed to get going.

“No. I didn’t.” Not asking what it was in a subtle hint that i didn’t want to know. I resisted the temptation to say, “If I had my iPhone 3GS, I could have video recorded it.”

“I just saw a bunch of wizards walk by.”

“Wizards?” I said, thinking I hadn’t quite heard him right.

“Yeah, some friends and I were going to go see Harry Potter at twelve, but I guess that means that it will be full.”

I hadn’t, until that moment, made the Potter connection and thought he was actually seeing “wizards.”

At that moment, the customer ended his call, and the employee went back to talking to him. In just a couple seconds, something had been decided, and the Apple guy had to go into “the back room of mystery” at the back of the Apple Store.

OK, the guy was helping the first customer, and I can’t fault him for taking care of one customer at a time, but the fact that he had time to yak with me and try to sell me on MobileMe, rather than just sell me my phone was strike two…. or, in carrying over the cricket theme, “a thick outside edge that didn’t quite carry to first slip.”

If I’d been writing this in a clever fashion, I would have somehow subtly worked into this narrative a passing, imperceptible comment about how I was wearing a dark maroon, almost dried-blood brown polo shirt. In fact, I probably would have called it brown, if asked. I failed to do that cleverly, so let this paragraph represent the ham-fisted foreshadowing of what’s to come.

While I’d been waiting, talking with the Apple guy, a couple had arrived at the table, and were also clearly waiting for help. Another guy, in a bright red polo shirt, entered the Apple Store and went right to an open phone at the iPhone table. He picked it up and started examining it.

An Apple Store employee swooped on him immediately. “So, you want to buy a new iPhone?”

“Um, yeah, well, I’m interested, but I’m not sure I’m going to get one tonight.”

Apple Store employee looks confused and says, “Oh, they told me to come here and help the guy in the red shirt to upgrade his phone.”

I look at my not-quite-but-sort-of red shirt and realize what’s (finally) happened. “I’m the guy in the red shirt.”

First the Apple Store employee looked at my shirt with skepticism, then recognition dawned on his face… you see, this Apple Store employee, who I intentionally didn’t identify as “Apple guy #” was in fact, Apple Guy 0, the employee in the Orange Shirt that I sought out when I first walked in the door, 15 minutes earlier.

That’s a thin inside edge that dragged the ball back onto his stumps for a wicket. (Really, baseball lends itself much better for this type of metaphor.)

Anyway, at this point I was committed, so I let him finalize the purchase, which didn’t take two seconds, but more like 5 minutes. The phone switchover process might have taken “a few hours” but completed before I got the kids away from the iMacs and was out the door.

As I said, it was nothing in comparison to dental surgery, but it was my worst Apple Store sales experience.

iPhone 3GS

It’s probably no surprise that my refrain around my house is, “I want an iPhone 3GS.”

I also happy to report that, despite not getting one for Father’s Day as perhaps I’d hoped, I did, at least, get a promissory note for one in late July/early August. (The issue is not really the upfront cost of the phone but the ridiculous monthly service cost, which is $15 a month more than the original iPhone.)

First let’s talk about my old iPhone. The 3.0 OS upgrade as not been good for my iPhone. Despite the welcome addition of cut/paste, push notifications and all the other iPhone OS 3.0 goodness, my phone is now dog-slow. Keyboard responsiveness is in the dumps, and often gets 10 seconds behind my typing. Some programs (not all) open at agonizingly slow speeds, and while push notices seem to work fine in the background, my e-mail doesn’t. Sometimes the phone will go 4 hours or more without receiving an e-mail, but as soon as I go into the e-mail program, all my mail over the last few hours suddenly downloads.

I’m going to assume (hope) that these are teething bugs in the 3.0 version of the OS and that a 3.0.1 will be out any day soon (much like 2.0 had very similar problems) to fix them all, rather than the inevitable obsolescence of my original phone. Since there’s not that much technological difference between the iPhone and the iPhone 3G, I can’t imagine that this is the end for the iPhone just yet.

I even went as far yesterday as to wipe my phone and load it from scratch. What a pain in the rear that is! I didn’t want to re-load any problems from my backups, so I had to do the clean sweep and manually re-configure the phone. It took hours. To be fair, it helped a little, but the phone is still not receiving mail regularly and the keyboard starts to lag very quickly. Here’s to the arrival of 3.0.1 (and hopefully not having to wait for 3.0.2.)

So, that said, a co-worker and I went down to the nearby Apple Store and gave the 3GS a good 15-20 minute, side-by-side comparison to my iPhone for speed tests. Wow! Fast barely describes it – and I don’t mean network speed. The new phone has a huge improvement in operational performance. Programs zip open, even Google Earth is more responsive than on my desktop. It’s just one mean, fast phone. I can hardly wait.

Adventures in Objective-C – Part 2

On the subject of the Stanford University (iTunes U) iPhone Programming class.

I had a professor at university who walked in the door on the first day, slammed a book on the podium, and in a loud Germanic accent bellowed, “There will be no stupid questions in this class! The only stupid questions are the ones you don’t ask.”

To my young, impressionable 17 year-old mind, it made so much sense that I thought it almost profound.

The problem is, youthful idealism can be rapidly eroded away.

There are stupid questions. The ones that used to particularly annoy me were when a fellow student would ask the professor a question that had just been covered or had just been asked by a different student and answered by the professor.

I remember sitting in class thinking, “Pay attention next time. You’re wasting my time.”

These unpleasant memories all came flooding back to me during the first few videos of the Stanford iPhone class and I really thought I might have to give the whole endeavor a miss. When I was 17, I didn’t have to take blood pressure medicine.

Fortunately, within the first few classes either the offending students were gone, or they’d gotten with the program. Since then, it’s really been invaluable to my study of iPhone programming. Typically, books have never worked well for me hen learning a new programming language/paradigm/whatever.

Hands on is what works for me but even that needs some “seeding” with some information. The iPhone developing environment/community was stifled for some time. Apple’s (some say) draconian non-disclosure agreement for early developers prevented source code and discussions from appearing on the net. It even prevented books on the subject from being printed. Thorough as Apple’s documentation is, it’s better as a reference than as a starting point. There hasn’t been a whole lot out there until recently.

I’ve completed plowing through “Beginning iPhone Development: Exploring the iPhone SDK” (Dave Mark, Jeff LaMarche) and am most of the way through initial development of my first iPhone application – more on that another day – so I’m not coming at this class completely cold. Nonetheless, it has helped me resolve numerous logical problems with my in-development application. This is not because the detail or content of the course is far-reaching, but simply because…

Let me digress for another moment.

Here’s another thing that I learned very quickly at university. Not all professors are created equal. In the Computer Science Department in the College of Engineering they had two kinds of professors. They had staff professors who carried a typical teaching workload and they had professionals who worked at some of the local companies who came in and taught the 7:20AM classes and then nipped off to to their real jobs.

You could guarantee those 7:20 classes were the best. In Computer Science knowledge and theory are essential but there is no substitute for solid, real-world experience. The professors who had both were awesome.

So back to the class. The two lecturers, Alan Cannistraro and Evan Doll, both Apple employees working in iPhone development, really demonstrate their knowledge of the subject. It comes across best when they’re answering some of those (good and/or not-so-good) questions from the class. More than once, when they switch over to do some code on-the-fly or respond to something that’s just askew from their prepared lecture I have those, “A Ha!” moments that get me closer and closer to understanding.

I feel this class is really a good example of what iTunes U can do. While I’m not exactly sure what the incentive for universities are to put things in iTunes U, this has convinced me to check out some other courses.

I read yesterday that the Stanford iPhone class has had over a million downloads. Impressive. Of course, if that represents 1 million viewers, (which I doubt it does, but we’ll just use that number for giggles) that still means that at least 900,000 will do nothing with what they learn. That leaves a 100,000 who will try and 90-95% of the them will probably have to go buy Macs to do Xcode development on. I can see why Apple seems happy to share its employees in this project.

Adventures in Objective-C – Part 1

I’ve been trying to get my head around Objective-C and Mac/iPhone programming for the last month or so. At this point, I think I’ve got most of the major concepts down.

As an Object Oriented (OO) language, it bears a certain familial resemblance to Java, which I typically program in these days.

While I’m not going to say that Java is a “better” language, I do feel that parts of Objective-C are a capricious conglomeration of logic-unfriendly syntax.

It’s the implementation of these things that’s irritating. Obviously there’s a certain amount of familiarity and personal preference, but over this series of articles, I’ll highlight a few. I’ll start with a simple syntax example.

Generally in OO programming, you break things into programatic “objects”, which define the properties of an object and the actions that such an object could do.

In Java speak, these are properties and methods, in Objective-C they are properties and selectors. In Java you “call” a method, in Objective-C you “message” a selector. Same thing, different terminology. Clear as mud? Good, then let’s continue.

Typically, properties on an object are protected behind accessor method, such as “getXXXX” and “setXXXX” where XXXX is the property name. Sometimes these are called “getters and setters” – that’s in Java, of course, Objective-C calls them “accessors” and “mutators”. Objective-C also uses a slightly different convention. Mutators are still “setXXXX” but accessors are just “XXXX”, which can result in a little ambiguity as to whether you’re looking at the actual property variable or the accessor selector.

Java uses “dot-syntax” to refer to an object’s methods, so far example, if you have an object called “newton” and it has a method called “dropApple()”, you would access it like this:

newton.dropApple();

Objective-C uses square bracket syntax, so the same thing would be:

[newton dropApple];

…and if each one took a single parameter, they would look like this:

newton.dropApple(velocity);

vs

[newton dropApple:velocity];

It gets a little muddier when we move to two parameters.

In the example above, I’ve passed a variable called “velocity” which we’ll say is of object type “Speed”. Let’s add a second object type of “Height”, with an instance variable called “headHigh”

We would DECLARE the java method like this:

void dropApple(Speed incomingSpeed, Height incomingHeight) {

…. do stuff

}

and call it like this

newton.dropApple(velocity, headHigh);

Objective-C would be declared like this:

(void)dropApple:(Speed *)incomingSpeed dropHeight:(Height *)incomingHeight {

…. do stuff

}

and called like this:

[newton dropApple:velocity incomingHeight:headHigh];

Here’s my first irritant, Objective-C selectors use named parameters – which I like better than Java, but only on the second and subsequent parameters. The first is identified by the name of the selector. It’s just a mixed-bag inconsistency. I hate inconsistencies in my programming languages.

This same system also helps cause Objective-C messages to tend to be very long.

Java and Objective-C also share another trait, that being if a message/call returns an object, you can then, in turn message/call that object immediately without passing it through an unnecessary intermediary object variable.

Let’s say we’re somewhere inside an object that is running active code – like a program. I can always reference back to myself with the special keyword “self”, so if my program has a property of type Person, and a Person object has a property of type “phoneNumber” and a PhoneNumber has a method that returns a formatted representation of the number, we can get to that formatted string in java like this:

self.getPerson().getPhone().format();

Self being an object with a getPerson() accessor that returns a Person, which in turn has a getPhone() accessor which returns a Phone, which in turn has a format() method to return a pretty string. It’s not uncommon to see these things strung together 4 and 5 levels deep inside Java code, and it’s a bit difficult to read, but convenient, and sometimes a lot better than assigning each step to a new variable, like this:

Person aPerson = self.getPerson();

Phone aPhone = aPerson.getPhone();

String aString = aPhone.format();

How does Objective-C handle this? Like this:

[[[self person] phone] format];

Simpler, right? Yes and No. It’s irritating. Why? Because you have to know, in advance, how many layers deep you are going so that you can put the right number of square brackets on the left. If not, you have to come back later and add them, which really “breaks the stride” of typing. It may be less letters to type, but it takes longer to type.

Ah, but along comes Objective-C 2.0 with a “solution” to this: Dot-Syntax!

Oh, but it isn’t the same as Java’s dot-syntax. Objective-C’s dot-syntax only applies to properties, not selectors. (Actually, properties are selectors, you’re not seeing the actual variable, but these are special) That means you can do this:

self.person;

or

self.person.phone;

but not

self.person.phone.format;

instead it would be:

[self.person.phone format];

Why is this a problem? You don’t always know if something is a “property” or “selector”, and since the IDE (XCode in this case) helps fill this stuff in from it’s calculated list of available options, it promotes a certain natural “coding laziness” by letting the IDE do the work of remembering names for you.

So you start typing “self.pe…” and about that time it suggests “self.person”, so you hit the arrow and continue typing “.ph…” and it breaks in again and suggests .”phone” so you hit the arrow to accept and then you start “.format” and nothing happens, then you realize, “oh, it’s not a property”, so you go back and delete the period. That’s bad typing technique. And, then, of course, you have to go back to the beginning of the clause to add a “[” and the end of the line to add “]”

I know, I know. “Gripe, gripe, gripe, gripe”

Next time (probably) “Why there isn’t a consistent method for delegates, actions and ad hoc delegates”