Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > how easy is it to learn cocoa?

how easy is it to learn cocoa?
Thread Tools
Junior Member
Join Date: Jun 2000
Location: new york
Status: Offline
Reply With Quote
Jan 25, 2001, 02:37 PM
 
hey, im not a programmer, i know some js thats about as advanced as i get.
but i'd kinda like the ability to write small little apps in os x.
so just how easy is cocoa to learn- for someone with out any other real programing experience?

and also, does anyone know a good places to start?

thanks in advance,
mbordas

------------------
I don't suffer from insanity, I enjoy every minute of it.
http://bordas.dhs.org
I don't suffer from insanity, I enjoy every minute of it.
     
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jan 25, 2001, 02:54 PM
 

To learn Cocoa you must first learn Java or Objective-C. In both cases, you probably should learn C++ first, although you can just learn Java by itself.

But, you don't need Cocoa to create applications on Mac or Mac OS X. You can use BASIC via REALBasic. Go here: http://www.realbasic.com/

"Last time the French asked for more evidence, it rolled through France with a German flag." - David Letterman
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jan 25, 2001, 04:20 PM
 
There's no point in learning C++ before ObjectiveC, since Obj-C is based on C, not C++ - C++ is incompatible with Obj-C.

Learning the basics of C with something like Learn C on the Macintosh, then going to Apple's developer documentation and reading ObjC.pdf (their book on the language), then doing some experimentation wtih SimpleCocoaApp, CurrencyConverter, the Rhapsody Discover OS pdf file (all available on developer.apple.com/techpubs) and VermontRecipes (http://www.stepwise.com/) seems to be the best way to go.

REALbasic is, in my experience, pretty sucky, especially under OS X. It's also not free, unlike Apple's Public Beta Developer Tools, including the c compiler and project builder and interface builder.

if all you want to do is write small apps for OS X, ObjC/Cocoa is probably the easiest option.
     
mbordas  (op)
Junior Member
Join Date: Jun 2000
Location: new york
Status: Offline
Reply With Quote
Jan 25, 2001, 04:20 PM
 
Originally posted by NeoMac:

To learn Cocoa you must first learn Java or Objective-C. In both cases, you probably should learn C++ first, although you can just learn Java by itself.
Why should i learn c++ first? and i am up to learning java, if its easier than the normal coca


But, you don't need Cocoa to create applications on Mac or Mac OS X. You can use BASIC via REALBasic. Go here: http://www.realbasic.com/
ummm...i don't know too much about programing in realbasic, but from the perspective of a user of countless RB apps, i don't like them..i don't know why, but i almost always have problems with them, so i would rather stay away from RB, thanks anyway

mb

------------------
I don't suffer from insanity, I enjoy every minute of it.
http://bordas.dhs.org
I don't suffer from insanity, I enjoy every minute of it.
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 25, 2001, 05:14 PM
 
Don't bother with Java right now. Learn C before you learn ObjC, because no matter what path you go in (developing for UNIX, Win32, Mac OS Classic), a knowledge of C will get you places. Most tutorials on other languages are based on a knowledge of C. I recommend http://www.cs.cf.ac.uk/Dave/C/CE.html . It will teach you UNIX things as well. Once you get a good idea of C, ObjC is a piece of cake. You can build an application in a matter of seconds without re-using code. BASIC is an evil language, and kills your creativity. Much better to use C or ObjC. C++ is good background for Java, but you can't use it with Cocoa.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
the rev
Guest
Status:
Reply With Quote
Jan 25, 2001, 05:39 PM
 
Thanks! I'm in the same boat as the guy that started this thread, and had been looking for good(and free) tutorial on C.
     
mbordas  (op)
Junior Member
Join Date: Jun 2000
Location: new york
Status: Offline
Reply With Quote
Jan 25, 2001, 09:53 PM
 
thanks! i have a chunk of free time tomorrow, i will start reading that website on c, and i'll be on my way :-)

------------------
I don't suffer from insanity, I enjoy every minute of it.
http://bordas.dhs.org
I don't suffer from insanity, I enjoy every minute of it.
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: San Jose, CA USA
Status: Offline
Reply With Quote
Jan 26, 2001, 07:53 PM
 
If you're not already a programmer I would absolutely NOT recommend that you learn C first. Learn Java. The syntax is simpler, garbage collection means you don't have to worry about storage allocation issues, and the language is "safe" so you will not end up crashing due to things like wrong pointer types. The worst that happens is an exception, which will helpfully dump the stack for you.
Since you can program Cocoa in Java just as well as Objective-C, it seems like an ideal way to get started.
Once you're comfortable with Java, you can learn C and Objective-C easily. It's the same thing as learning to drive -- it's easiest to learn on an automatic and then try a stickshift after that.
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jan 26, 2001, 10:25 PM
 
There is an important issue regarding Java/ObjC programming - there are literally thousands of companies (including SUN, IBM, Oracle, Apple, etc) supporting Java in a BIG way, but only Apple supports Objective-C. If you want your app to run under Solaris, HP/UX, Linux, WIndows, Mac OS X, etc...the only way to go is Java. You can salvage ~80% of your code if you write in Java, but in Objective-C the entire app would have to be rewritten.

Objective-C is probably a very worthy language (although I *really* don't like the look of it), but Java has better market acceptence. Just about any API I need in Java I can find implemented by any number of companies, not to mention the hundreds of books on the language available in even the most insignificant Library/book store.

Options are always a good thing.
     
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jan 27, 2001, 01:02 AM
 
I have never met a Java app I liked. They are always poor UI implementations and often buggy.
Rising programmers ought to know that the great portability they get comes at great expense, not only in quality, but of speed. It is portable exactly because it is non-native.

That said, I don't understand why people advocate the use of Java for app development other than web-based. It seems that this is an egotistical perspective where "My program can be run on more computers" is more important than "My program is good". It is all very microsoftian to me.
you are not your signature
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jan 27, 2001, 03:38 AM
 
Originally posted by Gametes:
I have never met a Java app I liked. They are always poor UI implementations and often buggy.
Rising programmers ought to know that the great portability they get comes at great expense, not only in quality, but of speed. It is portable exactly because it is non-native.
Well, actually, programming in Java for OS X enables you to call the AppKit and Foundation frameworks, so you get all the same functionality as ObjC. Apple has been working hard to get Java on par with ObjC. This means that all your apps will be fully OS X-ified and look almost exactly the same as their ObjC counterparts.

However it also means that the code is less portable. You may be able to reuse some of it, but not all of it by any means.

Also, speed is still an issue, as is the loading of the Java VM when the application starts. System Preferences.app used to be a Java app, apparantly, but I think I read that it's now ObjC since it was too slow and evil when it was written in Java.
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 27, 2001, 08:34 AM
 
Alright. If you're a beginner and you can't learn C first, I'd recommend Perl first, then go straight to C.

If you wanted to run your code under UNIX, couldn't you just use ObjC with GNUstep?
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: San Jose, CA USA
Status: Offline
Reply With Quote
Jan 27, 2001, 12:16 PM
 
Gametes: The reason most Java apps are ugly looking and buggy is because Sun's GUI framework (AWT) is very poorly designed and poorly specified, making it
difficult to implement in a solid/compatible/stable way on different platforms. Swing is a better framework but it's implemented on top of AWT so it inherits most of AWT's problems.
If you use Java with the Cocoa frameworks instead, you eliminate all of those problems. Your app will be just as pretty and stable as an Objective-C app, although it won't be quite as fast as Objective-C and of course won't be cross-platform like a Java AWT/Swing app.

parallax: I know language preference is a religious issue, but the idea of having newbies learn Perl horrifies me. Perl has one of the most awkward, confusing and complex syntaxes of any language I know, since it was created by shoving awk, sh and C together into a blender and scraping out a usable mixture. I will admit it's a useful language with a lot of powerful features, but (as an experienced programmer) I found it hard to learn and unpleasant to use.
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 28, 2001, 07:21 PM
 
Hard to learn!? You must've been on crack when you learned it :-)

It's the easiest language to learn besides HyperTalk, and HyperTalk is basically English. The only thing that should scare newbies away is the special variables and syntax.

Besides, you can program sockets and signals and all sorts of things in Perl that would require more code in other languages. Someone on this thread was suggesting that C is too hard for a newbie to learn: it's not! The most complex thing you can get in basic C is pointers, and even those are easy to work with provided you have a good tutorial that doesn't preface with "Pointers are the hardest thing in the world" (most books do).
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 28, 2001, 07:26 PM
 
So let me sum this up:
http://www.cs.cf.ac.uk/Dave/C/CE.html

If you don't know C, go there and get through all of the syntax. If you want, delve right into the UNIX stuff, as sockets will become useful for you to know. A lot of stuff pertaining to computer theory is written in C, and a good base in C will allow you to learn non-OOP languages without difficulty. Starting off with OOP is a bad idea (IMO), because computers aren't by nature OO.

After that, either read a bit into the vermont recipes at stepwise.com, try to figure out SimpleCocoaApp, or read my "Starting Cocoa" tutorial that will soon be written.

But before you start writing GUI programs, I might suggest learning a bit of basic CS stuff, like linked lists and trees, searching/sorting algorithms and stuff. It's really useful to know all of this because it applies no matter what enviroment you're in.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jan 29, 2001, 12:28 PM
 
Java is still slow and evil, no matter what you guys say. I use Java apps, and this is the case 100% of the time. Because by definition they are emulated apps.
Anyone who uses Java for non-internet type apps needs to step off the money wagon and think about their users.

Why would Apple develop a proprietary version of Java? I think you have it worng when you say that it (Java) will be less portable. Doesn't it just use Cocoa widgets in place of Swing and AWT? Otherwise, being "fully Java compliant" is worthless, since you get all the crappy slow bugginess of Java with none of the advantage of instant cross-platform usability!
you are not your signature
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 29, 2001, 01:50 PM
 
Agreed. Java sucks if you want to make a program with any sort of worth. *ESPECIALLY* if you want to go and make a game, like most of us do :-) If both ObjC and Java had the same speed, you might have a reasonable discussion, but since it's not even close in stability and speed, don't even bother.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: San Jose, CA USA
Status: Offline
Reply With Quote
Jan 30, 2001, 06:20 PM
 
OK, parallax's statement that "Starting off with OOP is a bad idea (IMO), because computers aren't by nature OO" is just absurd. Computer's aren't by nature anything like what you write in C either -- things like malloc and structures and parameter passing are all abstractions that are much higher level than the CPU. The whole point of using a higher level language is to avoid the minutae of the crap the CPU is actually executing. Otherwise we should just start newbies off on PPC assembly code, right?

Second, Gametes writes that "Java is slow and evil because it's interpreted". Modern runtimes make most of that irrelevant except when it comes to launch time. Java is extremely successful on servers, which are high performance environments, because it runs fast enough and the dumb Java GUI frameworks don't get in the way.

Third, "I think you have it worng when you say that it (Java) will be less portable." The Cocoa interfaces to Java call into the native Cocoa framework, so they won't run on anything but OS X. (Just like Sun has a bunch of Java libraries that call native code that they only provide on Windows or Solaris.) You can still use AWT or Swing if you want to be cross-platform, but then you're using frameworks that are less capable than Cocoa. Take your pick.

The "crappy slow bugginess" you describe is a side effect of Sun's poor design of the GUI frameworks, not a feature of the Java runtime itself. It doesn't sound like you've done much (or any) Java development; I've been using it since 1996 including working on implementations of the AWT framework, so I think my statements here are pretty trustworthy
     
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jan 30, 2001, 06:44 PM
 
Ya, I've done zilch development of Java (I was going to but once I started reading a book on it I realized how much it sucked, so I focused on C++).
Still, you are wrong about the speed of Java; I'll say again: "It's interpreted". Java commands are translated at run time to PPC commands. It's like running uncompiled code through an interpreter.

But I acknowledge that you are the expert. That said, why in the hell is Java a good thing for OS X to support if it doesn't use Java APIs? Doesn't making it have to explicitely call Cocoa just undermine the whole instant portability thing?

Picture this:
Its 1994, and I want to download BtoB software for my shipping firm. I go to the site, and it's got 5 buttons labeled "Windows", "Macintosh", "Solaris", "Unix for PPC", "Unix for x86".
Some geniuses as Sun said to themselves "this is dumb. Programmers are writing 5 times the code they could."
So now it's 2000, and I am dowloading the new app. I go to the site and it says "App" (Java).
Of course, nobody downloads it cuz it stinks (it's Java), but that's besides the point. The point is that Programmers "write once, run everywhere".
But now its 2001 (aka 1994), and I want to download software. I go to the site and it says "Mac OS X Java" and "Win 2000 Java". Great, so we're back where we started.
Now it's 2002, and civilization has ended because ADM installed Win 2000 on it's servers, leading to corporate collapse, and all western nations starved to death. Some survivors want to share files via their Airport cards, and one says to the other "good thing they invented Java back in the 90s!" NOT! Little do they know that Thag's OS/2 Gnutella client will not work with Dirg's Mac OS X client!

Do you get me, man? This could be disastrous for Dirg!
you are not your signature
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 30, 2001, 07:09 PM
 
Regardless, ObjC is a superset of C. A lot of languages aren't fully object-oriented, and what do you do when you start looking for classes in them? Would it be so bad if someone learned ObjC *after* they learned C? And no, computers don't work in C, but it sure is a lot closer to the way they work than ObjC. C was meant to be a powerful language— but easy to use. It's supported *EVERYWHERE*, on *EVERY* system that anyone would consider using.

But I acknowledge that you are the expert. That said, why in the hell is Java a good thing for OS X to support if it doesn't use Java APIs? Doesn't making it have to explicitely call Cocoa just undermine the whole instant portability thing?
Yes, exactly. No point in learning Java if you're going to use the Cocoa/Java classes. Really, we don't have a magic language and API that works on every system... *but* ObjC and Cocoa are completely compatible on Mac OS X and Linux systems. When Yellow Box for Windows makes a come back, it's all over :-)
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
KewlMOTD
Guest
Status:
Reply With Quote
Jan 31, 2001, 09:20 AM
 
Problem with ObjC: only Apple is the only major company to support it, and much of its actual functionality derives from its framework, whether it be NeXTStep, OpenStep, or Cocoa. Of course, there are proprietary frameworks everywhere, like MFC, except Apple has a really spotty history of support and evolution.

Java: Sun has really put alot of effort to make its standard framework portable, and now it has widespread industry support, which makes up for its VM overhead and limited usefulness. As a Cocoa programming language, it sucks. You have the overhead of starting up a VM, making calls across the Cocoa bridge, limited use of the Cocoa framework, and loss of portability. Yeah, whatever happened to cross-platform Yellow Box support? Again, Apple's spotty and proprietary history.

*but* ObjC and Cocoa are completely compatible on Mac OS X and Linux systems.
???
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jan 31, 2001, 01:18 PM
 
Yes, ObjC and a lot of the functionality of the NS Classes (Cocoa's AppKit and Foundation) are supported by GNUStep (http://www.gnustep.org/).
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jan 31, 2001, 02:11 PM
 
???
http://gnustep.org/

I get some Cocoa syntax verbatim from GNUstep documentation.

And congrats on post 200 Angus :-)

[This message has been edited by parallax (edited 01-31-2001).]
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
KewlMOTD
Guest
Status:
Reply With Quote
Jan 31, 2001, 10:25 PM
 
There's nothing there.
     
Mac Enthusiast
Join Date: Feb 2001
Location: London, UK
Status: Offline
Reply With Quote
Feb 2, 2001, 11:37 AM
 
Still, you are wrong about the speed of Java; I'll say again: "It's interpreted". Java commands are translated at run time to PPC commands. It's like running uncompiled code through an interpreter.
This isn't really true - if you examine the performance of the very latest java runtimes you will see that they are approaching the speed of compiled C. It's down to the effectiveness of the JIT compiler. I'd like to provide a link to back this up, but I can't find one so you'll have to take my word for it.

Regardless, ObjC is a superset of C. A lot of languages aren't fully object-oriented, and what do you do when you start looking for classes in them? Would it be so bad if someone learned ObjC *after* they learned C? And no, computers don't work in C, but it sure is a lot closer to the way they work than ObjC. C was meant to be a powerful language— but easy to use.
I don't dispute that C is a fine language to start with even if you are going to proceed to OOP, but I don't understand why being 'closer to the way computers work' is relevant or useful. Modern frameworks and API's are extremely object orientated and seeing as that's what the developer will be dealing with isn't that all thats important?

But now its 2001 (aka 1994), and I want to download software. I go to the site and it says "Mac OS X Java" and "Win 2000 Java". Great, so we're back where we started.
If someone develops an app using java + cocoa they aren't going to label their app as Mac OS X java, because it is a Mac OS X app like any other. If they use java + swing then it is pure java so it will work crossplatform without any problems. So I don't really see the problem here.

Hard to learn!? You must've been on crack when you learned it :-)
It's the easiest language to learn besides HyperTalk, and HyperTalk is basically English. The only thing that should scare newbies away is the special variables and syntax.
Not wanting to get into a religous 'to Perl or not to Perl' discussion here, but I found Perl chronically difficult to learn and gave up with it basically. The syntax is awful. I would sincerely advise newbies to stick well clear of it.
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Feb 2, 2001, 02:13 PM
 
There's nothing there
You mean at GNUstep? http://gnustep.org/resources/documentation.html
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2