People use code to talk to computers. This special code helps make apps. It was made a long time ago. It helps Apple computers work well. Do you like using apps?
People use code to talk to computers. One special code is called Objective-C. Two men made it a long time ago. They wanted to make software better.
This code works by sending messages. It tells parts of the code what to do. This helps different parts work together. It is like a team talking to each other.
Apple uses this code for its computers. It helps make apps for the iPhone too. For a long time, it was the main way to make them. Now, Apple uses a new code called Swift. Objective-C is still very important.
Objective-C is a special way to write code for computers. Two men named Brad Cox and Tom Love made it. They started their work in the early 1980s. They wanted to make software parts easier to reuse. This means using the same code for different jobs.
Objective-C is based on an older language called C. It adds a new way to work called messaging. In other coding styles, you call a method. In Objective-C, you send a message to an object. An object is a part of the code. The object decides how to handle the message when the program is running. This makes the code very flexible.
Apple uses Objective-C for many things. They used it for the NeXTSTEP system. Later, it became the main language for macOS and iOS. This helped people build apps for the iPhone. In 2014, Apple introduced a new language called Swift. Swift is meant to be easier than Objective-C. Even so, Objective-C remains very important for many developers.
Objective-C is a special language used to give instructions to computers. It is a high-level language, which means it is designed to be easy for people to read and write. This language is very useful because it is object-oriented. This means it organizes code into "objects" that can work together. It also adds a special way of working called messaging to an older language called C.
This language works through a process called message passing. In many other languages, you tell a piece of code to run a specific task. In Objective-C, you instead send a message to an object. The object then decides how to handle that message while the program is actually running. This makes the code very flexible. For example, you can send a message to a group of objects even if some of them do not know how to answer.
Two men named Brad Cox and Tom Love created Objective-C. They began their work in the early 1980s at a company called Productivity Products International. They wanted to make it easier for programmers to reuse their work. Cox was inspired by a language called Smalltalk. He wanted to combine the power of Smalltalk with the C language. This way, engineers could keep using what they already knew while gaining new tools.
Objective-C became very famous because of a company called NeXT. NeXT used the language for its NeXTSTEP operating system. Later, Apple purchased NeXT in 1996. Because of this, Objective-C became the main language for Apple's macOS and iOS systems. This helped developers build the apps we use on iPhones today. In 2014, Apple introduced a new language called Swift to help developers even more.
When you write in Objective-C, you use two different types of files. The first is a header file, which usually ends in .h. This file acts like a list that shows what an object can do. The second is an implementation file, which usually ends in .m. This file contains the actual instructions for the tasks. It is like having a menu that tells you what food is available, and then having a kitchen that actually cooks the meal.
Objective-C is a high-level, general-purpose, object-oriented programming language. It functions as a strict superset of the C programming language. This means any valid C program can also be compiled using an Objective-C compiler. The language is unique because it adds Smalltalk-style messaging to the existing C structure. This combination allows developers to use powerful object-oriented features while maintaining compatibility with older C code. It has played a massive role in the history of modern computing environments.
The core mechanism of Objective-C is a process called message passing. In many other languages, like C++, a programmer calls a method. In those languages, the compiler usually binds the method name to a specific piece of code before the program runs. However, Objective-C uses a different model where the target of a message is resolved at runtime. This means the receiving object itself interprets the message while the program is active. A message is identified by a selector, which is a unique identifier for the message name. This selector is then resolved to a C method pointer, which is the actual implementation of the task.
Because messages are resolved at runtime, the system does not use type checking for them. This provides a high level of flexibility for the programmer. If a message is sent to an object that cannot respond, the system raises an exception. One major advantage of this dynamic approach is that messages can go unimplemented without causing immediate errors. For instance, you can send a message to a collection of objects even if only some of them are expected to respond. This allows for more adaptable and fluid software designs compared to the Simula-style models used in C++.
Objective-C code is organized into two distinct parts: the interface and the implementation. The interface describes what an object can do, while the implementation contains the actual instructions. Developers typically place the interface in a header file, which uses the .h extension. These files act like a formal declaration of a class. They show the class name, its parent class, and its available methods. Within these declarations, plus signs denote class methods, which act on the class itself. Minus signs denote instance methods, which act on a specific instance of that class.
The actual logic of these methods is written in implementation files, which usually end in .m. The .m extension originally stood for "messages." This separation of concerns allows other parts of a program to understand how to interact with an object without needing to see all the complex code inside it. Developers can also use a feature called a category. A category allows a programmer to add new methods to an existing class without changing the original source code. This makes the language highly extensible for large software projects.
The history of Objective-C began in the early 1980s. It was developed primarily by Brad Cox and Tom Love at their company, Productivity Products International. Cox was interested in software reusability and was inspired by the Smalltalk language. However, he knew that backward compatibility with C was essential for engineers. He originally created an Object-Oriented Pre-Compiler to bridge these two worlds. By 1986, Cox published the formal description of the language in his book, "Object-Oriented Programming, An Evolutionary Approach."
The language gained massive popularity through the company NeXT. In 1988, NeXT licensed the language and used it to build the NeXTSTEP operating system. NeXT developed important libraries like the Application Kit and Foundation Kit. When Apple purchased NeXT in 1996, they adopted Objective-C for their new Mac OS X system. It became the standard language for developing macOS and iOS applications through the Cocoa and Cocoa Touch APIs. This era of dominance lasted until 2014, when Apple introduced the Swift language to its developers.
Today, Objective-C remains a significant part of the computing landscape. While Swift is newer, much of the current Cocoa API is still based on OpenStep interface objects. Objective-C can be compiled for any platform supported by the GNU Compiler Collection or LLVM/Clang. This means it is not strictly limited to Apple hardware. Its ability to blend the efficiency of C with the flexibility of Smalltalk continues to make it a foundational tool in the history of software engineering.
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.