Objective-C

[3] Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system.

However, he and Tom Love also recognized that backward compatibility with C was critically important in ITT's telecom engineering milieu.

[9] 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 their brainchild.

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.

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.

NeXT dropped hardware production and focused on software tools, selling NeXTSTEP (and OPENSTEP) as a platform for custom programming.

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.

The GNU project started work on its free software implementation of Cocoa, named GNUstep, based on the OpenStep standard.

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.

[25] If messages are sent to nil (the null object pointer), they will be silently ignored or raise a generic exception, depending on compiler options.

The statements are equivalent at runtime, but the extra information allows the compiler to warn the programmer if the passed argument does not match the type specified.

Running the program produces this output: During the design of Objective-C, one of the main concerns was the maintainability of large code bases.

Experience from the structured programming world had shown that one of the main ways to improve code was to break it down into smaller pieces.

The C# and Visual Basic (.NET) languages implement superficially similar function in the form of extension methods, but these lack access to the private variables of the class.

[36] A zero-ing weak subsystem was also provided such that pointers marked as "__weak" are set to zero when the object (or more simply, GC memory) is collected.

[40][41] Objective-C 2.0 introduces a new syntax to declare instance variables as properties, with optional attributes to configure the generation of accessor methods.

When compiled using clang 3.1 or higher, all properties which are not explicitly declared with @dynamic, marked readonly or have complete user-implemented getter and setter will be automatically implicitly @synthesize'd.

Properties can be accessed using the traditional message passing syntax, dot notation, or, in Key-Value Coding, by name via the "valueForKey:"/"setValue:forKey:" methods.

[46] Unlike garbage collection, which occurs at run time, ARC eliminates the overhead of a separate process managing retain counts.

When using Apple LLVM compiler 4.0 (Xcode 4.4) or later, arrays, dictionaries, and numbers (NSArray, NSDictionary, NSNumber classes) can also be created using literal syntax instead of methods.

In particular, under manually reference-counted memory management, these objects were autoreleased, which required added care when, for example, used with function-static variables or other kinds of globals.

Instead of writing a method invocation like: It was instead written as Similarly, declarations went from the form to This "modern" syntax is no longer supported in current dialects of the Objective-C language.

Overall, POC represents an older, pre-NeXT stage in the language's evolution, roughly conformant to Brad Cox's 1991 book.

See Xcode § Toolchain versions for a translation[45] The GNU project has, for a long time, been interested in a platform to port NeXT and Obj-C programs to.

[33][57] GNUstep documentation suggest that the GCC implementation still lacks support for blocks, non-fragile variables, and the newer ARC.

Combined with its own implementation of Cocoa Touch and underlying APIs, the project allows the reuse of iOS Application code inside of UWP apps.

Objective-C today is often used in tandem with a fixed library of standard objects (often known as a "kit" or "framework"), such as Cocoa, GNUstep or ObjFW.

Programs written in Objective-C tend to be not much larger than the size of their code and that of the libraries (which generally do not need to be included in the software distribution), in contrast to Smalltalk systems where a large amount of memory was used just to open a window.

[60] However, in more recent versions of macOS and iOS, garbage collection has been deprecated in favor of Automatic Reference Counting (ARC), introduced in 2011.