Let’s take a moment to appreciate the beauty of Objective-C

Let’s take a moment to appreciate the beauty of Objective-C

February 12, 2021

Software is constantly changing. It’s uncommon for programming tools to stay the same without being replaced by something better, and that’s good. Who would want to write software using old methods like manually managing memory or working with raw blocks of memory for text?

In the ever-changing programming landscape, a framework occasionally captures your attention and becomes indispensable. For me, this first occurred with Ruby (not unexpectedly) and then unexpectedly with Objective-C, a language that I’m sure many of you have also formed a personal connection with.

The Journey

The discovery of Ruby felt like unraveling a series of nested presents. Running1.nextin an IRB console still makes me smile at the realization that everything is an object in Ruby. While some may prefer the Poignant Guide to the Pickaxe, my introduction to Rails exposed me to convention over configuration, the active record pattern, the model-view-controller pattern, and test-driven development all at once.

However, with the launch of the iPhone, the demand forappdevelopment surged, leading many, including myself, to delve into Objective-C. Yet, the language posed challenges, with its extensive use of square brackets, unique class naming conventions, and the absence of a garbage collector.

Upon closer examination, I discovered striking similarities between Ruby and Objective-C. Both languages have foundational classes (Object in Ruby and NSObject in Objective-C), support for passing methods around (Proc in Ruby and blocks in Objective-C), and mechanisms for dynamic message passing and metaprogramming.

Architecturally, the two languages share enough common ground that multiple attempts have been made to bridge them together. The earliest such attempt I found dates back to 2001 as part of the GNUstep project, an open-source implementation of Apple’s Objective-C and Cocoa frameworks.

Despite the evolution of both Ruby and Objective-C, I was surprised to find that a project’s code written in 2001 can still run on modern macOS systems with some adjustments to accommodate modern versions of Ruby and Objective-C. This longevity is a testament to the robustness of the Objective-C runtime and the Ruby C extension API.

No Need For A Rockin’ Chair

It’s worth noting that Objective-C currently holds the 25th position on the TIOBE index, sharing the spot with COBOL at 26th place in 2023. Despite Apple’s shift of focus to Swift in 2014, over 66% of their native binaries in iOS 16 are still written in Objective-C. This indicates the language’s enduring maturity and firm support, allowing it to persist in the background.

Leave A Comment

Codebringers Software

Hello! We are a dedicated team of skilled developers, designers, QA engineers, and market strategists. 

Hello! We are a dedicated team of skilled developers, designers, QA engineers, and market strategists.

With a wealth of experience across various platforms, systems, and devices, we specialize in creating mobile solutions that are both compatible and accessible.

Our expertise spans a range of services, each tailored to meet the unique needs of our clients.