Conveniently, Cocoa brought Apple its own cleverly-designed, object-oriented Model-View-Controller programming framework for rapid application programming.
Thanks to its acquisition of co-founder and CEO Steve Jobs NeXT computer company, Apple enabled itself to leap into desktop applications programming with rewed vigor. The acquisition granted Apple exactly what it needed to create completely compelling consumer electronics products.
- a solid, UNIX-based OS (NeXT OS was written on top of Unix) - Mac OS X is written on top of FreeBSD UNIX and Mach 3 kernel
- a rapid application development environment: Interface Builder and Xcode (formerly called Project Builder) - Interface Builder is truly unique, going far beyond the Microsoft world of wizard-wizards
- the Cocoa framework (originally called NextStep) that easily gives applications an MVC GUI architecture - for programmers who invest the time to learn to use it
Convenience is a two-edged sword. Cutting corners can have negative consequences in computing. However, skillful architecture and design can make things both easy and safe.
Cocoa was created in the 1980's, building upon the best-known "classic" object-oriented patterns such as the MVC triad. It was used to create the original web browser by
Tim Berners-Lee, the inventor of the World Wide Web and the
founder of the W3.
MVC is a very simple idea. Write data-centric programs. It is very counter-intuitive to do this when you are striving to create a terrific GUI application.
However, it turns out to be the right thing to do.
User interfaces change rapidly and frequently. As quickly as users can change their minds and for as long as it takes for them to make up their minds as to what they really need. Trust me, that produces a lot of changes. As long as things stay within the intended scope of the project and everything is converging on the original goal, that is a good thing.
But to make that happen, developers need an architecture that can make that happen. A good programming language, good development support tools, and a good class framework library are essential. That is where Cocoa fits in.
Cocoa programmers typically create their user interface in a WYSIWYG, RAD tool named Interface Builder. IB lets them directly assemble the GUI using the same drag-and-drop techniques pioneered by the Macintosh in the 1980's.
Not only do they do that, but they also connect together those components with the data model they design to hold the application's business objects. Modern Cocoa even includes a framework with it named CoreData which can automatically load/store the business objects in a database.
Using Cocoa takes more learning than a lot of programming APIs. However, once you learn it you are able to create/modify applications much faster and more easily than usual.
Cocoa has not only built on a lot of classic patterns and blazed a few innovative trails of its own, it has adopted new trend setting patterns that have come along over the decades. One of these is unit testing. Cocoa and Xcode come with a unit testing framework, OCUnit.
The Xcode IDE is not just a regular IDE. It comes with data modeling tools so that visualizing your data object model is easy. In fact, it can create a class model diagram of it for you. It can also do a static analysis of your program and point out definition-usage (DU) errors, like spots where the value in a variable can possibly be undefined.
Xcode is multilingual too. It supports many programming and document languages, not just one or two. Cocoa is too.
Objective-C is generally the best language to use for Cocoa programming since that is what it is written in. However, Apple includes a terrific scripting language named AppleScript with the Mac named. Scripting languages like Python, Ruby, and Perl cropped up during the 1990's around the same times as ApplesScript. Cocoa and Xcode support them too, not just its proprietary AppleScript language.
Forcing you to always use one tool, one language, or a single company's technology is not the Apple way. Apple has fostered an open environment on the Macintosh where programmers can be productive and users can reap the rewards.
Conveniently, Cocoa brings the power of all of these things right to your fingertips.