A little more time with Lion and Xcode 4

hsoi blog, talk 1 Comment

I know I’m late to the upgrade party.

I’ve been sitting on Snow Leopard (Mac OS X 10.6) and Xcode 3 for some time. It started because I know better than to change toolsets and environments in the middle of a project — stability is good. But it’s also the fact that Lion and Xcode 4 brought a lot of changes and problems to the table. I’ve been around long enough to know that I generally do not want to be the “early adopter” any more because there’s always going to be hiccups and problems out of the gate. If I need to be one well, I’ll try to at least wait for the inevitable x.0.1 bug-fix release. But if I can, I try to wait for releases like the x.2.2 or maybe x.3.1 releases because the general route tends to be:

  • x.0.0 – big changes, lots of bugs
  • x.0.1 – bug fix release issues shortly after, to fix some egregious problem, but people will still have lots of gripes and issues.
  • x.1.0 – tries to address some of the larger offending problems
  • x.1.1 – and then a bug fix for that
  • x.2.0 – finally attempting to make things truly usable
  • x.2.1 – and the bug fix for that…

and so on. I try to avoid that sort of development cycle if I can, but yeah, it’s how things can be. I have work to get done in a day, my own bugs to write — don’t have time to waste on someone else’s bugs. 😉

Even once I could upgrade to Lion and Xcode 4, I stayed away because of too many reported problems. Even as I write this, the current Mac OS X version is 10.7.2 and Xcode is 4.2.1… only JUST starting to edge into my realm of “OK, I’ll upgrade”, but even then I know a lot of people are still having gripes and problems. Heck, I’m holding off on iOS 5 upgrading on my personal iPhone because of the persisting battery drain issues — I rely upon that device and battery drain isn’t something I’m willing to risk right now. *sigh*

But that all said, some recent issues in other-job land have forced me to use Lion and Xcode 4 on a daily basis now.

I’m conflicted.

On the whole, the main source of my cognitive dissonance is the simple fact the two bring radical changes to the table. I know a lot of people balk at the changes, especially since it’s obvious a lot of the changes are coming because of iOS and trying to make Mac OS X more like iOS. Well, to a degree that does bug me, but I also think it’s a wise and smart move. Let’s not forget that old “halo” effect being in play here.

Scrolling

For instance, scrolling is probably the most contentious issue. Yes, it’s quite frustrating to use trackpad gestures to scroll around and have it be backwards from what I’ve done for how many years of using computers? It’s annoying that something so fundamental, that we just “do” without thinking and take for granted every day is now broken. But it’s not. Frankly, I do think it makes more sense that the gesture should work this way — it is more natural, it is more semantically correct in terms of gestures being a direct manipulation of what you’re working on and looking at. In using Lion for the past few weeks, I’m getting used to it tho it’s still something I have to remind myself to work with. It’s getting there tho because when I switch to other machines still running Snow Leopard, I now find myself getting mixed up and actually starting to find the old behavior bothersome and not correct. It’s that ability to use both approaches side by side and seeing how I feel and react to them that’s telling to me, and that is making me actually prefer how Lion does it.. even tho retraining myself is annoying.

But scrolling also I think fails on Lion because of how they now do scrollbars… which is just like iOS. Prior to Lion, scrollbars generally were always visible. I say generally because, I forget when this came about, but long ago it was that scrollbars were always visible, their state reflecting if you could scroll or not. Then there was a slight change made so that if there was no content to scroll, the scrollbars could hide themselves. This all worked well: if there was content to scroll, you saw some indication of it; if no indication, no need to scroll. But now? It’s non-obvious. I understand the always disappearing scrollbars on iOS because the scrollbar is superimposed over content because screen space is at a premium. But screen space is not such a premium on Mac OS X; it’s always wise to not waste space, but now we’ve lost an important feedback point.

Case in point:

This is the “Behaviors” dialog panel from Xcode 4.2.

I was trying to resolve an Xcode 4.2 issue (which I’ll discuss later) and one of the given solutions was that you could use Behaviors to run a script. So I opened this dialog and kept looking at it over and over and over… looking at everything that I saw before me. I saw NOTHING that enabled the ability to run a script. Was I missing something? Maybe this was in an Xcode 4.3 beta that I hadn’t yet seen? Or maybe it was in a prior version of Xcode 4 and they removed it in 4.2? It was driving me bonkers.

I can’t recall how I found it… but it was pure accident. I eventually realized that content area on the right could scroll. And lo, there it was… scrolled just out of view, the “Run Script” option.

I had no idea the content could scroll. There was nothing that told me the content could scroll. Oh sure, now I see the moment you invoke the dialog panel there a scrollbar that flashes for a second then disappears. That’s not an indicator.

If you look at the left side, you might get the impression you can scroll because the bottom edge of the last row is cut off. But look at the right content: there’s no irregularity. We should not count on such things to provide feedback about scrollability. But yet, that’s how iOS works. Perhaps I’m an old fart minority here and the young iOS-based kids just figure anything and everything can scroll so they just try to scroll everything… tho I don’t think that’s very efficient either. I just recall from years of trying to follow Apple’s Human Interface Guidelines, of trying to understand good human-computer interaction, that hiding information has its place, and this not one of those places.

Xcode 4

I will say that I’m generally liking Xcode 4. Really! The most telling aspect is when I have to switch back to Xcode 3 I find myself missing a lot of things, as well as appreciating what Xcode 4 is doing much better. The code indexing and browing is great, which includes improvements on code completion. I think the new workspace layout may actually get me using Snippets more: a feature that was always there but buried and gee if I had just used it more over the years I’d be so much happier. I really love the “jump bars” because they provide so much more information and access now. I’m still getting used to all the keyboard shortcut changes and adjusting to the workflow, but so far I’m really happy with Xcode 4.

But with happiness comes problems, of course.

I don’t like the iTunes-like interface. I can live with it, but what really bugs me is the toolbar is big. I like having every pixel I can for my source editing. But while I can adjust the toolbar slightly to say just show “icon” not “icon and text”, it doesn’t matter… the big iTunes indicator remains the same size and so the toolbar height remains the same. :-\

I didn’t like my documentation experience. I went to look up an API in the built-in docs. It looked it up, great. When I clicked on the entry in the search results it took me to…. a login page. Huh? Why do I need to log into ADC to access the docs? Maybe all docs are online now to minimize downloads and ensure everyone has the most recent copy, which would be OK (tho I hope I never have to access docs in a non-network situation, like on a plane). But I couldn’t do it… it required me to log in using a form on the web page, but then I couldn’t do it because it said the index.html file was locked! Plus I couldn’t unlock it because it claimed it was a network resource. *sigh*  FAIL. Google didn’t turn up many solutions other than “try installing the docs again”. But when I tried that, even that was odd. In the Downloads >> Documentation area it didn’t list the iOS 5, Xcode 4.2, and Mac 10.7 docs as “installed” nor was there a button to “install” them nor could I select them and press the “-” button to delete them!! But there was entries for the 10.6 and Legacy docs, selecting one and clicking “-” let me delete it but that also deleted the other one too! Now I saw no way to get at things. I disclosed information on the iOS 5 docs and saw the “feed” URL in there. I clicked the “+” button, pasted in the iOS 5 doc feed URL. Then after a few seconds, I was prompted with 3 auth dialogs, one for installing each of the other 3 doc sets. Huh?? I only asked to install one them. But all 3 started downloading. And it now appears I have all 3 installed… but they still don’t say “installed” on the window. I don’t get it….

Of course, the breakage with IBPlugins is a problem. I can somewhat understand that old plugins can’t work, but that there’s no existing new mechanism so people can swap and upgrade is utterly problematic. Good toolkits like RBSplitView and BWToolkit have to languish due to the lack of user-customization support that we’ve long come to appreciate.

And finally, my biggest peeve.

User Scripts are missing.

I can’t see why they removed this feature.

Well, maybe they wanted to replace it with something better. I will admit, that we can have Behaviors is kinda nice. You can do a bunch of things in addition to running a script. And that you can assign a keyboard shortcut to it? OK, that’s good. So, in general I can live with this.

However, it’s not quite there.

The problem is, I can execute a script, just not a script that interacts with Xcode.

Some scripts I use every day are scripts that help me annotate comments in source code. So for instance, I hit cmd-F12 and it inserts: “// Hsoi 02-DEC-2011 – ” so I can have a comment that says who made the comment and when. It’s a small thing, but when you have to do such a thing many times in a day, that’s a lot of keystrokes and “uh, what day is it again?” saved. With User Scripts, this was simple to insert this text.

But now? I’m struggling to come up with the way to do it.

User Scripts are out.

So given the new scripting mechanism, that turns me to AppleScript. Well, while Xcode 4 supposedly supports AppleScript, by all signs it’s broken. With some hacking I can obtain the window that holds my text and obtain the selection, but trying to set the content of the selection to my text is not working no matter what I try. I can’t figure out how to get it working. Google turns up mountains of frustrations and general failures in getting Xcode 4’s AppleScript to work.

Some other suggestions said to try Automator actions, that it will be slow, but functional. I tried. And yes, I can get that to work. It’s reasonable since I can get it to interface with Xcode, use a “Run AppleScript” action to do all my date and string calculation logic, and then get the text inserted. I still have some parts of the logic to figure out (e.g. I change the common delimiter based upon what type of file it is, e.g. .c/.cpp/.m gets a // but a .py gets a #), but OK this is perhaps something.

But the problem there is you have to run the Automator workflow as a Service. That’s perhaps OK, but the Services menu only works on active selections. So to even get the Service recognized and enabled, I’m going to have to type some text, select it, THEN apply the Service to insert my text. Whereas before I just type along, hit cmd-F12, and away I go… no song and dance.

So I thought, maybe I could try this Automator workflow as an Xcode script Behavior? no dice. It actually recognizes that fact and says that it doesn’t support Automator workflows.

*sigh*

Yes… once I get to the end of fighting and figuring all this out, I will be submitting bugs to Apple.

A bunch of good, and while the bad isn’t horrible, it’s bad in just the right places and ways that it hampers my daily activity enough to really add up to being a problem. I’m happy to move forward and am actually happy that Xcode 4.2 is out for Snow Leopard so I can upgrade some other machines and move along with 4.2. But I do hope things will improve.

Comments 1

  1. Pingback: The pain subsides, but localizes « Stuff From Hsoi

Leave a Reply