 |
 |
A good easy Cocoa book
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2002
Status:
Offline
|
|
Okay, two options:
1. Get some (lame) "Learn Cocoa in 24 hours" book and regret it. These books might give you some clues on how to do something, they certainly wont explain *why*, and they will probably make you really confused in the long run. I strongly do not advise this.
2. Learn to code!!
To learn "Cocoa" you need to first know Objective-C (Java is an option, but i'm going to discourage you). To learn objective-c, you need to know C and the fundamentals of object-oritented design.
Learning C (part one):
There are tons of great books out there, compare reviews and see which book fits you. Some teach by lecturing, some by example, some by a combination.
Also, Get Kernighan and Richie "The C Programming Language". It's not so great as a learning book, but a badass reference.
Learning C (part two):
Get a book on data structures. Learning C will make you a programming. Knowing the fundamentals of good design and structure makes you a good programmer.
I recommend "data structures and other objects using C++". This would be augmented with a book on C++ (online or print). This would help you get the Object Oriented stuff down, as well as provide a backbone for future good coding.
Second Recommendation: "Algorithms with C" by O'Reilly. Really nice overview of creating well written code.
Read some Apple Documentation
Read these:
Cocoa and Objective-C intro http://developer.apple.com/techpubs/...ewToCocoa.html
Object Oriented Programming and the Objective-C Language http://developer.apple.com/techpubs/...veC/index.html
Apple interface guidelines http://developer.apple.com/techpubs/...nes/index.html
These are dry and boring, but worth trying to read
Get a Cocoa book
Get two.
First, get the O'Reilly Cocoa book - but don't read it yet!
Next, get "Cocoa Programming for Mac OS X" by Aaron Hillegass.
Aaron's book is badass. You'll have no problem understanding it, but be sure to know have C and Object Oriented design *DOWN* before you start this.
Then finish this up with the O'Reilly book.
------
I know, it's a lot. But doing it any other way, and you're wasting your time. If you really want to be a programmer - it takes dedication, time, and passion for the art.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status:
Offline
|
|
I'll back him up on that. Forget about Cocoa for now. You need to learn basic programming first. It doesnt really matter what language you use. I personally would suggest C but Java is fine too. The principles are all the same.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: somewhere in ohio
Status:
Offline
|
|
I will third that, I had no experience either til I learned C and then Objective-C from the Apple docs. Cocoa is the last thing to learn.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by conner:
<STRONG>Okay, two options:
1. Get some (lame) "Learn Cocoa in 24 hours" book and regret it. These books might give you some clues on how to do something, they certainly wont explain *why*, and they will probably make you really confused in the long run. I strongly do not advise this.
2. Learn to code!!
To learn "Cocoa" you need to first know Objective-C (Java is an option, but i'm going to discourage you). To learn objective-c, you need to know C and the fundamentals of object-oritented design.
Learning C (part one):
There are tons of great books out there, compare reviews and see which book fits you. Some teach by lecturing, some by example, some by a combination.
Also, Get Kernighan and Richie "The C Programming Language". It's not so great as a learning book, but a badass reference.
Learning C (part two):
Get a book on data structures. Learning C will make you a programming. Knowing the fundamentals of good design and structure makes you a good programmer.
I recommend "data structures and other objects using C++". This would be augmented with a book on C++ (online or print). This would help you get the Object Oriented stuff down, as well as provide a backbone for future good coding.
Second Recommendation: "Algorithms with C" by O'Reilly. Really nice overview of creating well written code.
Read some Apple Documentation
Read these:
Cocoa and Objective-C intro http://developer.apple.com/techpubs/...ewToCocoa.html
Object Oriented Programming and the Objective-C Language http://developer.apple.com/techpubs/...veC/index.html
Apple interface guidelines http://developer.apple.com/techpubs/...nes/index.html
These are dry and boring, but worth trying to read
Get a Cocoa book
Get two.
First, get the O'Reilly Cocoa book - but don't read it yet!
Next, get "Cocoa Programming for Mac OS X" by Aaron Hillegass.
Aaron's book is badass. You'll have no problem understanding it, but be sure to know have C and Object Oriented design *DOWN* before you start this.
Then finish this up with the O'Reilly book.
------
I know, it's a lot. But doing it any other way, and you're wasting your time. If you really want to be a programmer - it takes dedication, time, and passion for the art.</STRONG>
Woooooooooooooooooow. Um, ah, that is a lot of books. Esp for someone who doesn't like a lot of long books.
So how many books am I looking at? 5? 6?
Is there any easier way? Probably not but it doesn't hurt to ask.
is this how I am suppose to do this?
1. C
2. Objective C
3. C++
4. Cocoa
Even 4 books is a lot. Should I read the entire books or only parts etc?
And do you guys have any favorite books that would suit me?
Thanks!
(I'm going to go look at Amazon now.)
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
a hard time in finding a good C book. I found thi o'Reilly book but the reviewers says it has errors in it.
Is there that big of difference between C and C++ that I have to start with a C book?
Could someone recommend a title?
Thanks!
EDIT:
How this book? http://www.amazon.com/exec/obidos/AS...930323-2295150
Or is that not for me yet or whatever?
And how many books do I need to read before I can write a very basic app?
/EDIT
[ 04-04-2002: Message edited by: PowerBookDude ]
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
You DO need to learn C first, because you won't be using C++. Cocoa uses Objective-C, which is a different variation of C. So even if you want to learn C++, you'll need to start with C so you know where one ends and the other begins.
Basically, the path is:
Learn C (not C++)
Learn about object oriented programming
Learn about Objective-C and Cocoa
The reason people recommended C++ is that there are few books about Obj-C, and there are a lot of C++ books where you can learn the ideas of object oriented programming. You could also try learning about OOP through Apple's Object Oriented Programming and the Objective-C Language and skip C++, but that book's not really aimed at beginners. Either way, you need to start with plain C.
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status:
Offline
|
|
You can start with a C++ book if you want. Loosely defined, C++ is a superset of C. This just means it has extra stuff that allows you to do object oriented programming in addition to standard C things. So you can get a book on C++ and if you work through it you should have a basic understanding of C, C++, and OO programming. Remember though, you can read a hundred books on programming and you wont be able to do a thing
if you dont write code. Do the examples and think of small programs you can write. I did this when i was in college, except i think it was called homework at the time!
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
The problem with that is, when it's time to move on to Obj-C, you won't know what features are C++-specific and which can be used in other C languages. C++ doesn't just add new functionality, it changes some of C's functionality. Several times I have seen C++ programmers moving to Obj-C get confused about the different way structures behave in C as compared to C++. It's easier to move from C to C++ than it is to move from C++ to C.
Edit:
Here's one book: http://www.amazon.com/exec/obidos/AS...945972-8084050
I can't recommend any beginner's book personally, because I can't remember the name of the book I learned C with (I got it from the library). But this one looks good based on the reviews.
And here's the book for Objective-C: http://www1.fatbrain.com/asp/bookinf...500168&vm=
[ 04-04-2002: Message edited by: Jeff Binder ]
[ 04-04-2002: Message edited by: Jeff Binder ]
[ 04-04-2002: Message edited by: Jeff Binder ]
[ 04-04-2002: Message edited by: Jeff Binder ]
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Capital city of the Empire State.
Status:
Offline
|
|
An article on this subject in MacTech magazine advised prospective Cocoa programmers to learn Objective C and/or Java. They regard C and C++ as unnecessary (and potentially confusing).
|
|
/mal
"I sentence you to be hanged by the neck until you cheer up."
MacBook Pro 15"/2.4 GHz Intel Core 2 Duo/4 GB DDR2 SDRAM/200 GB Hitachi HD/8x SuperDrive/Mac OS X 10.6.1
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by Jeff Binder:
[Q]BBasically, the path is:
Learn C (not C++)
Learn about object oriented programming
Learn about Objective-C and Cocoa
[/QB]
So first:
C
Then OOP
Finally Objective-C and Cocoa
That is still a lot of books. Do I really need all those? I'm not going to write OS 11 or something.
Well anyway. I think I'll go with Absolute Beginner's Guide to C (http://www.amazon.com/exec/obidos/ASIN/0672305100/ref%3Dpd%5Fsim%5Fbooks/104-1930323-2295150). My only concern is that that book may be to old.
So hopefully if everyone OKs it I'll order it today or tomorrow.
If possible could someone give me a run down of what does what? like what is C for what is OOP for etc.
Thanks a ton!
Originally posted by malvolio:
<STRONG>An article on this subject in MacTech magazine advised prospective Cocoa programmers to learn Objective C and/or Java. They regard C and C++ as unnecessary (and potentially confusing).</STRONG>
*ugh* You know you think you have a plan then something like this happens and you don't know what to do again.
[ 04-04-2002: Message edited by: PowerBookDude ]
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status:
Offline
|
|
I think we are confusing this guy more than we are helping!
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by mdcarter1:
<STRONG>I think we are confusing this guy more than we are helping!</STRONG>
I finally understood what to read until someone brought up that MacTech article. Know once again I don't know what to do.
Also could someone explain what C does, OOP, does, etc etc etc?
Thanks! And sorry for this taking so long.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2002
Status:
Offline
|
|
Originally posted by PowerBookDude:
[QB]
Woooooooooooooooooow. Um, ah, that is a lot of books. Esp for someone who doesn't like a lot of long books.
So how many books am I looking at? 5? 6?
Is there any easier way? Probably not but it doesn't hurt to ask.
Bad news, reading and lots of coding is the only way you'll reach the goal of being a good cocoa programmer. Don't think of it as a chore, let yourself *like* reading about programming. If you don't like it, don't do it. It's a very time consuming hobby, but one that can pay off.
is this how I am suppose to do this?
1. C
2. Objective C
3. C++
4. Cocoa
Er, more like
1. C
2. C++ (Or Java)
3. Data Structures using C++ (Or using Java)
4. Apple Object Oriented documentation
5. Cocoa
You could go this quicker route, but you may get lost:
1. C
2. C++ basics
3. Apple Object Oriented documentation
4. Cocoa
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2002
Status:
Offline
|
|
Okay, think of it this way, as not to confuse yourself:
1. Forget about Cocoa. You're not going to learn it anytime soon. You need to become a programmer, which requires a hell of a lot of dedication.
2. Learn C! No matter what anyone else tells you, you NEED TO KNOW C. If you're going to program anything, KNOW C. If you don't know plain vanilla C, the other kids will laugh at you.
3. Learn Object Oriented Programming. This means learning Java, C++ or going straight to objective-C. Which one? well..
* Java is fast for the programmer to code, slow for the computer to run. Lots of good books.
* C++ is slow for the programmer to code, fast for the computer to run. Lots of good books.
* Objective-C has little documentation ment for beginners
4. Learn Cocoa - read apple's documentation. Get the O'Rielly book. Get "Cocoa Programming for Mac OS X" by aaron hillegass.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by conner:
<STRONG>2. Learn C! No matter what anyone else tells you, you NEED TO KNOW C. If you're going to program anything, KNOW C. If you don't know plain vanilla C, the other kids will laugh at you.
3. Learn Object Oriented Programming. This means learning Java, C++ or going straight to objective-C. Which one? well..
* Objective-C has little documentation ment for beginners
4. Learn Cocoa - read apple's documentation. Get the O'Rielly book. Get "Cocoa Programming for Mac OS X" by aaron hillegass.</STRONG>
Originally posted by Jeff Binder:
<STRONG>Basically, the path is:
Learn C (not C++)
Learn about object oriented programming
Learn about Objective-C and Cocoa
</STRONG>
Alright I think this is wat I will do.
Learn C.
Learn Objective C (is that the same as Object rOiendted Programing? Or a flavor of it?)
Cocoa.
So about 3 books now right?
Any last thoughts before i go order a book on C? And I have no clue if this will affect anything but I am also going to try to learn UNIX at the same time. I bough a book on it last night.
Once again(!) THANK YOU!
[ 04-04-2002: Message edited by: PowerBookDude ]
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2002
Status:
Offline
|
|
Originally posted by PowerBookDude:
<STRONG>
Alright I think this is wat I will do.
Learn C.
Learn Objective C (is that the same as Object rOiendted Programing? Or a flavor of it?)
Cocoa.
So about 3 books now right?
Any last thoughts before i go order a book on C? And I have no clue if this will affect anything but I am also going to try to learn UNIX at the same time. I bough a book on it last night.
Once again(!) THANK YOU!
[ 04-04-2002: Message edited by: PowerBookDude ]</STRONG>
PowerBookDude:
Congrats on trying to learn. I started where you were at about 25 years ago.
I agree with the others -- if Cocoa programming is where you want to go,
learn C (or Java -- lots of college courses on Java to get a jumpstart)
then start on OOP and ease into Cocoa.
Java may give you a gentler intro to OOP -- from knowing Java, ObjC seemed a lot easier for me to pick up -- but knowing any language helps to pick up additional ones.
Don't completely dismiss Java as a development language for OS X -- true, it's not as fast as a true compiled language, but it's in the fast enough category. With the racks of Java books out there, it'll be easier to pick up help on the language and frameworks.
Also, for learning some of the basics of programming, the scripting languages available can make for a more interactive learning experience -- Python, Perl (especially after you get a taste of C), AppleScript, ...
BTW, I had to giggle at your omigahd, 3 or 5 books reaction -- I've got about 30 FEET of books - and that doesn't count manuals!
Have fun -- it's a great adventure

|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2002
Status:
Offline
|
|
PowerbookDude -
I'm hightly advising against trying to go from C to Objective C. It's possible, but really, really difficult. Java or C++ would make the transition easier. Again, my advice:
C -> (Java / C++) -> Objective-C (Cocoa)
Second advice: Do not think of this as "well how many books"
You'll be reading tons of books. If you're afraid of reading, stop now and give up programming. Aside from books, you'll spend hours and hours on the web looking at other peoples sources, looking at some school's tutorials, etc. It's LOTS and LOTS of reading....
But don't be intimidated! The reading is the *fun* part.. don't be afraid of it.
Hit me up if you need help with your first steps in C.
conner@68k.org or flux187 on AIM
Good Luck
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Oh boy.
Some way stay away from C++ some say C++. Well at least everybody agrees on starting with C. So start with C I shall!
Two questions:
1. After reading on C is that enough to write an app?
2. Could someone explain what the different langs do?
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Location: London, Ontario
Status:
Offline
|
|
PowerbookDude--
You're about where I was last summer. I've picked up both of the basic Cocoa books. But since I knew nothing about C, I looked at lots of beginners books. The one I bought ($22 at Barnes&Noble) was:
Absolute Beginner's Guide to C (second edition). by Greg Perry
(Sams Publishing)
which has been mentioned by a couple of posters above. The book assumes you have never programmed before and, as such, is almost brutally simple! But that kind of makes it fun. You'll know pretty quickly if you really want to proceed.
The only negative to all basic C books is that they will be written for a sort of "generic" C environment. The two Cocoa books assume that you have installed the Apple Developer environment. It will let you type in some basic C commands that you will find in most books but not all will work in exactly the same way as in ADC. Maybe one of the other posters will have a suggestion about the best way to enter C code in the beginning on a Mac.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by WizOSX:
<STRONG>Absolute Beginner's Guide to C (second edition). by Greg Perry
(Sams Publishing)
It will let you type in some basic C commands that you will find in most books but not all will work in exactly the same way as in ADC. Maybe one of the other posters will have a suggestion about the best way to enter C code in the beginning on a Mac.</STRONG>
So that does that mean I shouldn't get that C book or what?
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
I think what that means is that the book will teach you the C language, but it won't teach you how to use the OS X developer tools. It's not that difficult to use the tools. To start a new C program:
Open Project Builder and select File>New Project...
Select the Standard Tool project type
Under the source folder is the file main.c where you can enter your program.
You can compile and run the program using the buttons in the upper-left corner.
Alternatively, you can enter your code in a text editor save it in your home directory, and compile with the command line. Type
cc <yourcodefile>
to compile, and then
./a.out
to run it.
You're not going to be able to write a GUI app without Cocoa or Carbon, so you're not going to be doing it right away. Have patience!
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Meida, PA USA
Status:
Offline
|
|
try to check some books out at the library first ... might save some time and money
[ 04-06-2002: Message edited by: zorn ]
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by PowerBookDude:
<STRONG>Two questions:
1. After reading on C is that enough to write an app?
2. Could someone explain what the different langs do?</STRONG>
1. Technically, yes. But unless you want to learn the Carbon API (Application Programming Interface), it's pretty much going to have to be a command line app. Actually, most tutorials on C generally have you write an app very near the beginning--one that prints the phrase "Hello, World!" to the command line. It gives you a feel for how the language works.
2. They all do basically the same thing--give you a way of making programs. They're just different ways of going about it.
C is a very basic procedural language--you write a set of instructions, the computer executes them. It can do basically anything the computer can do, but it's a very simple language.
C++ and Objective-C are both object-oriented extensions to the original C language, with different ways of doing things. C++ is a bit more complex than Objective-C in most people's opinions, though they are both perfectly valid ways of programming. Objective-C is the native language of the Cocoa API, which is why that's what you want to learn. C++ is the standard these days, with OS X being the only platform that uses Objective-C as far as I know.
As for what Object-Oriented Programming is...I don't think you're really going to get it completely until you have a feel for what programming in general is like. The basic idea is making the parts of a program be actual entities. Each object has its own properties (e.g. a window has height and width) and things it can do (e.g. a window can close and resize), and it can interact with other objects in the program.
Hopefully that answers your questions well enough.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
Obj-C is available on *nix and Windows, it's just not widely used. Actually, there's a framework called GNUstep that is related to Cocoa, available for those platforms. It uses Obj-C.
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Location: London, Ontario
Status:
Offline
|
|
Orginally posted by JeffBinder
Obj-C is available on *nix and Windows, it's just not widely used. Actually, there's a framework called GNUstep that is related to Cocoa, available for those platforms. It uses Obj-C.
I assmue when you say "is available for" that you must get it from somewhere other than ADC--that its not already included in OS X Unix when you first load OS X. Also, is there a simple, basic C compiler included (not C++ or Obj-C)?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by WizOSX:
<STRONG>I assmue when you say "is available for" that you must get it from somewhere other than ADC--that its not already included in OS X Unix when you first load OS X. Also, is there a simple, basic C compiler included (not C++ or Obj-C)?</STRONG>
GNUstep is not provided by Apple at all. It's a GNU version of NeXTStep/OpenStep, the system OS X is based on. Apple is not involved with it. If you want to try it out (and lack a healthy fear of alpha and beta software), the homepage is here. (I actually am well aware of the GNUstep project, but I didn't want to muddy the waters with a little-used, unfinished set of libraries.)
And as for the compiler, the same one is used for all three languages--it's called cc. Check the compiler section of the Developer Tools documentation for more info on it.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
Sorry for going off topic, but can anyone just briefly explain what procedural programming is (that's what it's called right?). I only have some experience with AppleScript/Cocoa which are both object-oriented and it seems like a logical way of programming. But I've seen some BASIC code and it seems pretty "interesting".
I mean, how would you change the height of a window or a close a window in a procedural language? TIA
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2001
Location: NJ, USA
Status:
Offline
|
|
Here's a question that comes to mind: What would you like the end result to be? Programming as a career, or as a hobby? If you just want to write some OS X apps quickly you could look at Realbasic or even better AppleScript Studio. AS Studio is free from Apple, uses the Applescript language which is easy to learn, and you can create nice OS X GUI apps with it. I'm not saying learning Cocoa is a bad idea, I'm actually working on it myself right now, but I just wanted to throw a couple of options out there in case you just wanted to "fool around" without being too serious. As far as Cocoa books, I started with O'Reilly's, which a lot of people dismiss but I found it somewhat helpful, and I've moved on to "Cocoa Programming for Mac OS X". I do have a background as a C programmer, and the transition to Obj C was quite easy. Either way, don't get too stressed out about it!
Steve W
|
|
Windows SysAdmin by day, OS X maniac by night...
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
Originally posted by WizOSX:
<STRONG>
I assmue when you say "is available for" that you must get it from somewhere other than ADC--that its not already included in OS X Unix when you first load OS X. Also, is there a simple, basic C compiler included (not C++ or Obj-C)?</STRONG>
I'm sorry for the confusion, but Obj-C isn't a program, a compiler or a software package, it's a programming language. There are different compilers available that support it, and one is included with the OS X developer tools. Any Obj-C compiler invariably supports plain C, because Obj-C only adds features to C, and you don't have to use them.
On OS X, the compilers are only included with the developer tools, whereas on most other *nix operating systems, compilers are included in the default install. One of the more popular ones is gcc. gcc can compile C, C++, Obj-C, Obj-C++ (I think), and several other languages.
GCC comes with most *nix systems (not OS X, though), and is also available for Windows. You can get it here: http://gcc.gnu.org/
All this has nothing to do with ADC or Apple, although the cc compiler that the OS X developer tools use is a modified version of gcc (so there's no point in trying to get gcc for OS X). If you're looking for a compiler for OS X, stick with the Apple developer tools.
[ 04-07-2002: Message edited by: Jeff Binder ]
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by swoodnj2:
<STRONG>Here's a question that comes to mind: What would you like the end result to be? Programming as a career, or as a hobby? </STRONG>
I don't know yet.
Luckily a friend of mine who knows OOP is willing to teach me which is good.
Should I still learn C first before OOP?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status:
Offline
|
|
Originally posted by Synotic:
<STRONG>Sorry for going off topic, but can anyone just briefly explain what procedural programming is (that's what it's called right?).</STRONG>
Procedural programming breaks a problem down into procedures: First you do this, then you do that, then you do that. You execute a series of procedures in sequence, and get your result. It's follow-the-flowchart programming.
C and Pascal are examples of procedural languages.
<STRONG>I only have some experience with AppleScript/Cocoa which are both object-oriented and it seems like a logical way of programming. But I've seen some BASIC code and it seems pretty "interesting".
I mean, how would you change the height of a window or a close a window in a procedural language? TIA</STRONG>
You'd have a data structure that represented a window stored in a variable (or pointer), and you'd pass it to a function that resized (or closed) it.
PBD: There's a lot of talk about learning C first, then something else, and then Cocoa. I don't really know why. The Addison-Wesley book mentioned at the top of this thread is very good. Get it, and learn from it. Do all the exercizes. It should teach you what little C you'll need to get going. The truth is that you don't need to know much C to do basic Cocoa programming, and learning C won't help you much with basic Cocoa or Objective-C either. You have to think one way to code in C, and in another way to code in an object-oriented language like Objective C. You'd be better off learning Java and then Cocoa/Objective-C. Avoid C++ if at all possible. It's used a lot in the real world, but it's a bear to learn, and you do need to know C first. It takes a year on average to get comfortable with C, from my experience. It's not an easy or forgiving language.
Since you will probably need a C reference around, the Kernighan and Ritchie book is excellent, as is the FAQ for comp.lang.c.
|
|
James
"I grew up. Then I got better." - Sea Wasp
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by Amorph:
<STRONG>
The Addison-Wesley book mentioned at the top of this thread is very good. Get it, and learn from it. Do all the exercizes. It should teach you what little C you'll need to get going. The truth is that you don't need to know much C to do basic Cocoa programming, and learning C won't help you much with basic Cocoa or Objective-C either. You have to think one way to code in C, and in another way to code in an object-oriented language like Objective C. You'd be better off learning Java and then Cocoa/Objective-C.
</STRONG>
I don't think I want to learn Java at least not right now. I heard Java apps are slow.
Anyway, I think I'll get that book you suggested or this one. then learn Objective-C and then Cocoa.
Now is Objective-C then same as OOP or a flavor of it? if not what is different and better and worse etc?
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
Originally posted by Amorph:
<STRONG>
PBD: There's a lot of talk about learning C first, then something else, and then Cocoa. I don't really know why. The Addison-Wesley book mentioned at the top of this thread is very good. Get it, and learn from it. Do all the exercizes. It should teach you what little C you'll need to get going. The truth is that you don't need to know much C to do basic Cocoa programming, and learning C won't help you much with basic Cocoa or Objective-C either.</STRONG>
You're going to need to learn C first. Perhaps someone with experience in other programming languages could figure it out by themselves, but without any experience at all, you'll be totally lost in Obj-C and Cocoa books. The Obj-C books available now won't teach you how to do basic, essential C things, like declaring variables and flow control. They won't teach you about functions and structures. And believe me, no one can figure out pointers just by looking at example code. All these things are as much a part of Obj-C as they are C, and you'll use them all the time.
Although I agree that in theory it's possible to skip C and start with Obj-C, there's no book available now that you can use to do that. All of the books for Obj-C and Cocoa assume you know C.
As an example, there is the description of Obj-C's #import directive from Learning Cocoa:
Imports a header file. This directive is identical to #include, except that it won't include the same file more than once.
If you have a fair knowledge of C, you'll get this right away. But if you don't, you'll have no idea what #include is, what it does, and how to use it, and therefore you won't understand what #import is. And you're going to need #import all the time.
Now is Objective-C then same as OOP or a flavor of it?
OOP is basically a style of programming language. Obj-C, C++, Java and SmallTalk are all OOP languages. The best way to understand the OOP way of thinking is to learn an OOP language, and write some programs with it. Eventually it'll just 'click'.
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
Originally posted by PowerBookDude:
<STRONG>Alright I finally got a solid plan!
Now the question of which C book?</STRONG>
I would say both, but the first one would be better to start with. The C Programming language is an excellent book, but it doesn't ease you into programming. Actually, it assumes you have experience with another language. It will make a valuable reference later on, though.
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by Jeff Binder:
<STRONG>
I would say both, but the first one would be better to start with. The C Programming language is an excellent book, but it doesn't ease you into programming. Actually, it assumes you have experience with another language. It will make a valuable reference later on, though.</STRONG>
So first get the other book read it then later get the other for a reference? That's cool.
I'll let you know when I order the book.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
I'm about to get Absolute Beginner's Guide to C and I just have one more question.
How many items/examples/chapters etc in the book will have things I can't do in OS X or won't work with OS X? (I'm sorry if I already asked this question)
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status:
Offline
|
|
I'm not familiar with that book, so I can't say.
If it hews to the ANSI standard for C, everything should work.
Everything in The C Programming Language should also work.
Also, keep the FAQ for comp.lang.c (also available, with more material, in book form handy as a reference. It lists a bunch of common gotchas, and how to get around them.
I'll concede the point that you need to know basic C, but that's pretty much all you need. Don't sweat the more advanced stuff until you really need to.
|
|
James
"I grew up. Then I got better." - Sea Wasp
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2002
Location: Rochester, NY
Status:
Offline
|
|
I knew very minimum C and thats it - bought Cocoa Programming for Mac OS X, and now I am an "intermediate" programming of Cocoa. So, you don't really need to start from ground zero with C, then Objective-C, then Cocoa. I just jumped into Cocoa.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Originally posted by CheesePuff:
<STRONG>I knew very minimum C and thats it - bought Cocoa Programming for Mac OS X, and now I am an "intermediate" programming of Cocoa..</STRONG>
But I know zero C.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
What about this new O'Reilly book "Building Cocoa Applications: A Step-by-Step Guide " http://www.oreilly.com/catalog/buildcocoa/ ?
Does this affect the plan in anyway? I mean should I add this book to read and where to the plan?
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by PowerBookDude:
<STRONG>What about this new O'Reilly book "Building Cocoa Applications: A Step-by-Step Guide " http://www.oreilly.com/catalog/buildcocoa/ ?
Does this affect the plan in anyway? I mean should I add this book to read and where to the plan?
Thanks!</STRONG>
This looks like a good book. 30% off at Amazon, 20% off at Barnes & Noble, and not listed at Bookpool. By the time you're comfortable with C, someone will be able to give you a review. Just keep reminding us.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Oct 2000
Status:
Offline
|
|
Just some quick comments on this book:
It seems to have a more comprehensive description of the Developers' Tools than others.
This book uses Objective-C only. It seems to give a good introduction to the language.
A big advantage to this book is that everything is supposed to be current with the 10.1 Developers' Tools. "Cocoa Programming for MacOS" (Hillegass) and "Cocoa Programming (the other O'Reilly book) have some steps that are no longer correct because of interface changes.
To qualify this report, I have not yet had a chance to use the book. I have not yet installed the April Developers' Tools and so have not seen any interface changes which might be present there. And, of course, I have not yet seen the Jaguar tools. If I have time to go through this book, I might as well report on a Jaguar experience, even though the preview is described as "pre-alpha". It might not be soon, though. Finals are coming soon!
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
Here's how I learned:
I learned Apple BASIC as a kid more than 20 years ago and I learned LOGO before that. I learned FORTRAN my first year in college more than 10 years ago.
About 9 months ago I bought C Primer Plus and read the first 10-15 chapters and The O'Reilly book and read it through. I also read Apple's Obj-C stuff. I just got Aaron Hillegass' book about 3 months ago. I struggled on Cocoa until I got the latter. It really made things click. I don't know if it is because it is that much better or because everything just finally came together, but now I'm cooking. I still don't really know what I'm doing, but I have my first 'big' app working. It has drawers, toolbars, timers, notifications, outlineviews, tableviews, and grabs info off the net. I now find myself looking through the Hillegass and O'reilly books almost equally, but hardly ever referring to the C Primer Plus. The Apple docs, www.cocoadev.com, and these forums have been invaluable and I can see that I am leaning on them more as I get better.
Now I think I need a good C algorithms book. Any suggestions? What about a good CS design book?
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Just want to say I just got the book on C today! I didn't start it yet. I hope I can get into this. I want too.
I also need to think of some kind of app to make after I get ok with programming.
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jan 2001
Location: USA
Status:
Offline
|
|
Need some help already.
The book has the code example which just display three lines of text. So how do I make this with the Dev tools? Project Builder right? Do I need a Interface (Builder) right?
So how do I do this?
Here is the code btw:
/*Prints a character and some numbers*/
#include <studio.h>
main( )
{
printf("A letter grade of %c/n" , 'B') ;
printf("A test score of %d/n" , 87) ;
printf("A class average of %. if/n" , 85.9) ;
return 0 ;
}
Thanks!
[ 05-08-2002: Message edited by: PowerBookDude ]
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
Well, you could use Project Builder, or do it by hand.
To use PB, open it up, and choose New Project... from the file menu. Now, select the Standard Tool project type (it might be Standard C tool or something like that, I can't remember). This opens a new project window. On the left side is a list of files in the project. There should be one called 'main.c'. Click on that to edit it, you can enter your code here. To compile and run the program, use the buttons in the upper-left corner of the window.
Or, you can do it by hand. Enter the code in a text file. You could do this with a command-line editor like pico, vi or emacs, or with BBEdit (make sure you choose UNIX style line endings), or you could just use PB. Once you've saved the file, open a terminal window, cd to the directory where you put your file, and type 'cc yourfile'. If you don't get any errors than it worked right. This creates a file called a.out which is your program. To run it, type './a.out'.
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Oct 2000
Status:
Offline
|
|
I wouldn't bother with Project Builder right now.
Or if you want to get used to using Project Builder, I'd open Project Builder, select New Project, go to the end of the menu, and select "Foundation Tool". Open the source menu. If you single click on "main.c", you can type your code in. (See the bottom right hand pane.) If you double click on "main.c", it will open in its own window. (More room to work with.)
You can even use TextEdit for your file. Just make sure you save it as yourfile.c and make sure TextEdit doesn't add an extension (it will ask).
I'd run the project both ways. Since it sounds like you want to use Project Builder now, run your project there, then open the terminal, switch directories to your project, then do as Jeff Binder suggested, proving to yourself that you can run the project both ways.
Sorry, I can't think of an easy way of getting a nice aqua window right now (without using CodeWarrior).
You don't need to worry about Interface Builder until you get one of the next books.
If you are a student, I'd recommend getting an educational copy of CodeWarrior 8 when it comes out at the end of the month. It has a code completion feature. Purists may say that you need to learn about debugging your code for simple spelling mistakes and mistyped words, and that you need to learn how to look in the documentation to learn how to use standard functions. If you are just a hobbyist and want some shortcuts, here's what code completion does. If you type the first letter(s) of a function, you can get a menu of all functions that begin like that. Then, it will tell you what kind of arguments the function is expecting. It will also tell you what variables of that type you have declared.
[ 05-09-2002: Message edited by: skipjack ]
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Bristol, UK, living in Melbourne, Australia
Status:
Offline
|
|
if you wanted an idea for an app, a cocoa version of "Digital Color Meter" that shipped with OS 9 (in the Apple Extras folder) would be nice. There is not a lot to it. I made a hacky version in 10 minutes that I use at the moment, which just uses apple's built in color palette, but the original Digital Color Meter was all in one window and if you could clone that, it would be sweet for me and a useful piece of freeware you could put onto versiontracker.
I don't know if the source to "pixie.app" is available at all, but if so it would probably help to make the digital color meter.
if you make it, or if anyone else decides to, please mail me a copy to david at stain.org
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|