Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard language used, supported, and promoted by Apple for developing OS X and iOS applications (via their respective application programming interfaces (APIs), Cocoa and Cocoa Touch) between 1997, when Apple purchased NeXT, and 2014 when Apple introduced the Swift programming language. Objective-C programs developed for non-Apple operating systems or that are not dependent on Apple's APIs may also be compiled for any platform supported by GNU, GNU Compiler Collection (GCC) or LLVM/Clang. Objective-C source code "messaging/implementation" program files usually have .m filename extensions, while Objective-C "header/interface" files have .h extensions, the same as C header files. Objective-C++ files are denoted with a .mm filename extension.
History Objective-C was created mainly by Brad Cox and Tom Love in the early 1980s at their company Productivity Products International (PPI). Leading up to the creation of their company, both had been introduced to Smalltalk while at ITT Corporation's Programming Technology Center in 1981. The earliest work on Objective-C traces back to around then. Cox was intrigued by problems of true reusability in software design and programming. He realized that a language like Smalltalk would be invaluable in building development environments for system developers at ITT. However, he and Tom Love also recognized that backward compatibility with C was critically important in ITT's telecom engineering milieu. Cox began writing a pre-processor for C to add some of the abilities of Smalltalk. He soon had a working implementation of an object-oriented extension to the C language, which he named Object-Oriented Pre-Compiler (OOPC). Love was hired by Schlumberger Research in 1982 and had the opportunity to acquire the first commercial copy of Smalltalk-80, which further influenced the development of Objective-C. To demonstrate that real progress could be made, Cox showed that making interchangeable software components really needed only a few practical changes to existing tools. Specifically, they needed to support objects in a flexible manner, come supplied with a usable set of libraries, and allow for the code (and any resources needed by the code) to be bundled into one cross-platform format. Love and Cox eventually formed PPI to commercialize their product. To avoid legal disputes with his previous employers, Cox reimplemented his compiler for the language, which was renamed "Objective-C". The company's main product line consisted of this compiler, along with class libraries intended to be used with it. 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 explain that there is more to the problem of reusability than just what Objective-C provides, the language was often compared feature for feature with other languages.
Popularization through NeXT In 1988, NeXT licensed Objective-C from Stepstone (formerly PPI, the owner of the Objective-C trademark) and extended the GCC compiler to support Objective-C. NeXT developed the Application Kit and Foundation Kit libraries on which the user interface and Interface Builder were based. While the NeXT workstations failed to make a great impact in the marketplace, the tools were widely lauded in the industry. NeXT dropped hardware production and focused on software tools, selling NeXTSTEP and later OpenStep as platforms for application development. To circumvent the terms of the GPL, NeXT had originally intended to ship the Objective-C frontend separately, allowing the user to link it with GCC to produce the compiler executable. Richard M. Stallman initially considered the arrangement permissible, but changed his assessment after consulting GNU's lawyers. NeXT then agreed to make its Objective-C frontend part of GCC. The work to extend the GNU Compiler Collection (GCC) was led by Steve Naroff, who joined NeXT after working on Objective-C at Stepstone. The compiler changes were made available as per GNU General Public License (GPL) terms, but the runtime libraries were not, rendering the open source contribution unusable to the general public. This led to other parties developing such runtime libraries under open source licenses. Later, Naroff was also a principal contributor to the Objective-C frontend for Clang at Apple. The GNU project started work on its free software implementation of Cocoa, named GNUstep, based on the OpenStep specification. Dennis Glatting wrote the first GNU Objective-C runtime in 1992. The GNU Objective-C runtime introduced in 1993 was developed by Kresten Krab Thorup while he was a university student in Denmark. Thorup also worked at NeXT from 1993 to 1996.
Apple development and Swift After acquiring NeXT in 1996, Apple Computer used OpenStep in its then-new operating system, Mac OS X. This included Objective-C, NeXT's Objective-C-based developer tool, Project Builder, and its interface design tool, Interface Builder. Both were later merged into one application, Xcode. Most of Apple's current Cocoa API is based on OpenStep interface objects and is the most significant Objective-C environment being used for active development. At Worldwide Developers Conference (WWDC) 2014, Apple introduced a new language, Swift, which was characterized as "Objective-C without the C".
Syntax Objective-C is a thin layer atop C and is a "strict superset" of C, meaning that it is possible to compile any C program with an Objective-C compiler and to freely include C language code within an Objective-C class. Objective-C derives its object syntax from Smalltalk. All of the syntax for non-object-oriented operations (including primitive variables, pre-processing, expressions, function declarations, and function calls) are identical to those of C, while the syntax for object-oriented features is an implementation of Smalltalk-style messaging.
… excerpt ends here. Continue reading the full article.