Function calling vs messaging

[obj performWith:param1]; //messaging(obj-C)

obj->perform(param1); //function calling(C++)

Objective C uses messaging that is runtime decides which code to be executed. At function calling, compiler decided which code to be called. With polymorphism, a form of runtime lookup called virtual table was introduced to function calling. However at messaging, it is always at runtime.

Most of the work is done at runtime in objective C. So whenever runtime is updated, your application benefits from that, you do not need to recompile.

Leave a comment