On Dynamism

Paul Kim:

One thing many people seem to overlook about the dynamism of Objective-C is that it enabled NeXT (and Apple) to provide better GUI tools. Using dynamism, they were able to make GUI building declarative in nature. Connect this to that. Call this method. All stored in a file that was (and still is) data, not code. Competitors at the time (and today) resorted to code generation which is fragile and, ironically, unsafe. Yes, you could have a more declarative file format, but implementing that in using a static language required a lot of hard-coding and switch statements. Not the elegance that many people claim to be moving towards.

I’m not saying that a language has to be purely dynamic but it shouldn’t be purely static either. It think it’s spurious not to credit a level of dynamism for the quality of apps on Apple platforms over the years, and to be pedantic, the NeXT ones as well — many of which were considered the best on any platform at the time. To deny that, I feel, shows a lack of understanding of what has made the platform great all these years.

Objective-C is a very dynamic language. Swift (for now at least) is not. There are arguments on both sides, and I find the whole thing fascinating. But what I’ve noticed is that those arguing most strenuously against dynamism (or if you prefer, in favor of Swift’s relatively strict type safety) are doing so in the name of idealism. That rigorous type safety is correct almost in a moral sense (or, if you prefer, that the sort of bugs you can write with Objective-C’s dynamic features are immoral, that a modern language should prevent you from writing them in the first place).

Those arguing in favor of dynamism — and keep in mind Kim’s utterly even-handed stance quoted above — are doing so from an utterly practical perspective. We have 25 years of evidence that Objective-C and the NeXTStep/Cocoa/Cocoa Touch frameworks allow for the creation of the best apps in the world — and that they allow smaller teams to accomplish more, faster. (Exhibit A: Tim Berners-Lee invented the World Wide Web singlehandedly on a NeXT system in 1991.)

I can’t prove that dynamic nature of Objective-C and the frameworks has been essential to the success of the Mac and iOS for app development. But a lot of people who’ve spent years — or decades — creating those apps sure think so. I tend to side with pragmatism over idealism.

Tuesday, 24 May 2016