Programming with Developer Tools

Discussion in 'Mac Help/Tips' started by Mr. Anderson, Sep 11, 2002.

  1. Mr. Anderson Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #1
    Ok, so I installed the Developer Tools with OSX.2 and I'm feeling like I should flex my programming geek muscles (use to program in C++ up to about 4-5 years ago).

    But I need to learn how to use the Tools - so what book should I buy that gives me the tutorials and such for this? I'm pretty good with C++, don't know Java (but want to learn), and playing with OpenGL would be fantastic. So there you have it. Someone here should have an answer.

    Thanks,

    D
     
  2. Tiauguinho macrumors 6502a

    Tiauguinho

    Joined:
    Mar 5, 2002
    Location:
    The Netherlands
    #2
    Hey Dukestreet!

    My advice for you is to buy this book: " Cocoa Programming for Mac OS X" from Aaron Hillegass. He was a former NeXT code writer, and he teached many of apple enginners how to build apps for Mac OS X.

    I advise you as well to visit the Apple Developer Connection website for some small tutorials that you can download.

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

    and for the tutorials:

    http://developer.apple.com/macosx/gettingstarted/

    I hope that I was able to help you.

    Take care
     
  3. Mr. Anderson thread starter Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #3
    Well, a little searching around on the developer site at apple pointed me to O'Reilly and they have a ton of books - so I might end up getting those, provided they're OSX.2 - thanks for the links.

    D
     
  4. macktheknife macrumors 6502a

    macktheknife

    Joined:
    Jan 24, 2002
    #4
    You know, I was thinking the same thing . . .

    I too was interested in tinkering with Apple's Developers Tools to do some basic programming. I am trying to learn a new languages, and I was interested in knowing how to actually use apps like Project Builder to compile and run certain codes I have written. Thanks.
     
  5. Mr. Anderson thread starter Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #5
    The O'Reilly book on Cocoa had examples and was using the project builder and other dev aps. One thing I don't like is downloading pdfs and using them for reference. Having a book is so much better, I'm not sure if its a psychological thing, but a bunch of papers just doesn't do it for me - even if I hole punch them and put them in a binder.

    Now its just a matter of time till they're updated for Jaguar.

    D
     
  6. macktheknife macrumors 6502a

    macktheknife

    Joined:
    Jan 24, 2002
    #6
    Oh, one more thing for you, Dukestreet. If you want a Java compiler, you should check out JBuilder 7.0 Personal Edition from Borland. I'm going to learn Java too so while I can't comment on how good the program actually is, I can say that it does look pretty nifty for something that is free.

    BTW, I'm a big O'Reilly's fan too. I've got O'Reilly books on HTML, Web Design, JavaScript, and Perl. I love them all, and I plan to get "Learning Java" next.
     
  7. szark macrumors 68030

    szark

    Joined:
    May 14, 2002
    Location:
    Arid-Zone-A
    #7
    JBuilder is a very good IDE for Java if you want to do cross-platform Java development. I learned Java using JBuilder.

    If you want to use the Cocoa frameworks from Java, though, I'd say stick with Project Builder/Interface Builder.

    I just bought the O'Reilly "Learning Cocoa" book yesterday, trying to get familiar with programming for Mac OS X.

    I seem to remember that there were documentation and examples in the Developer Tools subfolders somewhere, but I never looked at them in detail so I'm not sure if they would help. I'm at work (Win95 - blech) so I can't verify.
     
  8. macktheknife macrumors 6502a

    macktheknife

    Joined:
    Jan 24, 2002
    #8
    Question for szark (or anyone else)

    What if I want to compile in C or C++? Do I just go to Project Builder? If so, what do I do exactly? Also, would you happen to know how to compile in Perl using something other than Terminal? Thanks.
     
  9. cubist macrumors 68020

    Joined:
    Jul 4, 2002
    Location:
    Muncie, Indiana
    #9
    compiling c in mac os x

    You don't have to use PB for command-line compiling.
    You can do (in terminal, of course):
    cc -o hello.c
    ./hello

    However, I have not yet figured out how to make an Aqua program using the command line tools. I know it is the same compiler (GCC 3); however, Aqua applications are actually subdirectories (folders) containing a bunch of files and so on, rather than single files as they were in Classic.

    As a unix programmer, I want to write a makefile which completely controls the application build. I don't like IDEs with their options hidden fifteen levels deep and their undocumented proprietary binary "project files".

    I realize that most Mac programmers come from Think C or MPW and have never had command lines, so they're comfortable with project files. But the programming community at large has a great deal of experience with make. A makefile is more than a project file: it is also a source file and a document. Further, makefiles can be nested for large, multiple-programmer projects. IDEs such as PB are generally single-programmer systems.

    I have no interest in hearing about the virtues of IDEs. I seek a way to use make. Anyone have any ideas? I have already looked through apple.com/developer and found some somewhat applicable notes, but thus far have not been able to get the procedures described to work.
     
  10. Mr. Anderson thread starter Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #10
    Re: compiling c in mac os x

    I come from a Unix C/C++ programming environment as well - make files are what I'm most familliar with. If you find out how to use make, let me know.

    D
     
  11. Solipsys macrumors member

    Joined:
    Jul 10, 2001
    #11
    Re: Programming with Developer Tools

    If OpenGL programming is something that interests you, definitely pick up the "OpenGL Red Book"... You can find the whole book online or buy the book at amazon or something. I know you're a 3D artist so I bet you'd pick up OpenGL programming extremely fast since you're already familiar with all the paradigms. If you want to jump right in I'd also suggest ignoring Objective C (cocoa) for right now and sticking with your C++ knowledge because...

    1 -You'll find a ton of online tutorials/resources on OpenGL programming in C/C++ as opposed to very few (near zero) for Objective C.

    2 - Apple's OpenGL SDK is almost all C

    3 - You'll have fun a lot faster ;)

    Joining Apple's OpenGL list might also be helpful to you... Or just searching the archives for answers.
     
  12. szark macrumors 68030

    szark

    Joined:
    May 14, 2002
    Location:
    Arid-Zone-A
    #12
    Re: Question for szark (or anyone else)

    Unfortunately, I am just getting into programming for OS X, and don't really have much knowledge on Project Builder. I played around with it for a day or two last year and got some simple C programs compiled, but I don't remember much.

    I know there are some Perl IDEs out there, but have never used any of them.
     
  13. kperry8 macrumors newbie

    Joined:
    Apr 4, 2002
    #13
    PB Goodness

    OK... some things that haven't been mentioned about the awesome developer tools.

    1. You can build Java apps that aren't used with Cocoa in Project Builder! Select a Java Tool, or similar template from the "New Project" dialog. If you want to use swing or AWT, or make an Applet, choose a different one. Project Builder will compile the code into the cross-platform Java bytecode, which will be placed in the build folder of the project in ClassName.class. The bytecode can be translated into machine code for any computer with the utilities, or run by any interpreter on any computer. That's the point of Java, isn't it? So why use (the rather slow on my laptop) JBuilder for Java programming?

    2. You can do pretty much all your non-GUI CS assignments in almost any main programming language, be it C, C++, Java (or Objective C, but if your college teaches Objective C, tell me so I can go there!). For a C++ text-only project, make a "C++ Tool", for C choose a "Standard Tool" and for Java, a "Java Tool", like I said above.

    PB's absolutely great! I've used PB for several classes already and it works flawlessly! (Except for when I get to the classes where they teach you binary and assembly programming.. I'll have to use my emulator for that)

    Good luck!

    And please learn Objective-C and Cocoa, or at least the Carbon frameworks, and contribute to OSX advancement!

    [EDIT]
    Oh yeah.. some other things. To people who say to use cc in the Terminal, I say, Why? PB is just a front-end to gcc3, so it's the same thing, and PB will manage all your files, compile with the click of a button, and run it just as easily.

    As for compiling Perl without the terminal, I'm not aware of a front end's own compiler for Perl, but BBEdit (the full version, demo available) has a "front-end" of a sort for the Terminal perl program. I suggest you check that out for Perl.
    [/EDIT]
     
  14. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #14
    The Learning Cocoa book is good but there's a problem. Since the book was published, the tools changed (particularly Interface Builder) and they don't match what they indicate. I believe this is also a problem in Learning Carbon but that one also has some text out of sequence. The Aaron Hillegass book is great. Dan Parks Sydow has a book on Carbon programming--he's been writing books for Mac OS programming for a while, especially for CodeWarrior.

    It's not difficult to use make for traditional command line type UNIX programmes but there doesn't seem to be a way to batch the bundling process in a makefile.

    I was working on a programme to read makefiles and turn them into CodeWarrior projects (which are coded in XML) which then could be converted by Project Builder but going the other way doesn't seem to be an option except with the CW tools.
     
  15. cubist macrumors 68020

    Joined:
    Jul 4, 2002
    Location:
    Muncie, Indiana
    #15
    PB is not the same as Terminal.

    Using PB is not the same as using cc in terminal AT ALL. PB requires you to create a project, which creates a binary project file, subdirectory structure, etc., etc. It is a full-function IDE.

    For compiling Java apps, you can use javac on the command line. For example: javac x.java

    For that matter, if you use the Swing API, you can create jar files which execute from terminal or can be double-clicked in Finder! And they have the Aqua look to them, too, and they perform very adequately! There is no problem at all using make to build Java applications with GUI interfaces. I would maintain the only problem with using it to build C applications with GUI interfaces is poor documentation. Rest assured, there is a way to do it. We only need to figure it out.

    BTW, what I said about IDEs is not exactly correct WRT MPW. It's sort of an IDE, but it's also sort of a command line tool too, and it does use near-standard makefiles. Unfortunately it does not appear possible to build Carbon apps with MPW.
     
  16. PrettyMan macrumors member

    Joined:
    Jul 19, 2002
    Location:
    Oyeregui, Spain
    #16
    Anoher Java alternative...

    And NetBeans is another pure 100% JAVA IDE, with everything you can need to develop in JAVA.

    I've used it last year in my G4 450 DP and it runs fine.

    Ciao.:)
     

Share This Page