The Subjective Charms of Objective-C

1 week ago 72

Objective-C’s objects, meanwhile, were adorned with all caps prefixes that proudly identified their creator. Some bore household names, like the button to log into another service with yourTwitter account (TWTRLogInButton), or the add friends from Facebook popup (FBFriendPickerViewController). By the time I learned Objective-C, NeXT hadn’t existed for over 15 years, but code from their NeXTSTEP operating system was so ingrained in Apple’s products that its prefix appeared in dozens of objects and functions I used everyday—NSDictionary, NSArray, NSString, NSLog.

Objective-C is wordy—arguably excessively so—and this proclivity soon crept into my own outlook. How could an engineer tell a computer exactly what to do without using lots of words? How could a language be universally expressive without being maximally specific? Objective-C’s loquaciousness was not outdated—it was an ethos worth striving for, no matter how much it hurt my wrists.

The Aging Giant

The first and only software engineering job I had (before eventually leaving to the squishier world of technology policy) was developing iPhone apps for an Aging Giant of Silicon Valley. The company had been white-hot shortly after the dial-up internet era, but missed several tech booms since then, and in 2013, was determined not to miss the latest craze: mobile apps.

The app I worked on was only a few years old, but already, its codebase told the company’s whole history with unflinching honesty in rambling lines of Objective-C prose. Distinct prefixes gave away which code had been inherited from acquired startups, and revealed a bitter conflict over switching analytics platforms. Ornate function names told of product pivots and the defunct popup screens they left behind.

But the longer I spent writing Objective-C, the more I felt it hid rather than revealed. Long, sentence-like function names buried the most pertinent information under a fog of dependent clauses. Small features required long-winded pull requests, making it easy for engineers to get distracted during reviews and miss bugs. Objective-C’s excess words, multiplied across thousands of files and millions of lines of code, made for an exhausting codebase.

Soon enough, my affection for Objective-C’s “more is more” theory of self-expression disappeared completely. As the codebase expanded, its web of objects grew into a tangled thicket of convoluted ...

Read Entire Article