Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning OO for a C Programmer [closed]

Tags:

c

oop

objective-c

I've been programming professionally in C, and only C, for around 10 years in a variety of roles.

As would be normal to expect, I understand the idioms of the language fairly well and beyond that also some of the design nuances - which APIs to make public, who calls what, who does what, what is supposed to reentrant and so on. I grew up reading 'Writing Solid Code', it's early C edition, not the one based on C++.

However, I've never ever programmed in an OO language. Now, I want to migrate to writing applications for iPhone (maybe android), so want to learn to use Objective-C and use it with a degree of competence fitting a professional programmer.

How do I wrap my head around the OO stuff? What would be your smallest reading list suggestion to me.

Is there a book that carries some sort of relatively real world example OO design Objective-C?

Besides, the reading what source code would you recommend me to go through.

TIA

like image 501
Holysmoke Avatar asked Sep 09 '12 19:09

Holysmoke


People also ask

Can you do OO in C?

The purpose of object oriented programming (OOP) is to produce well designed reusable code. In principle OOP can be done in any language, even assembly. This is because all OO language compilers/assemblers (e.g. C++) ultimately translate the high level constructs of the language into machine language.

What are the 3 pillars of OO programming?

There are three major pillars on which object-oriented programming relies: encapsulation, inheritance, and polymorphism.

Is it necessary to learn object oriented programming?

The core idea is: Thinking in an object-oriented way is a great way to understand the problem you are trying to solve. It allows you to build software that is more maintainable and easily understandable for other people.


2 Answers

Even though the book I am about to recommend you is not specifically for Objective-C (it goes through all concepts of OOP without diving into any specific language) it is probably the best book I've read yet on the subject for a beginner needing an introduction to the subject, it helped me a lot!

The book is: The Object-Oriented Thought Process

I like this book because it assumes absolutely no knowledge of OOP whatsoever, but it is not dull in wasting time with basic programming concepts. It eases you from the procedural paradigm and then to the OO paradigm. If the author starts to use technical terms he is sure to explain them clearly first. The language is easy to follow and the book is most importantly not boring to read, it does not make use of heavy academic language.

The book is also good to give you some examples along the way to make explanations more clear to understand.

like image 128
CodingBeagle Avatar answered Oct 17 '22 23:10

CodingBeagle


Note that the book I'm suggesting here was published (2nd edition) in 1991.

Object Oriented Programming: An Evolutionary Approach by Brad Cox, the creator of Objective-C, is the book he wrote to introduce his language to the world, and that was a world unfamiliar with the very idea of object-oriented programming. So the book goes very gently and introduces all the basic ideas.

Brad Cox had some ideas about how Objective-C was going to deliver really powerful re-use of components, but things haven't really gone the way he predicted. Still he was a smart guy and I'd recommend his book if you can get hold of it.

For completeness I'll second tuğrul's pointer to https://stackoverflow.com/questions/7571/cocoa-and-objective-c-resources, which has all the modern books listed.

like image 2
Bryan Avatar answered Oct 17 '22 23:10

Bryan