Tag Archives: Computing

Mountain Lion — The Good, The Bad and the Ugly

I’ve been using Mountain Lion, the new version of the Macintosh operating system, for less than a day so this isn’t intended to be detailed (see John Siracua’s review) or thorough. I have, however, kicked the proverbial tyres so here are a few, quick thoughts.

Good

  • Probably the most stable 10.x.0 release I’ve used
  • Little earth shattering but lots of really nice improvements, not all of which I’ve seen documented (for example, attachments in Mail now appear in the “All My Files” view in the Finder, multiple Time Machine disks)
  • Notification Center works well; AirPlay mirroring is going to be really useful
  • I’ve not found any software that worked in Lion that no longer works. That includes stuff like VMWare (scary because it’s low-level) and Photoshop Elements 6 which is not listed on Roaring Apps compatibility list

Bad

  • You’re not going to be able to make the best use of everything until iOS 6 comes out. This is a bit of a pain if you own a first generation iPad and know that this will never happen…
  • The installer got confused. After “less than a minute remaining” it went to “-1 minutes remaining.” It got to -7 before finally resetting to twenty minutes. It worked in the end so clearly this isn’t a “show stopper” but anything weird in a process that reconfigures your system is disconcerting
  • I launched Mail. It upgraded my database successfully and then, while I was making a cup of coffee, crashed. It’s been stable ever since, but first impressions and all that
  • Every time I click on Messages — the new iChat — it opens the instant message (“Messages”) window. Do Not Want

Ugly

  • The font in the new Notes app. What were they thinking?!
  • If you didn’t like the iOS-ification of Lion you’re not going to like Mountain Lion any better. But if that’s the case you’d probably start thinking about migrating to another platform!

But overall, at less than £15 it’s a no-brainer if you use your Mac a lot.

Programming Is Hard

It’s hard to explain to someone who is not already a programmer the kinds of things that you have to do when building an application. The thing you’re trying to explain is often very abstract and the answer frequently would involve lots of code.

That’s why I thought this particular problem might make an interesting discussion. In talking about this very simple problem we can talk about the things that developers deal with every day and, hopefully, the process can be followed by most people who have used an iPhone (or, actually, any computer). You won’t be a programmer at the end but you might have a greater appreciation for what happens behind the scenes.

The basic problem can be seen in this screen shot.

The login button is a toggle. That is, if I’m currently logged in it says “Log out.” And when I’m not logged in it says “Connect,” which is “log in” in Facebook parlance. A subtlety that you might not ordinarily notice is that when the user clicks the button, the keyboard should move out of the way when it’s not needed and come back again when it is.

There are two basic cases to consider:

  • When I’m not already logged in. In this case pressing the button opens the login screen and the keyboard should shift out of the way.
  • When I am logged in, pressing the button just logs me straight out. In this case the keyboard can stay where it is.

Easy, eh? (That’s what I thought when I started, too.)

Let’s sketch out the code.

when the button is pressed
  if I'm not logged in then
    make the keyboard move out of the way
    log in
  else
    log out

This is called pseudo code because while a computer can’t actually execute it we’ve broken down the processing into the required basic steps. You’ll have to trust me when I say that the real code (called Objective-C) isn’t terribly different.

Not so hard.

Except… you didn’t really think it would be that easy, did you?

It turns out we’re missing one important detail from our algorithm.

One thing we do a lot when programming is use pre-existing components (standing on the shoulders of giants as Isaac Newton, or Oasis, would have it). When you write a component you’re going to come at the problem with some specific ideas of how it’s likely to be used. Hopefully these ideas are the most common ones as this will make everyone else’s life significantly easier.

In this case, our button — a pre-existing component that I didn’t write — is a clever one. It already “knows” how to log in and log out of the service. This sounds like a great time saver and it simplifies our algorithm to just this:

when the button is pressed
  if I'm not logged in then
    make the keyboard move out of the way
  else
    do nothing

Only, it turns out that that doesn’t work.

Why not? Well, the implicit assumption in the above pseudo-code is that it is run first, that is, before the instruction to log us into or out of the service. But if the button logs us out before any of my code is run then no matter whether I was logged in or not before I pressed the button, the above code will find that we’re logged out and move the keyboard out of the way.

When you’re writing a user interface you find dozens of these tiny little details getting in the way of what you’re trying to do. Any non-trivial screen will have lots of these little problems, and the worst thing? No-one will ever know. If you do your job well no user will ever see these little glitches.

Talking of which, how do we eliminate the anomaly that we’ve just found? The solution is pretty simple. At the moment we’re trusting that the button “knows” whether we’re logged in or not. Instead, we’re going to have to take responsibility for doing that as well. That adds a little bit of complexity but isn’t too scary:

  • When the screen opens we need to check whether we’re logged in or not and remember that. In Objective-C we call that a “variable,” but really that just means something that we’re going to store and access again later
  • Later, when the button is pressed we can use the following pseudo-code:

    if the value I saved says that I'm not logged in then
      make the keyboard move out of the way
    else
      change the stored value to "not logged in"
    

  • When I’ve finished logging in — remember I could press the cancel button in the log in screen — change the stored value to “logged in”

And that’s it, we’re done. We have a working version of the log in button.

The final point I’m going to make here is that I ended up discarding all the code above. It just didn’t work as well as I wanted and I ended up implementing it in a completely different way. And this really is the kind of detail that you never notice. A good chuck of any programming project is prototyping, building mock-ups and other activities that don’t directly end up in any shipping product. All this discarded work — which does, at times feel like a waste of time — is designed to make the product better.

Some people who have never programmed say things like “there’s nothing complicated there” or “it’s only a button!” Hopefully this post has shown that even a simple button can be far more work that it initially seems.

Communication

“Do you ever change this type of trade?”

I was sat on the trading floor discussing a new feature that I was implementing with the person who would be using it the most.

“No, never.”

This was one detail of the change that would have far-reaching consequences in the code. A “no” would mean a few days of development, a “yes” would indicate several weeks.

“Are you absolutely sure? You don’t change it even once a month?”

I knew they’d like the smaller estimate but, equally, I knew that I didn’t want to end up trying to implement several weeks worth of functionality in the smaller time frame. I’ve seen that kind of thing happen too often.

“John ((Names have been changed to protect the… well, they work for a bank so I hesitate to say “innocent” but you know what I mean.)), we don’t ever change these trades do we?”

John was the head trader. If anyone would know it would be him.

He rubs his head and leans back, thinking.

“Why would you want to? No, I can’t see us ever changing one.”

Of course, you can guess what happened thirty minutes into the first trading day with the new software.

So, what happened here? Why did we get the requirements so wrong? And why did we only find the mismatch after the system was moved into production?

Both the problem and the solution is the same thing: communication. Or more precisely, communicating using the right language.

Some developers are happy to only “speak” technical, proud that they are masters of their programming environment but ignorant of their users problems or how they really use the software.

Above I started out correctly, I was trying to understand the traders business and talking in terms of booking trades, positions, legal entities and a bunch of acronyms that would make even less sense out of context.

But I made one error: I used the word “change” without defining what I meant. I meant, well, any change. And so did they. Yet they didn’t consider moving a trade from one book to another to be a change and, unfortunately, I did.

You’d like to think that there were checks and balances in place to make sure that this kind of thing didn’t happen. And there were. In addition to informal and formal testing, there was over a week of “parallel running,” where the traders had to use the old and the new system together and check that the results were the same in both of them.

Were there any moved trades during this time? Of course. Why did the traders not notice? Well, it was about right; the differences, while present, were explicable and so not considered significant enough to mention even though I asked to hear about any problems at all.

So, again, communication. Or at least human nature. I wanted to hear about any differences but they tried to help me by only talking about differences that they couldn’t account for.

What’s the answer? Well, I’m not sure there’s an easy one. “Understanding your user” is a short, simple phrase but hides so much. If you spent the time to fully understood their job you probably wouldn’t have the time to do your own. But finding the balance is crucial.

The Up-Sell

I don’t mean to single out a single business here. The flaw I’m pointing out is shared by many sites but this post was inspired by a recent visit to TripIt. In general it’s a great service. It’s well thought out, allowing you to enter all your details with a minimum of effort; just forwarding your email confirmation to them is a masterstroke.

However. (You knew that was coming.) However, many links on the main page are non-functional, by which I mean they push you straight through to their paid-for service sign-up form.

The “tricky” part is that before you press them it is difficult to know which links actually work and which ones just ask for money.

There are a number of other tricks that some sites have. Another favourite is the interstitial screen, forcing you to view adverts before you can do what you actually want to do.

But it’s not just that I find it obnoxious. I don’t have data but I do have a nice anecdote that shows that it doesn’t really work.

During the dot.com boom I helped build a website. The launch went pretty well but the client decided that they wanted to push a secondary product, one with great margins but where customers really needed to be vetted. (I don’t want to get into specifics but it was a financial product.) The marketing people said that a pop-up would be the right thing to do.

We balked at the idea. At the time, pop-ups were the scourge of the Internet. They were used on all the least reputable sites. Technically adept users closed them without looking; the less fortunate were conned into either filling their screen with pointless adverts or visiting website they had no interest in. Pop-up blockers were a few years away.

In short, we felt that at best there was a reputational risk. Unfortunately we couldn’t come up with numbers to show that it was financially a bad idea, plus it was actually pretty cheap to implement. So they asked us to go ahead with it, over our objections.

As I recall it didn’t last very long.

After go-live there was a substantial up-tick in the number of people applying for this secondary product. However, there was actually a drop in the number of people who were accepted. That’s to say that it attracted exactly the wrong kind of person, which is bad enough, but there was also a cost associated with each rejected application.

Moving back to 2009, I think the problem with pushing your paid products too hard is that you actually make your free version less appealing. And, frankly, if your free version is a pain to use I’m certainly not going to pay for the full version just to make the evil bits go away.

To be clear, I have nothing against the so-called “freemium” business model. It can work really well. Flickr, for example, seems to have the balance about right: the site is useful even if you don’t pay for it with the extras useful for regular users. And paying LWN readers can get their content a week ahead of other people.

In short, if your paid extras are genuinely useful you don’t need to be obnoxious, you don’t need lots of “dead” links or interstitial adverts. And making your free version painful is most certainly not the answer.

Snow Leopard

Most people reading this will know that Snow Leopard refers to version 10.6 of the Macintosh Operating System, Apple’s latest update released late last month.

I wasn’t sure whether I should upgrade initially. I have been stung before by being an early adopter. Mac OS X 10.4 was a nightmare on my iMac G5. The big ticket new features such as Dashboard and Spotlight worked just fine ((Some would argue with that statement. Personally I never had any serious problems with Spotlight.)). What didn’t work were little thing like, oh, networking. Eight times out of ten it couldn’t connect to my AirPort Base station. This made almost everything, including downloading patches to fix this very problem, a compete and utter pain. I think it took until 10.4.3 before everything worked reliably.

I waited several months before making the leap to 10.5 for this very reason. But Leopard at least had some neat new features (and the lame new look of the dock) to try to tempt me over. Snow Leopard, by design, has few user-facing enhancements to make it worth the risk.

Of course I’m not a typical end user. The reason I moved from Windows to the Mac back in 2001 was because of its Unix underpinnings:

MacOS X is based on a BSD Unix kernel (called Darwin and available under an Open Source licence) and has an enhanced Macintosh user interface grafted on top. This is truly the key. You have the complex internals available from a command-line when you need it and a state of the art GUI when you just need a word processor.

And now that I’m an iPhone developer I have a vested interest in using the best tools available for the platform, and they were only available for Snow Leopard. Also a lure where the new APIs (Grand Central Dispatch, OpenCL) and language enhancements (blocks). I’ve not done much Macintosh development but these were exactly the kind of things that would potentially get me started.

All this is a long way of saying that, despite the risks, I took the plunge anyway.

And…

Well, so far it’s pretty much been a non-event.

Yes, it’s quicker. Most noticeably in starting up, shutting down, Time Machine and in Mail. Don’t get me wrong, there are lots of nice little things — and I’m still finding new ones — but it’s mostly been entirely seamless, almost an invisible upgrade. And I mean that in a good way.

Yes, all my programs still work. I’d read reports that PhotoShop Elements didn’t work under Snow Leopard. I can report that it takes a considerable amount of time to start up and frequently beach-balls afterwards. Or, put another way, it works just as well as it did under 10.5.

I’d also seen scare-stories about old versions of Microsoft Office and other PPC applications that need Rosetta to run but, again, I’ve not seen any problems ((To be fair, I moved to Office 2008 around the same time.)). Even lower level software like my screen calibration program and film scanner software are fine.

I have two negatives so far, both fairly minor in the grand scheme of things.

The first affects Yummy and Yummy Browser and that’s the fact that the new version of Xcode only supports developing for iPhone OS 3.x ((It’s true that you can build for older releases but there’s no way to test it in the simulator. I’m not willing to release software that I’ve not been able to test.)). Luckily there are very few users on 2.x but it’s still a little disappointing that I have had to make the move.

Secondly, it’s my printer. There is no longer a HP-supplied driver for my 2002-era DeskJet. Luckily Apple includes GutenPrint with Snow Leopard and there’s a bundled driver that recognises it. So on the plus-side I don’t have to go out and buy a new printer as I feared I might have to. On the down side the quality is just not there. While it was never a match for any contemporary photo printer, it was more than adequate for my needs. With GutenPrint, text is readable but there’s noticeable banding. I’m not sure I’d use it any more for “official” letters, though maybe I’m just being a snob. Photos have the same issue with banding but have the added distraction of some coarse dappling as a substitute for the more subtle colours.

No significant upgrade is going to be entirely problem-free but overall I’m happy with it. It’s about as easy as it could be and, despite Apple’s claim of no new features, there are certainly tangible benefits to making the leap.

Geeking out in Silicon Valley

As if wandering around a conference centre before the start of the conference wasn’t enough, I also went to the south of the Bay Area to visit some of the major sights in Silicon Valley.

I started at the excellent Computer History Museum. I don’t doubt that most people would find this mind-numbingly dull but I thought that the large archive of “significant” computers was great. It would be easy to argue over the machines that were on display, the ones that were more significant or, well, less American ((Some would argue that the first “modern” computer was built at Manchester University in the UK, but there are a number of good contenders.)).

Still, that’s nit-picking. It was great to see the PDP-8 — the successor to the PDP-7 that the original version of Unix was written for — and a couple of Cray-1’s. Purely for nostalgia value, it was great to see the Sinclair Spectrum (my first computer) and the ZX81 (the name of this website). I also remember wanting to get a QL because a friend had one and because it was cheap and powerful and had a great built-in programming language.

I’m guessing that many people reading this won’t have heard of the Xerox Alto. You can think of this as the first machine with what might be recognisable as a Graphical User Interface — or the point and click interface that we’re all used to now with the Macintosh and Windows. Talking of the Macintosh, the NeXT Cube is in many ways the precursor to the modern Mac. I remember getting some of the marketing bumph from NeXT when they were still being manufactured. I wasn’t completely sure why they were cool or what I would do with it if I had one, but I wanted one. The connection? Well, this was Steve Jobs company after he was booted from Apple in 1985 and the operating system forms the foundation of Mac OS X ((Actually, if you want to go further back, NeXTStep is a variant of Unix which we can trace back to the PDP-7 in 1969.)).

There were lots of other interesting (mainly bigger and older) machines but these are the main ones that stood out to me. They have a policy of only displaying machines that are ten or more year old in order to get some perspective and decide what is truly significant. It will be interesting to see where they go in the next few years. Most of the interesting stuff in the last few years has been either in software or in gadgets that are not traditionally considered to be computers (such as iPods and mobile phones).

Unfortunately, the major problem with the rest of the valley is that it’s just a bunch of office buildings. Even the ones where interesting work is going on are still just office buildings. So I went to the other side of Mountain View to have a quick look at Google and then a quick stint on the freeway to Cupertino ((It seemed right that I’d take the picture of the Infinite Loop sign using my iPhone.)) to have a word with the iPhone application review team (not really).

And from there it was back to San Francisco for some good food and some more traditional sight-seeing.