• Where did common courtesy go?

    While I was running today, I noticed a pair of glasses in the middle of the street. I picked them up as I noticed some people had just walked by and thought that they had dropped them. When I approached the two (a nurse taking her patient for a walk), the nurse said that the glasses weren't hers and they had seen them in the street.

    OK, that's fine, but leaving the glasses in the street to get crushed? I saw that there was a box for underground telephone lines, so I set the glasses on the box hoping that someone will come back and find them. At least by putting them there, the owner has half a chance of recovering non-broken glasses. Why the nurse didn't pick up the glasses and do the same thing I did, I have no idea.

  • Sacrificing Readability for Cleverness

    I was looking at some code in the Three20 library when I came across this:

    BOOL TTIsKeyboardVisible() {
      // Operates on the assumption that the keyboard is visible if and only if there is a first
      // responder; i.e. a control responding to key events
      UIWindow* window = [UIApplication sharedApplication].keyWindow;
      return !![window findFirstResponder];
    }
    

    The last line had me scratching my head as it has a double negation. While this looks like a mistake, it isn't; this is a developer being clever. Let's break down the line:

    [window findFirstResponder]
    

    This returns a nil value or a non-nil value. If we then negate it the result is YES if the firstResponder is nil and NO if the firstResponder is non-nil. If we negate it again, the rest is NO if the firstResponder is nil and YES if the firstResponder is non-nil. So, the bottom line is:

    return [window findFirstResponder] != nil;
    

    Why did the developer use the hard to read !![window findFirstResponder] when [window findFirstResponder] != nil is much more readable?

    (We'll ignore the fact that initial assumption is not always valid; I believe there are cases where the firstResponder isn't a text field. Using keyboard notifications is the way to tell if a keyboard is visible.)

    Writing clever code like this drives me insane as there is no reason to take shortcuts; a few extra characters isn't the end of the world and the next person that reads the code has to closely examine the syntax to ensure that the !! isn't an error.

  • Mac user working in a Windows company

    Back when I worked at a large company (before my current job), there wasn't a huge issue using a Mac except for some tasks like version control as this was a time before the browser wars. Now over 10 years later, I sometimes feel like an outsider using my Mac.

    For the most part, I'm isolated from a lot of the infrastructure as I'm remote and am pretty self sufficient. I do, however, use Microsoft Outlook on the Mac as it works nicely with our Exchange server and the Mac's built in support, despite what Apple says, is pretty poor. For instance, if I change my password, I only have to change it once in Outlook; with Mail, iCal and Address Book, I have to change it a total of 3 times. Also, scheduling is much easier with Outlook as I can look up people's availability quickly.

    Many things make it hard to work in this environment and frustrate me. It starts with the ancient logins that prefix my user name with a domain (you'd think that someone could fix the system such that the domain isn't used since everyone in the company uses the same domain), to the sites that say "For best results use IE", to the sites that don't even work in Safari. Also with the single sign on that many companies employ today, you'd think you could login once and be authenticated across the board until being signed out; unfortunately I think single sign on means that you have the same username across the board, but still have to enter it a dozen times. Internet Explorer may handle single sign on better.

    Today my frustration was trying to watch a webcast; I clicked the link that said "Mac users click here", but it failed to work and running Windows under Fusion didn't help either. Looking back, the issue may have been connecting via the VPN, but I had watched a webcast in the past. If we were using the HTTP streaming standard, this would not have been an issue due to HTTP working well over a VPN, but someone chose a "standard" that is very Windows centric and only has limited Mac support.

    I'm not advocating that the company switch to all Macs or even Mac servers (I wouldn't wish a Mac server on anyone), but making systems work across not just platforms, but browsers would give people a choice. There are basically 3 choices of browsers on each platform, Safari or Internet Explorer, Chrome, and Firefox. Why not give employees a choice and make it easy to use any one of these? Yeah, yeah I know the answer; supporting one browser is the easiest for IT support as most users aren't as technically savvy as I.

    Luckily, I only have to deal with these Windows centric systems every once in awhile. Every time I do have to use the systems, I'm reminded how far we've come with technology in some ways, but how stuck in the past we are in other ways. I guess I should be happy I don't work for the federal government where I suspect that they still use DOS in various agencies.

  • The art of user interface

    Years ago I thought I had the ability to design a decent user interface. Back then, the concepts were quite easy as the screen sizes were limited (Palm OS) and we were dealing with essentially black and white. As long as I followed the UI guidelines, the interface looked good. These days, I don't think I could design a user interface to save myself. The flexibility of iOS, high resolution screens, full color displays and multi-touch add so much complexity to user interface design that it takes a professional, in my opinion, to design good user interfaces.

    I'm quite lucky that I work with designers and artists do the design work which lets me concentrate on what I do best, writing code and solving problems. The lack of my own design ability makes it quite hard for me to come up with my own titles to publish. If I came up with a good idea, I'd need to find a good designer willing to take payment in the form of a split of revenues; good design isn't cheap!

    Developers need to keep this in mind when releasing applications; a good idea even well implemented is only half of what makes a good app. The other day I looked at an app that had the beginnings of a decent app, but the UI had a lot to be desired, so it quickly got removed from my device.