My Setup

I'm a fan of The Setup, a website containing interviews with people about the tools they use to do their jobs. It is just "productivity porn", but I find it interesting.

As a tribute, here is my own "interview" for The Setup, using the standard four questions. I don't expect anyone to find this interesting, but writing it up helps me think about what I'm using and why, and it will come in handy the next time I have to set up a new computer.

20 Years Ago

It was 20 years ago this month that I graduated from college and got my first professional programming job. It has me reminiscing about what the computer programming profession was like before the Internet.

Want to Develop iOS Apps? Learn Objective-C.

As an iOS software developer, I am often asked whether "we" (a team I'm working with, or someone I'm advising) should avoid using Objective-C and instead use a higher-level or easier-to-learn programming language. In general, my answer is "No". The rest of this post explains why.

Sorting Entries in a PList by Key

My iOS applications use property list (plist) files to specify configuration parameters and other stuff. I was trying to do some comparison and merging of these plists, but was tripped up because the keys were in different order in different files.

So I whipped up a little Python script to sort the keys in the plists and write them in a canonical format. If you would be interested in such a thing, it's as easy as this:

Cold Science Fiction

I read a lot of science fiction (SF) in my adolescent and teenage years, but I got bored with it in college, and stopped reading it. Actually, I didn't get bored, I got annoyed with it. At the time, I couldn't describe exactly what it was that was annoying me, but I felt that each SF novel I read was following a formula that had stopped entertaining me, and that SF had become a waste of my time.

In the past few years, I've started reading SF again. I've read new stories by new authors, and tried to catch up on some of the SF classics I should have read back in the 80's. A friend loaned me his copy of Robert Heinlein's The Moon is a Harsh Mistress. I looked forward to reading it, as I had heard it was one of the best SF novels ever written.

I hated it. This novel reminded me of everything that made me stop reading science fiction.

Lots of smart people do enjoy this book, so I spent some time thinking about what they see in it, and what it is that I find so repulsive.

KJSimpleBinding

Mac OS X provides a pretty nice data-binding technology for developers, called Cocoa bindings. Unfortunately, the Cocoa bindings mechanism is not available to iOS developers, so iOS developers have to spend a lot of time writing code to keep user-interface elements and data in sync.

However, while Cocoa Bindings is not available on iOS, the underlying key-value coding (KVC) and key-value observing (KVO) mechanisms are, so it is straightforward to implement your own poor man's data-binding mechanism and eliminate some of the drudgery.

I have done just that. My KJSimpleBinding library is available on GitHub. I hope it is useful to someone, and I hope I have time to make it less simple.

I'm not the only one to try this. Here are a few similar projects I found on GitHub:

KJGridLayout

Xcode's Interface Builder is a pretty good user-interface layout tool, especially for simple situations. However, it is not the best tool for every job. Sometimes you have to write code to dynamically create user interface elements or to move them around as the view is resized.

When you do this, you find that iOS doesn't help you much beyond some rudimentary autoresizing options. While iOS 5 does provide some autolayout features, they are limited, and they don't help at all if you need to support earlier versions of iOS.

I had a need to do a grid-based layout in an iOS app. I hoped to find a grid-layout component like one would find in Android or WPF, but there is no such thing built into iOS.

I also couldn't find any third-party implementations. I found a few posts and samples for making a grid-like UITableView, but I wanted a way to lay out things in a grid in a plain-old UIView.

So I decided to write my own grid-layout thingees for iOS.

The results are the KJGridLayout class and the KJGridLayoutView class, which you can find on GitHub. Check out the README and feel free to use them yourself. I hope someone finds this stuff useful.

MacBooks and Caps Lock and Control

I learned to touch-type over 30 years ago, on an IBM Selectric typewriter. I'm a fast and accurate typist, compared to most programmers. I've always considered typing to be a basic skill that all programmers should take seriously. What goes on in your head is more important than how fast you can type, but the more efficient you are in getting your thoughts into the computer, the better you are going to be at your job.

I've been dismayed at one "feature" of my MacBook: to prevent accidental triggering of the Caps Lock key by incompetent typists, Apple makes it necessary to hold down the Caps Lock key for an extra fraction of a second. If you just tap it quickly, it does nothing. See http://support.apple.com/kb/HT1192 for Apple's explanation. They have also baked this behavior into some of their keyboards: see http://support.apple.com/kb/TS1578.

While I'm sure that many people welcome this feature, I do not. I type quickly and confidently, and my fingers hit the Caps Lock key at the appropriate times without me consciously thinking about it. I hit and release it so quickly that my MacBook ignores it. So when I type "UNIX is awesome!", "Party in the USA!" or "New York, NY", I see "unix is awesome!", "Party in the usa!" or "New York, ny" on the screen.

There is no easy way to disable this feature. When I complain, most people respond "Big deal. We hardly ever use Caps Lock." Well, I do. I've been using it for 30 years, and it has always worked fine. Until Apple decided It Should Just Not Work.

So, I looked into what I could do.

My Python Cheatsheet

Here's another programming-language cheatsheet. It's been a couple of years since I've done any Python programming, and now I'm taking the online CS373: Programming a Robotic Car course, which uses Python for quizzes and homework assignments, so I have to get back up to speed.

As always, this is the information I've found useful in reacquainting myself with a programming language. It may not help you at all.

My Android Development Cheatsheet

If I had my druthers, I'd spend all my time developing mobile apps. I've always been fascinated with pocket-sized computers, and have owned many through the years. Unfortunately, for most of my life such devices have been little more than toys, and so I've had to focus my expertise on writing code for "real computers".

This is true even now, during the explosion of smartphone and tablet usage. I'm one of those dinosaurs who knows how to use C, C++, MFC, ATL, CORBA, UNIX, and other ancient magic, so there are sometimes a few months of old-school development between mobile-development gigs. I write iOS stuff for fun, so I keep those skills sharp, but Android is something I touch only when I'm being paid to do so. Thus, I have to find a way to quickly get back up to speed when the Android work does come.

This is my little refresher for when I arrive back in Android-land. It may not help you at all.

Syndicate content