Cocoa Programming with NO Experience
I want to learn how to make Cocoa Programs, and I have no experience beyond AppleScript... help me out here, there are books out, no?
anybody? I want to learn how to just do it, as I can do AppleScript now of when I know that I want to make this happen, I do something... I want to be at that level, and I learned to be at that level when I was twelve, SO I am hoping I learn Cocoa in a similar fashion of not having a class or anything but reading a book or two.... anyoney?


anybody? I want to learn how to just do it, as I can do AppleScript now of when I know that I want to make this happen, I do something... I want to be at that level, and I learned to be at that level when I was twelve, SO I am hoping I learn Cocoa in a similar fashion of not having a class or anything but reading a book or two.... anyoney?




Comments
Thanks
<strong>I was told you should really know a lot of C++ before you even start attempting to do Cocoa (or Carbon) programming. Is this true?</strong><hr></blockquote>
ive heard the opposite that C++ will just create bad habits and methods and ways of thinking that are only going to cause problems as you transition to objective c which cocoa uses
Personally, I *vastly* prefer Obj-C, and think that C++ will indeed do more to ruin your OO thinking than help it, but C++ has its place in Mac programming, and god knows it is considered a 'must' for a resume bullet point.
If you're looking to learn *Mac* programming, or *object-oriented* programming, try and wrap your brain around Obj-C first. It's the primary language you'll use if you want to go the Cocoa route, and it provides a much cleaner and more pure form of OO. You can spend your time learning the *concepts*, instead of the *language*, like you will with C++. (C++ is a huge morass of a language, trying to be everything to everyone and accomplishing most of it at least adequately, but none of it spectacularily.)
Then, once you have a good solid idea of what OO is all about, you can hop over to the C++ world and find out all the ways to pull your hair out trying to determine how to get around limitations in the language.
If, however, you're looking to add a bullet point to your resume, go the C++ route. Then, in a couple of months when you've figured it out, dive into Obj-C.
<strong>
If, however, you're looking to add a bullet point to your resume, go the C++ route. Then, in a couple of months when you've figured it out, dive into Obj-C.
</strong><hr></blockquote>
I wheel this comment out every time someone asks this so here I go again:
Don't learn C++.
If you have to ask, you don't need or want to learn it.
If you are wanting a bullet point, learn java (and/or its evil twin C#).
Then, in a few years, when you know what's what and you decide you really need C++, you can learn it easily (relatively!) by applying all your Obj-C and Java knowledge. Note: this day may never come.
Just doing my bit to ensure new programmers aren't put off by starting with one of the hardest to learn languages and getting very little, if any, benefit for their trouble.
how different is java from javascript?
<strong>Get Learning Cocoa with Objective-C by James Duncan Davidson, he works for Apple, and it's one of those O REILLY books with the dogs on it. It's a good book.</strong><hr></blockquote>
Are you sure he works for Apple? I knew he had left Sun and was a big fan of Apple products but I hadn't heard about Apple hiring him.
Anyway, that wasn't my main point, this was: this book is the second edition of Learning Cocoa. The first edition was rushed out and sucked big time. It was basically a rehash of Apple's online developer documentation.
This is technically the second edition but it has a new author and a slightly expanded title and is much better (or so I've heard, I only bought the 1st edition, grrr, but I have a lot of respect for Davidson and O'reilly is generally a very, very good publisher).
check out the o'reilly macdevcenter for sample articles, including some by the author of this book.
<a href="http://www.macdevcenter.com" target="_blank">http://www.macdevcenter.com</a>
the programming in cocoa series
<a href="http://www.macdevcenter.com/pub/ct/37" target="_blank">http://www.macdevcenter.com/pub/ct/37</a>
james duncan davidson stuff (including a sample chapter from his Cocoa book
<a href="http://www.oreillynet.com/pub/au/151" target="_blank">http://www.oreillynet.com/pub/au/151</a>
[ 01-20-2003: Message edited by: stupider...likeafox ]</p>
I have been writing PHP for a couple years now (self-taught and not full time) and have a very good grasp of the NON-OOP side of that fence. I have played around with OOP in PHP and comprehend and have applied it, but am lacking a good global view of the benefits it will get me and keep falling back to my non-oop style (I forget the proper term for this).
I am interested in getting more into non-web programming.
I believe non OOP programming is called "procedural"
I believe the object oriented concepts make much more sense and are much better implemented in ObjC than in Java or C++.
PHP will give you enough of a foundation in programming that you could probably pick up Cocoa and ObjC without too much trouble.
If you want to learn to make applications for Mac OS X, use Cocoa and learn it from the book "Cocoa Programming for Mac OS X" by Aaron Hillegass.
Do not worry about Java, C++, or Carbon at first. Just learn Obj C and Cocoa. After you have a good handle on that and have a few small applications under your belt, you may wish to expand your skills and learn the other things, but you have to stay focused on one thing in the beginning.
If you have little or not programming experience, an online course or tutorial introduction to Java or C++ will help to get you familar with basic programming and OO concepts.
When learning something like this, experiement a lot.
AppleScript and Python are well-known as scripting languages, as JavaScript is, but nothing requires an OO language to be compiled to be "serious" or a good way to learn. Python in particular has been proven to scale nicely up nicely to millions of lines of code, but even if it didn't it would be a good place to start.
I haven't seen RealBasic, so I can't give a concrete recommendation, but pretty much everything is better than C++ as far as learning OO. Once you're a fluent programmer - which is more or less irrelevant to any particular language - then you can become a good C++ programmer. And believe me, the world needs them.
Just as a clarification, there are several different kinds of non-OO language (and several different kinds of OO). Procedural languages include C, Pascal, FORTRAN and old-school BASIC. There are also declarative languages, whose goal is to be able to solve a problem by stating the problem in code. Examples include PROLOG, ML, Mercury and Miranda. Very few languages are pure examples of a particular style: There are declarative languages with OO capabilities, OO languages with procedural capabilities (C++ and Objective-C) - C can even look vaguely declarative under certain circumstances, as a result of its expression evaluation syntax.
Actually, one of the many problems with C++ is that it was designed by commitee - it tries to do everything. It even acquired a half-hearted message-dispatch ability as a nod to Objective-C. It doesn't enforce any particular style or paradigm even tentatively, so you have to be disciplined enough to impose one on it, or you'll probably end up writing unreadable gibberish. There's a lot of that out there.
[ 01-20-2003: Message edited by: Amorph ]</p>
<strong>Are you sure he works for Apple? I knew he had left Sun and was a big fan of Apple products but I hadn't heard about Apple hiring him.</strong><hr></blockquote>
My mistake, sorry. From the back of the book,
[quote]Originally written by insiders at Apple Computer Inc., and revised for this new edition by James Duncan Davidson, this book... <hr></blockquote>
<strong>I was a very good procedural programmer in college but I haven't been able to make the switch to OOP on my own.</strong><hr></blockquote>
You'd be amazed how many people think they are OO programmers because they use Java or C++. Keep trying--when the penny drops you really do think, "wow, so that's what everyone was talking about".
I could recommend a list of books but you say you've tried that. In that case I would recommend trying test-first programming using JUnit (or language-specific alternative) and the technique of refactoring.
Both these techniques evolve your code towards taking full advantage of OO goodness.
read more at:
<a href="http://www.junit.org" target="_blank">http://www.junit.org</a>
<a href="http://www.refactoring.com" target="_blank">http://www.refactoring.com</a> (the book rocks)
Also anyone who calls themselves a programmer should have read the pragmatic programmer by Andy Hunt and Dave Thomas.
Best. Programming. Book. Ever.
<a href="http://www.pragmaticprogrammer.com/ppbook/" target="_blank">http://www.pragmaticprogrammer.com/ppbook/</a>
PS not to diss RealBasic but if you're learning for your own edification, rather than to get a specific job done, I'd stick to Java as it hits the right mix of mainstream acceptance, ease of use and support for OO.
Obj-C and Cocoa are cool too, and if you've got a procedural background you can explore both at the same time. Remember that Java looks like C++ but it thinks like Obj-C.