Difference between C and Objective C

Key difference: C is a type of computer programming language. C was originally developed by Dennis Ritchie at AT&T Bell Labs between 1969 and 1973. It has a free-format program source code. Objective-C is a general-purpose, high-level, object-oriented programming language. It adds Smalltalk-style messaging to the C programming language. As it is a superset of C, everything that is valid C is also valid in Objective-C.

C is a type of computer programming language. C was originally developed by Dennis Ritchie at AT&T Bell Labs between 1969 and 1973. It has a free-format program source code. C is a general-purpose programming language that uses semicolon (;) as a statement terminator, as well as curly braces ({}) for grouping blocks of statements.  It has facilities for structured programming and its design provides constructs that can map efficiently to typical machine instructions.  It also allows lexical variable scope and recursion and has a static type system, which prevents many unintended operations.

C is one of the oldest currently used programming languages and is one of the most widely used programming languages. It has been constantly used in applications that had previously coded in assembly language. This includes the UNIX computer operating system.

C has directly or indirectly influenced a lot of the later programming languages, such as C#, D, Go, Java, JavaScript, Limbo, LPC, Perl, PHP, Python, and Unix's C shell. Despite all these new languages, C still remains a popular programming language.

Objective C is basically a subset of C. It was originally developed in the early 1980s by Brad Cox and Tom Love at their company Stepstone. Objective C was then selected as the main language used by NeXT for its NeXTSTEP operating system. Mac’ OS X and iOS are derived from the NeXTSTEP operating system and hence use Objective C as their main language.

Objective-C is a general-purpose, high-level, object-oriented programming language. It adds Smalltalk-style messaging to the C programming language. As it is a superset of C, everything that is valid C is also valid in Objective-C. Mainly, Objective-C adds a thin object-oriented layer on top of C. It adds syntax and semantics that allow for object oriented programming, whereas C is strictly procedural programming. Object oriented programming differs from procedural programming by focusing on grouping data and methods of manipulating this data in classes.

Some differences between C and Objective C:

  • Objective C keeps all aspects of C
  • Objective C adds syntax and semantics that allows for object oriented programming.
  • Objective C is object oriented programming whereas, C is procedural programming.
  • Objective C incorporates classes, whereas as C doesn’t.
  • Objective C allows for division of problems subproblems and submodules that can be developed and tested individually.
  • Objective C allows for delegating methods to other objects and remote invocation, which can be easily implemented using categories and message forwarding.
  • Objective C allows for swizzling of the isa pointer that allows for classes to change at runtime.
  • Objective C, like Java, does not support multiple inheritance
  • Objective C allows the user to define a protocol by declaring an Objective C class.
  • Objective C does allow instance variables (data members) to be set as public, private, or protected.

Image Courtesy: gointerviews.com, alwawee.com

Most Searched in Sports Most Searched in Games and Recreation
Most Searched Non-Alcoholic Drinks Most Searched in Home and Garden
Empirical vs Molecular Formula
Actor vs Actress
Hyundai i20 vs Maruti Suzuki Swift
Younger vs Elder

Add new comment

Plain text

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.