[Obj C] patternBuffer[0]: Learn Objective C using Previous Programming Languages

Foreword: As I was learning how to develop for iOS I was disappointed to not find many tutorials or articles that were written for people who already have experience with other object oriented languages such as C++, Python, Java, etc. If you already have experience programming the many common patterns and structures that software developers use, but in another language it would be nice to simply see how those patterns appear in the new language being learned. That is what I’m going to do with the pattern buffer series for objective c, aka [Obj c] and I will begin with the basics of defining, declaring and calling basic variables, objects and methods.

A brief history of…

Objective C was designed to be completely backwards compatible with standard (non object-oriented) C but using Small Talk derivative mechanics of object orientation to expand on it’s capabilities, in particular it uses the message model of object orientation. These were all concepts that the Xerox XPARC research division had developed, along with ideas such as the GUI that Apple had eventually acquired before they’re personal computers took off in the early 80’s. Objective C itself was initially developed by a now defunct personal computer firm called NextStep, whose name you will become intimately familiar developing in this language. When they wrote the foundation framework for this language they came up with a standard naming convention for objects from the foundation library by giving the “NS” prefix to any object or variable that comes from the foundation objective c library. NextStep was eventually acquired by Apple and has since been their primary language for developing applications for not just their personal computer operating systems, but also now for their phones, tablets, wearables, and home devices.

The Basic place to start for a new programmer of a language is of course the infamous “Hello World!” program, so here we will keep with tradition by explaining how this program is written (for the terminal) in Objective C and compare it to C++, Python and Java.

In C++ developers typically use the “iostream” standard library to communicate with the console.


#include

Leave a comment