top of page
Writer's pictureThe Tech Platform

Objective C Programming Language


Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications.


Objective-C is the primary programming language you use when writing software for OS X and iOS. It’s a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime. Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods. It also adds language-level support for object graph management and object literals while providing dynamic typing and binding, deferring many responsibilities until runtime.


Objective-C fully supports object-oriented programming, including the four pillars of object-oriented development −

  • Encapsulation

  • Data hiding

  • Inheritance

  • Polymorphism

'

History:

Objective-C was created primarily by Brad Cox and Tom Love in the early 1980s at their company Productivity Products International (PPI). Love and Cox eventually formed PPI to commercialize their product, which coupled an Objective-C compiler with class libraries. In 1986, Cox published the main description of Objective-C in its original form in the book Object-Oriented Programming, An Evolutionary Approach. Although he was careful to point out that there is more to the problem of reusability than just what Objective-C provides, the language often found itself compared feature for feature with other languages.



Syntax:

A Objective-C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following Objective-C statement consists of six tokens −

NSLog(@"Hello, World! \n");

The individual tokens are −

NSLog
@
(
"Hello, World! \n"
);

Features:


1) Class and Objects Creation: Meta class creation is automated and easily managed during run time in Objective C language. Hence making the coding writing method easy for developers.


2) Dual Features of Dynamic and Static Typing: Objective C fully supports the dynamic typing features. Initially it is not easy to know about objects that is going to use at run time. Therefore with the help of dynamic typing, we can declare a variable that can hold a reference to an object.

But if you are sure about your objects that you are going to use at run time, then you can opt for static typing. This dual feature of Objective C makes this language popular among developers.


3) Simple to understand: Objective C another main feature is the Smalltalk style messaging that are making this language very simple. Those who have a less understanding about multiple inheritance and overloading can go for Objective C because it isn’t possible within the language.


Advantages:

  • Objective C is well tested language because it has existed from many years. There is a lot of code written in Objective C. It has many well-documented, third-party frameworks.

  • Objective C is compatible to C and C++ programming language. As Objective C is a superset of C thus, the code of C and C++ runs smoothly on this.

  • Objective C is stable. You don't need to spend money on migrating if you have developed your app on Objective C.

Disadvantages:

  • Objective C is hard to learn because its syntax is complicated. It is different from many other popular programming languages that's way Swift is preferred over it.

  • A lower number of developers are interested to learn Swift because it is hard to learn.

  • Objective C is not as secure as Swift. An app developed with Objective C is more prone to hack than Swift.


Source: Wikipedia


The Tech Platform

0 comments

Comentários


bottom of page