Thoughts on Swift and Objective-C

submited by
Style Pass
2022-07-04 22:30:06

I want to start by saying that I speak only for myself. I don't speak for other Objective-C programmers, nor do they speak for me. We are not of one mind. The same is true of Swift programmers: some of them seem quite reasonable to me, and others seem rather… fanatical. Regardless, it's almost impossible to have a productive discussion about programming languages on social media, given the constraints of brevity, and also given the freedom of fanatics to barge in on the discussion at any time, effectively ruining it. This is why I'm taking the time to expound here, free of those constraints. My aim is not to persuade anyone to choose a particular programming language, just to explain my point of view in reasonable terms, without the caricatures and insults regurgitated on social media.

It may seem to some people that I'm fanatical about Objective-C, but I actually don't like any programming language. (Maybe Pascal? IIRC it was pretty nice, though my memory of it is very hazy. Could be nostalgia.) I find it odd when people say they love a programming language. In contrast, I take a utilitarian approach to programming, not an emotional one. My joy comes from shipping a product that users enjoy (and from making a living doing it!), not from writing code per se. Maybe that's because programming was not my first choice of career. Or my second choice, or third choice. That's a story for another day. (Never.) Anyway, I fully recognize that Objective-C has flaws — all languages do — and before Swift was introduced in 2014, I had always wanted something somewhat different, like the "Objective-C without the C" that Hair Force One falsely claimed was embodied by Swift. In retrospect, I've come to recognize that "with the C" is not bug but a feature. Nonetheless, I don't consider Objective-C to be an ideal language. It mixes idealism with pragmatism, inherently a compromise position. I've used many programming languages over my life, as appropriate in the context, and nowadays as a web browser extension developer I tend to write more JavaScript than native code. (By the way, JavaScript is the absolute worst IMO LOL.) I'm certainly not committed to Objective-C forever. It wasn't my first language or my last.

Leave a Comment