Philosophical Differences Between Objective-C and C++

Learning about Objective-C has been quite interesting, especially the histories of Objective-C and C++. They were two different schools of thought that extended C to accommodate object-oriented programming. As we can see today, C++ has been more popular and we have already seen several permutations of them. In a way, my own history of programming has followed that particular school, although I did not know that an alternative school existed. I learned C, then C++, then Java, and lastly ActionScript.

The main difference between the two schools is in typing: static vs. dynamic. It gets rather philosophical and I find it fascinating in that sense. Static typing (C++) assumes that the world can be categorized (abstracted) perfectly. In other words, categorization is assumed to be inherent in nature. If it fails, it means you made a mistake in understanding the underlying structure of the universe. (This is analogous to Structuralism in the modern philosophy, like Noam Chomsky.)

Dynamic typing assumes that categorization is never perfect because it is an order that we humans impose on nature. As such, the flaws are unavoidable. By leaving the typing dynamic (by leaving the definitions of objects as dynamic as possible until run time), Objective-C is able to accommodate situations that do not fit neatly into predefined categories. These situations do come up often in real life situations.

Dynamic typing, in this sense, is analogous to post-structuralism. Its fundamental assumptions are similar to the philosophies of Derrida and Wittgenstein. I'm a big fan of both philosophers, so I find Objective-C to be fascinating.

However, most development projects are not academic exercises. So, we do need to take into consideration the parameters and the realities that the business imposes. In this sense, I do find Objective-C to be quite lacking.

As I said above, C++ has already evolved several times and it has been improved quite a bit. C++ had many provisions to make it backward compatible with C, but Java (and I would assume C# also) has moved beyond it for the sake of clarity. Since OOP has become a predominant method of programming, there was no need to be concerned about backward compatibility.

Personally, I find ActionScript to be the best. In fact, it incorporated some of the strengths of dynamic typing. I think it strikes a good balance between the two.

Objective-C, on the other hand, has been hacked around since the late 80s. To me, it should be laid to rest and should be re-designed from scratch. For instance, the lack of name space has been addressed by prefixes like "NS". I was like, "What the hell is "NS"? It turned out to be a short for "NextStep". Oy. I'm not sure why they don't just ditch the backward compatibility and implement name space.

The obvious superiority of the dot-syntax has been forced into Objective-C in a half-assed manner as "properties".

I also find the use of header files to be annoying; something most other OOP languages have done away with.

I kind of suspect that Apple realizes how obscure their programming environment is for most people. And, I get a sense that their implementations of the custom CSS and HTML tags for iPhone is in response to this problem. If other mobile devices support the languages and the programming paradigms that are more familiar to the mainstream developers, Apple could lose them to the competitions. In the mobile market, the market share that these companies are concerned about is the market of developers, not so much that of the consumers. It's very much like the game consoles. It's the games that determines the popularity of the consoles, not the other way around.

Contact Us

Interested in working with us? Please fill out the form below. We’ll get right back to you.