PDA

View Full Version : How can I start programming in Mac?




chrislee8
Jul 27, 2004, 04:18 PM
I have OS X 10.2.8(jaguar).

I heard of XCode, but it is for 10.3 Panther and higher.

What do programming do with Mac?

How do I start programming in my Mac? Any tutorial to create a windows just says 'hello world' then go from there?

so little resources, no wonder Windows is dominating. why don't all Mac techie, act up, do something, if you guys hate windows that much.

so far, all i heard and saw was blasting windows, but look at windows users, really sharing their programming knowledge, tutorial on everything everywhere.

Maybe what i said is too harsh to accept. Truth hurt? hopefully u understand what i m trying to say.


:)



chrislee8
Jul 27, 2004, 04:21 PM
frustration has been expressed a little above, now I still need to back to my questions if you guys still think i am worth to help a little.

say I want to learn c/C++, what editor, compiler are available in Mac to use, i would rather use free/low cost software because a student can't afford to buy much software, but eager to learn.

peace.

I don't like windows that much too. just in case u think i am a Mac hater and Windows lover.

:P

jsw
Jul 27, 2004, 04:28 PM
Hey, relax, we don't think you're a troll.

I didn't even start looking into Mac developpment until I got Panther, so I'm not sure what's out there for Jaguar. My opinion: Panther - especially if you can get the edu price - is well worth it for the developer tools.

For C/C++, you can use the built-in compiler (http://developer.apple.com/tools/gcc_overview.html).

Also, Java is available. Preinstalled on Panther, I can't remember what the deal with Jaguar is - I think it's more of a hassle there.

Also, of course, there's UNIX scripting and AppleScript, both built-in.

Honestly, if at all possible, I'd move to Panther and get the wonderful development tools that come with it, as well as the Java 1.4 environment.

Presumably, most of this is available to the programmer under Jaguar as well; I just don't have a 10.2 system to verify it.

King Cobra
Jul 27, 2004, 04:32 PM
Well, JGrasp (http://www.eng.auburn.edu/department/cse/research/grasp) allows you to compile and run Java, C++, C, Objective-C, etc. I recommend JGrasp way the hell over Xcode, because Xcode requires projects, target files, etc., so it's way too complicated for beginner programmer usage. JGrasp seems to run on Jaguar better than on Panther anyways.

jsw
Jul 27, 2004, 04:33 PM
Plus, you could go to:

http://www.macdevcenter.com
http://developer.apple.com

and others.

Again, it's all going to be much easier with Panther. If you seriously want to get into Mac development, get Panther just for Xcode.

jsw
Jul 27, 2004, 04:35 PM
Well, JGrasp (http://www.eng.auburn.edu/department/cse/research/grasp) allows you to compile and run Java, C++, C, Objective-C, etc. I recommend JGrasp way the hell over Xcode, because Xcode requires projects, target files, etc., so it's way too complicated for beginner programmer usage. JGrasp seems to run on Jaguar better than on Panther anyways.

Good point! I'd forgotten about this after briefly looking into it. I still think Xcode is probably better for Mac-specific developement, but jGRASP is a cool tool, runs on Jaguar, and does what chrislee8 wants.

Les Kern
Jul 27, 2004, 04:37 PM
If you want simple programming, look at RealBasic.

jsw
Jul 27, 2004, 04:40 PM
so little resources, no wonder Windows is dominating.

As we all know, Apple includes a great development suite free with each copy of Panther. They include Java. They include Apache. They include GNU tools.

So... there are a lot of resources.

Also, for Java - should you want to learn it - look into Eclipse (http://www.eclipse.org/).

bousozoku
Jul 27, 2004, 05:07 PM
Jaguar includes developer tools available from Apple. If your machine was pre-loaded with 10.2, there should be a Installs folder within the Applications folder on your machine. If you bought a retail version of Jaguar, those tools are on the Mac OS X Developer Tools CD-ROM.

Xcode replaces ProjectBuilder, which comes from the NeXTStep developer tools. InterfaceBuilder is similar for both.

While the tools aren't perfect, they're substantial and work reasonably well.

There aren't as many resources for Mac OS X development, but they are capable. Besides the O'Reilly and Apple Developer websites already mentioned, MacTech is a developer's magazine focused on Macintosh development.

abhishekit
Jul 27, 2004, 05:25 PM
If you are looking to program in Java, netbeans is also a very good IDE. It contains everything you will need for core Java, J2EE, and even J2ME. I still don't use XCode because it takes too much time indexing files.

MacFan26
Jul 27, 2004, 05:59 PM
If you are looking to program in Java, netbeans is also a very good IDE. It contains everything you will need for core Java, J2EE, and even J2ME. I still don't use XCode because it takes too much time indexing files.

I second NetBeans for Java, I've found it to be the IDE that is easiest to use. There are a lot of tutorials and help if you just to a search for it. Mac programmers are just as or more willing to share as Windows programmers :)

BillClinton
Jul 27, 2004, 07:13 PM
Are there any online tutorials that will help me start programming? My High School only offers classes involving Visual Basics, and I don't want to be that closed off (only works on Microsoft stuff only, right?) What's a good language to start out with? I'd love to be able to program well someday. Thanks in advanced for any replies.

King Cobra
Jul 27, 2004, 10:26 PM
Learn Java. Java is the new "big thing." All the robots are going from C++ to Java, I heard. Though, for a first programming language, it's tough. It was one of my toughest college classes so far (2nd hardest out of 10, the 1st being College Writing), though I did well above average compared to the rest of the class. What I've found is: If you're going to learn Java at college (recommended), make sure you have both an excellent professor, an excellent programing book, and a lot of free time and patience on your hands for debugging your programs.

Here's what my university did for COS 160 Intro. Java:
The course page (http://www.cs.usm.maine.edu/~welty/cos160/160fall2003/)
Assignments (http://www.cs.usm.maine.edu/~welty/cos160/160spring2004/160ReadAssSpring2004.html) Every program from the text book (http://www.cs.usm.maine.edu/~welty/cos160/LewisLoftus3rd/) <-- some .java files in the same chapters are scattered about

I recommend that you especially save the 3rd link and play around with the .java files in JGrasp to get used to JGrasp, then play around with the files themselves, to get a huge jump on some of the basics of Java.

chrislee8
Jul 27, 2004, 10:40 PM
thanks, cobra.

as far as which language to learn, i have made up my mind. c++

this is not my first programming language. i am a developer on asp/asp.net vb/c# etc.

i also played with VC++ with PRMan, Raytracing. It is my hobby.

But I want to go lower level and plus i want to get to know Mac/Linux. And found out it isn't that easy to do programming in Mac. I bought my Mac not one week yet. I am almost regret. hopefully i will hold on.

I also thinking installing Gentoo on Ti PB G4. so I can do my raytracing programming in C++ in linux. hopefully that will work out. If not, i go back to my VC++, so much tutorials, resources that I can learn from on the 'net.

SIGHHHHHHHHHHHHHHHHHH

jsw
Jul 27, 2004, 10:41 PM
I think that, as a language, Java isn't any harder to learn that C or C++. However, Java comes with a huge library of classes. That's what makes it so great - most of what you need has already been written. And that's what makes it hard - there are so many classes to know about.

However, you can learn the classes as you need them. Java is a wonderful language, and the nicest thing is that porting from one platform to another is relatively painless. Not 100% painless, but not too bad at all.

Objective-C, though, is something to know if you want to write Mac-only apps. I'm just starting to dig into it. My Java background is quite extensive, and, years ago, so was my C++. Objective-C is something new, and I'm excited to learn it.

jsw
Jul 27, 2004, 10:42 PM
as far as which language to learn, i have made up my mind. c++

Hey, it's a cool language with a vast library of its own. Have fun!

chrislee8
Jul 27, 2004, 10:47 PM
oh, thanks for everyone's inputs.

If i get Panther now, Tiger is coming out like when, very soon, then what if there is XCode next version only work with Tiger? THen i am fu*K again.

that will lead me back to Microsoft's world of endless upgrading. then what makes Mac better than MS? (in this aspect, obvisouly)

i m not offending mac users, just telling what i think.

i will goto B&N to find out what book to start off a hello world program in Mac.
in jaguar. I didn't find one tutorial off the 'net, dude!!! i m so pissed.

chrislee8
Jul 27, 2004, 10:48 PM
thanks jsw, u been great.

so u just started, so tell me how u start, what to learn from? u just uses Xcode? what have u written(learned) so far?

bousozoku
Jul 28, 2004, 12:17 AM
oh, thanks for everyone's inputs.

If i get Panther now, Tiger is coming out like when, very soon, then what if there is XCode next version only work with Tiger? THen i am fu*K again.

that will lead me back to Microsoft's world of endless upgrading. then what makes Mac better than MS? (in this aspect, obvisouly)

i m not offending mac users, just telling what i think.

i will goto B&N to find out what book to start off a hello world program in Mac.
in jaguar. I didn't find one tutorial off the 'net, dude!!! i m so pissed.

You should probably look for the O'Reilly Learning Carbon book. It's not about C++ but the other books are almost all about Objective-C and, while it's probably a better choice, you've chosen C++. It's easy to wrap Carbon code in C++.

Java is probably the best language on Mac OS X simply because it has better documentation than anything else available. I would say that I spent a lot of time doing research to implement something in Java, but with Objective-C, I spend too much time searching for answers that are only in the back of someone's mind. Once you know what APIs/classes to use, Objective-C is probably the fastest of all languages to implement nearly bug-free code.

Did you check the Apple developer site? There are various tutorials available. The developer tools include many examples, as well.

KeithsPuma
Jul 28, 2004, 01:49 AM
At work I maily program in Delphi ( Pascal ) on THAT Windows platform.
I Don't suppose there's any decent Pascal for the MAC ?
Keith

Nermal
Jul 28, 2004, 01:53 AM
There used be an Apple Pascal, it was for System 6 and earlier if I remember correctly - I think System 7 switched the recommended language to C++.

FredAkbar
Jul 28, 2004, 01:59 AM
Eww, Carbon...;)

First, to answer some of chrislee's latest questions:

Tiger is coming out in the first half of 2005. It will feature Xcode 2.0...I'm not sure if that will work in Panther, but even if it doesn't, Xcode 1 or 1.5 (which we have now, I'm not sure what the version number is) will suit you just fine (unless you use some third-party program like others here have been suggesting). I would say yes, go ahead and buy Panther now, as long as you don't mind paying $129 ($69 educational) now and then that same amount in, say, 9 months, or whenever you want to upgrade to Tiger. In my experience, it's generally a good idea to upgrade to the next OS X version when (or soon after) it comes out. If you stay "behind the times," you will miss out on some new programs, features, etc.

Personally, I like this better than how it is with MS and Windows. Windows will have gone at least 5 or 6 years (2001 to whenever Longhorn comes out) without a single upgrade, besides SP1 and stuff, but that isn't too major. I like being able to get new features and speed every year or 2 with Mac OS X.

I've got a couple questions of my own for you guys:

I'm interested in learning Java. I wouldn't mind (and would prefer, actually) buying a book on it (I learned C, Objective C, and Cocoa all from actual books). Does anyone have any suggestions for a good book on Java? I have experience with traditional languages (BASIC, C), object-oriented programming (Obj-C), and specific libraries of classes (Cocoa). It seems like Java/JavaScript is kind of a combination of all three of these types of things...am I right?

Also, I'm learning JavaScript right now from an online tutorial. Will knowing JavaScript make it any easier to learn Java? I can tell that the syntax is sort of the same, at least for some things (like to have an object perform a method you write objectName.methodName()...similar to Objective C, where you write [objectName methodName]). Other than the object-oriented style, the JavaScript syntax seems almost identical to C. Is Java like that too? How different are Java and JavaScript?

angelneo
Jul 28, 2004, 02:40 AM
Eww, Carbon...;)
I'm interested in learning Java. I wouldn't mind (and would prefer, actually) buying a book on it (I learned C, Objective C, and Cocoa all from actual books). Does anyone have any suggestions for a good book on Java? I have experience with traditional languages (BASIC, C), object-oriented programming (Obj-C), and specific libraries of classes (Cocoa). It seems like Java/JavaScript is kind of a combination of all three of these types of things...am I right?

Also, I'm learning JavaScript right now from an online tutorial. Will knowing JavaScript make it any easier to learn Java? I can tell that the syntax is sort of the same, at least for some things (like to have an object perform a method you write objectName.methodName()...similar to Objective C, where you write [objectName methodName]). Other than the object-oriented style, the JavaScript syntax seems almost identical to C. Is Java like that too? How different are Java and JavaScript?

Java and Javascript are 2 totally different items. Javascript is used to be called LifeScript. Although both might have similarities as with all object oriented programming, I don't think learning Javascript will help in Java as compared to learning other OOP.

hansen
Jul 28, 2004, 03:29 AM
Learn Java. Java is the new "big thing." All the robots are going from C++ to Java, I heard. Though, for a first programming language, it's tough.

I don't understand why you think Java is harder than C++. The two languages are very similar, but Java takes care of one of the biggest hazzles in programming: memory management. Also you don't have to worry about pointers, references, pointers to pointers and what do I know. These are the things that beginners and experienced programmers error in the most.

I would go with Java as the first language if the choice is between C++ and Java and I wouldn't want to learn C++ at all if I didn't had to.

bousozoku
Jul 28, 2004, 09:28 AM
I don't understand why you think Java is harder than C++. The two languages are very similar, but Java takes care of one of the biggest hazzles in programming: memory management. Also you don't have to worry about pointers, references, pointers to pointers and what do I know. These are the things that beginners and experienced programmers error in the most.

I would go with Java as the first language if the choice is between C++ and Java and I wouldn't want to learn C++ at all if I didn't had to.

I agree with you, mostly. For most programming Java is simpler, but you may still deal with pointers in its shielded way. The good thing is that you don't have to de-allocate them, though.

It's when things get complicated that C++ gets ugly and they're working at adding many C++ features like templates to give it that level of complexity.

FredAkbar:

While Java (Oak, Green) and JavaScript (CoolScript) have some similarities, they're not similar enough except in general source structure that you'll gain anything from your knowledge in one or the other.

Bruce Eckel's Thinking in Java is excellent, as are the other books in the series. You'd probably learn a lot from Learning Java from O'Reilly. I've got more than a dozen books on Java, including many from Sun and find very few to be truly useful or clear. My Java in a Nutshell from O'Reilly is my most-handled book on the subject but it might not be suitable for newer programmers.

hansen
Jul 28, 2004, 09:34 AM
But for a beginners language neither C++ or Java seems to be good choices. Most beginners want to see some action: Windows, fonts, colors, boxes etc. I haven't seen anything that competes with Microsoft Visual Basic on this. It's so fast to learn to do some stuff for fun.

Iff you wan't to do more serious programming however, VB is not such a good choice. When the project gets bigger VB is a mess, in my opinion.

I once worked on a project that developed the business tier in C++ and GUI in VB. That worked out great. It would be great if there were such a thing for Java. I haven't worked with Eclipse so I don't know if that is an option. It tried Forte, but didn't liked it. I found it complicated and bloated

bousozoku
Jul 28, 2004, 10:22 AM
But for a beginners language neither C++ or Java seems to be good choices. Most beginners want to see some action: Windows, fonts, colors, boxes etc. I haven't seen anything that competes with Microsoft Visual Basic on this. It's so fast to learn to do some stuff for fun.

Iff you wan't to do more serious programming however, VB is not such a good choice. When the project gets bigger VB is a mess, in my opinion.

I once worked on a project that developed the business tier in C++ and GUI in VB. That worked out great. It would be great if there were such a thing for Java. I haven't worked with Eclipse so I don't know if that is an option. It tried Forte, but didn't liked it. I found it complicated and bloated

I know what you mean. REALbasic is extremely similar in that you can drag and drop your way to a real application. It has all the problems and bloat of BASIC, so it's not a good choice for programming but you see results quickly.

When I did a lot of Windows development, I used C++ for the backend and ObjectPascal (Delphi) for the frontend.

Borland's JBuilder is the closest thing but there is something else for Java: NetBeans. It's confusing to me but I use it for creating dialog boxes. It's strange that I have so many tools for Java and yet, I can exist with only one for C, C++, Objective-C and more. By 2116, I hope that things have settled a little. Eclipse is everything you want for huge project development. Forté was a pain and it was put away. NetBeans (also from Sun) will go away shortly in order to promote their new development environment.

MacFan26
Jul 28, 2004, 02:59 PM
NetBeans (also from Sun) will go away shortly in order to promote their new development environment.

What's their new development environment going to be? I've heard they're releasing an update to NetBeans in 'late summer,' but I don't really know if that is happening or not.

Shaun.P
Jul 28, 2004, 03:17 PM
Hello everybody,

I'm 17 years old. I have Mac OS X (Panther), a G3 CRT 600 MHZ iMac with 640 MB of RAM.

I really want to learn how to program, however I don't know where to start. I'm from Scotland and as part of my Standard Grade and Higher in Computing Studies, we had to use a programming language. The one we used was called COMAL. I don't think it's very popular so you may not have heard of it. I want to learn how to program on my Mac, but I really don't have ANY idea where to start! Any help would be appreciated!

As part of the Higher Computing course, I studied the Software Development process where we studied (in some depth) Analysis, Design, Implementation, Testing, Documentation, Evaluation and Maintenance (ADITDEM).

Any help would be appreciated. I really don't want to spend any money. I have all my developer tools for Mac OS X, however they are uninstalled and I don't know if you have to be advanced to use them. Any help would be greatly appreciated.

Thank you.

FredAkbar
Jul 29, 2004, 02:05 AM
FearFactor47:

I'm not sure how far you'll get if you "don't want to spend any money." At least in my experience, for major programming languages it's worth it to buy your own copy of a book, as opposed to trying to learn with just online tutorials. Now, if you can't afford to spend much money on stuff like that, then that's another matter, and I can understand that if that's the case.

Go ahead and install Xcode (the Panther dev tools) if you're interested in Mac programming. One thing that you can do right away is, once you install the dev tools, look in /Developer/Documentation/Cocoa/Conceptual/Objective C/ObjC.pdf. This pdf file is actually an entire 200+ page book on Objective C. It's how I learned Objective C. I didn't even read the whole thing, actually.

Once you know Objective C and are familiar with object-oriented programming (you will be somewhat, once you learn Objective C), it will be much easier to look at online tutorials for things like Cocoa. I'm not sure if you want to make specific Mac-only programs, or if you want to develop for Windows as well. If you want to develop good Mac OS X programs, use Cocoa (or Java, though I don't know much about that language, as you can tell from my earlier post asking about it). Apple has some decent free documentation online at http://developer.apple.com/ go there and scroll down a bit, you'll see a bunch of documentation pages, like links to http://developer.apple.com/cocoa and so on. If you do decide to buy a book on Cocoa, I would recommend Cocoa Programming for Mac OS X, 2nd edition by Aaron Hillegass. I bought it, and used it to learn Cocoa.

In summary, there are online tutorials and things out there, but at least look at that pdf I mentioned, as it's basically a free book on Objective C, which you need to know in order to use things like Cocoa, and it also (I'm sure) would help you to learn other languages like Java or C++, since Obj-C, like those 2 languages, is object-oriented (which takes some getting used to, if you're used to more traditional languages like C).

bousozoku
Jul 29, 2004, 02:07 AM
What's their new development environment going to be? I've heard they're releasing an update to NetBeans in 'late summer,' but I don't really know if that is happening or not.

NetBeans version 4.0 is around the corner supposedly but there is something else to outdo everything else Sun has and it's called, I believe, Sun One Studio. If I'd heard correctly, it should use both Java and Mono to support development of .NET applications and services.

FredAkbar
Jul 29, 2004, 02:08 AM
Thanks for the info guys :) and to bousozoku for the book recommendations as well.

Colonel Panik
Jul 29, 2004, 03:54 AM
Two recommendations:
Become an Apple Developer member (developer.apple.com) (http://developer.apple.com). It's free to join, and there are dozens of mailing lists where folks will be willing to help you get started.
Secondly, become an O'Reilly Safari member. For $10 a month you get an option of 5 books that you can read through. It's a lot cheaper than buying them and it's quicker than having to go to the local store for them.

Palad1
Jul 29, 2004, 03:55 AM
Bruce Eckel's Thinking in Java is excellent, as are the other books in the series. You'd probably learn a lot from Learning Java from O'Reilly. I've got more than a dozen books on Java, including many from Sun and find very few to be truly useful or clear. My Java in a Nutshell from O'Reilly is my most-handled book on the subject but it might not be suitable for newer programmers.

I second that.

Bruce Eickel's thinking in java is a required reading, it truly is a gem. Plus, the electronic version is free so you can even google it!

Bruce rocks!

iNetwork
Jul 29, 2004, 07:22 AM
As we all know, Apple includes a great development suite free with each copy of Panther. They include Java. They include Apache. They include GNU tools.

So... there are a lot of resources.

Also, for Java - should you want to learn it - look into Eclipse (http://www.eclipse.org/).
So does Linux... May I remind you that programming is merely text that is compiled into machine language. Microsoft has introduced their drag-n-drop style programming which has helped the OS to proliferate. They have also been using API's which are basically "hooks" to microsoft owned code to bring up your dialog boxes, etc, so you don't have to program them from scratch yourself... Pico is my "code editor" along with a couple of good C/C++ and various other books...


May I also remind you that linux has been shipping with these tools far before OsX ever came to be!

To hell with Microsoft, not PC's...

whooleytoo
Jul 29, 2004, 09:32 AM
Surely, one of the best (if not the best) Cocoa book out there: Cocoa Programming for MacOS X (http://www.amazon.com/exec/obidos/tg/detail/-/0321213149/qid=1091110965/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-6054280-5724847?v=glance&s=books&n=507846).

Although it refers to Xcode, it still isn't that different to Project Builder if you're running 10.2.8.

Some great online resources:
Mac Dev Center (http://www.macdevcenter.com)
Cocoa Dev Central (http://www.cocoadevcentral.com)

Also, the Usenet newsgroups are incredibly useful if you're trying to fix a problem. Try any of the comp.sys.mac.programmer groups. (Do a search on groups.google.com if you don't have a Usenet reader).

My advice: learn C if you don't already know it, then Objective C (it's not that much of a jump).

Then pick one feature you'd like to implement (such as a drawer, or a sheet, or a table view, or an open/save dialog etc), and using the sample code and the tutorials available on those sites, write a program to implement just that one feature. Then move onto the next one.

Once you've done these, you should then have the skills to implement any ideas you might have for your program.

Feel free to ask questions here too, if you have any specific queries or bugs.

Good luck!