I'm looking for a good book on Object Oriented programming theory
I've been trying on and off for the past year or so to get the basics of Cococa down, but I've been having some problems with understanding some of the OO concepts, such as accessor methods and creating new class methods, etc and the web tutorials I've seen have mostly just breezed through the concepts.
"Learning Cocoa With Objective C" really doesn't spend that much time on a lot of the more basic stuff and somehow assumes a paragraph is enough to completely understand everything.
Can anyone offer any suggestions as to what books would be best suited to a beginner who really wants to learn the basics before he gets into bad programming habits?
"Learning Cocoa With Objective C" really doesn't spend that much time on a lot of the more basic stuff and somehow assumes a paragraph is enough to completely understand everything.
Can anyone offer any suggestions as to what books would be best suited to a beginner who really wants to learn the basics before he gets into bad programming habits?
Comments
Cocoa in a Nutshell
Its an Orielly book.
Cocoa in a Nutshell, like all the others in O'Reilly's Nutshell series, is a reference manual for APIs and such like. Definately not the place to learn concepts such as Object-Orientation.
Obj-C *is* heavily based on Smalltalk, Patterns *are* cool, and Kent Beck is some kind of programming *god* but I still wouldn't start there as it is aimed at advanced practicioners of a different language that isn't very popular despite its extensive influence.
C++ is in many ways the work of satan and should be avoided by all who value their sanity. In particular it is viewed as a perverse aberration by many fans of 'pure' object-orientation. More generally, buying the book by the guy who designed the language is a classic mistake for beginners, as he (or she) could not be further from your position as a beginner approaching the language for the first time.
Design Patterns *is* a classic. But it is also a turgid, dry, academic read which is why most programmers, even those who warmly cite it's name, have never read it and don't intend to either. Also, most of it's examples are in C++.
On a more positive/constructive note:
O'reilly has a book called Head First Java that approaches learning object-orientation by applying various theories of how people actually learn. You can read about the approach, and sample chapters to see if it is for you at the following site:
http://www.oreilly.com/catalog/hfjava/index.html
For those wondering about the inconsistancy of warning off a Smalltalk book and then recommending a Java one, I'll note that although Java *looks* a lot like C++, it stole much more of its style from Obj-C.
Another Java book which you probably might like if you want to avoid "bad habits" is Java Extreme Programming Cookbook or any other similar title that takes you through the use of Ant, CVS (or similar source control e.g. Subversion) and particularly the JUnit, unit-testing framework.
http://www.oreilly.com/catalog/jextprockbk/?CMP=IL7015
Unit-testing -- which is totally language agnostic, see http://c2.com/cgi/wiki?JavaUnitClones -- is, in my opinion, the number one tool for ensuring adherence to object oriented principles since it encourages you to test your classes as stand alone units with defined functionality.
Once you have that mastered you can build on the unit-testing foundation with refactoring. See the following link for a taster of Martin Fowler's excellent book on the subject. It is a much better introduction to patterns than the Desing Patterns book itself.
http://www.refactoring.com/catalog/index.html
Now I guess they should have banned me rather than just shut off posting priviledges, because kickaha and Amorph definitely aren't going to like being called to task when they thought they had it all ignored *cough* *cough* I mean under control. Just a couple o' tools.
Don't worry, as soon as my work resetting my posts is done I'll disappear forever.
Originally posted by stupider...likeafox
For those wondering about the inconsistancy of warning off a Smalltalk book and then recommending a Java one, I'll note that although Java *looks* a lot like C++, it stole much more of its style from Obj-C.
You had some good points about my recommendations. I never programmed in Objective-C, but I earned my money by programming Smalltalk for nearly ten years. So when I see something like this:
...
[myRect display];
or
[myRect setOrigin:30.0 :50.0];
or
[myRect setWidth:10.0 height:15.0];
this looks much more like Smalltalk than Java to me...