 |
 |
New Developer
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2004
Status:
Offline
|
|
Can anyone reccommend any good books that can teach an extreme beginner how to make apps. I know a lot about computers but am clueless about programming. Please let me know if you guys know any books or whatever.
Thanks
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2003
Location: Atlanta, GA
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
You might want to check out cocoa.mamasam.com as well.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
I would recommend Programming in Objective-C by Stephen g. Kochan, it teaches you all the basic of Objective-C and programming without assuming anything, and it does not throw you head first into Project Builder and XCode which will only confuse you.
Also Cocoa is not a programming language it is a marketing term for two frameworks that Apple users can access. That is language independent.
Then move into Cocoa Programming for Mac OS X by Aaron Hillegass after you find your feet.
Tips learn Object Orientated Programming first
Then learn Programming concepts
Then choose a language Objective-C, Java, C++, C#, or C
Then you will be a programmer.
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Oct 2003
Status:
Offline
|
|
Brandon, to make an app, you create a text file (a "source code" file), type a bunch of programming language commands in it, save it, then use some other program to transform ("compile") it into a binary executable (by translating your commands into native machine language). Then you run the binary you just created. As a beginner, you should learn to do all of this from the Terminal app (Finder-->Applications-->Utilities-->Terminal). The commands you'll need to use are very simple, so don't get scared off. Down the road, you might then have a look at using an IDE like Xcode/Eclipse/NetBeans/etc., but not now while you're learning the basics. I use jEdit to edit my source code files.
Sometimes those last two steps (compiling and running) are just one step, depending on the programming language you use.
You can write your programs in C, C++, Objective-C, Java, and possibly others (Python comes to mind).
Lots of folks here use Objective-C, since that's an easy way to make Mac OS X and GNUstep programs. I personally prefer Java compiled with GCJ.
If you want to use Objective-C, you need to learn C first. There's lots of good C books out there. I learned from Kelley & Pohl's "A book on C". This one http://www.oreilly.com/catalog/pcp3/ looks pretty good too. After you learn C, the Hillegass book is nice for learning Objective-C and a healthy amount of Cocoa (Cocoa is a bunch of already compiled source code which you can make use of programmatically from within your programs. It handles all the Mac OS X -related stuff for you).
For Java, I recommend Core Java2 Volume 1 - Fundamentals, by Horstmann and Cornell, although Flanagan's Nutshell book is pretty good too and also serves as a nice reference.
For Python, the Learning Python book is good, but note that you might have a rough time getting Tkinter installed and working on OS X (dunno).
What sort of software do you want to write?
(Last edited by johnMG; Jun 29, 2004 at 07:52 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2004
Status:
Offline
|
|
Would learning C and then Objective-C be the best route? Whats the advantage of that over java or something.
Also, I have no idea what kind of software I want to write. Not like games or anything, but I'm not sure what yet.
When you were saying to do terminal, what do I do there? You were saying the commands are pretty easy but what do I even do?
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Feb 2003
Status:
Offline
|
|
Do not learn C then Objective-C -Programming in C will teach you things you will not know and some bad habits in regards to procedural and oop programming.
As for what language their no real best only best language for certain contexts.
Mac OS X GNULinux desktop + service applications == Objective-C
Cross Platform and web + service applications == Java
PHP, JSP, Perls, Phyton, Ruby == mostly web stuff and some OS scripting
If it is only for the Mac and for personal pleasure and use I would go with Objective-C. Java is a poor cousin on any platform does allot but is not brilliant at any of them.
The rest is a mixed bag
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Oct 2003
Status:
Offline
|
|
Would learning C and then Objective-C be the best route? Whats the advantage of that over java or something.
C is good for writing compilers, device drivers, & virtual machines. Those sorts of low-level, pedal-to-the-metal, squeeze out every last computing cycle type programs. It's somewhat difficult to learn.
Objective-C is some "object oriented" features bolted onto C. Once you know C, it's easy to learn Objective-C (since it's only a few more features). The big win with using Objective-C (I hear) is that you get to make use of Cocoa, which is supposed to be pretty nice.
Java is very much a kinder gentler C, with nice object oriented features (which you don't need to worry about at this point). I recommend you use Java. It is very easy to learn and will teach you good programming habits right from the beginning. It is also very nicely supported by Mac OS X.
Also, I have no idea what kind of software I want to write. Not like games or anything, but I'm not sure what yet.
Ok. All the more reason to start out with an easy and general language like Java.
When you were saying to do terminal, what do I do there? You were saying the commands are pretty easy but what do I even do?
Ah. Ok.
From the terminal, type:
and it should say "/Users/foo" where foo is your username. If it doesn't say that, type
and it'll bring you to "/Users/foo". Then create a directory to put your source code into:
and change your "current directory" to that new directory
From now on, whenever you want to do some programming, you don't need to run the mkdir command again -- just open the terminal and "cd temp_dev" and you're good to go.
Now, open up TextEdit. Copy/paste the following text into it and save the file
into your temp_dev directory, naming the file Foo.java
Code:
// Silly program to compute a power series
// sum: 1/(x^i) for i = 1, 2, 3, ... NUM_TERMS
public class Foo
{
public static final int NUM_TERMS = 5;
public static void main( String[] args )
{
if ( args.length != 1 )
{
System.out.println( "Please pass exactly one arg, a real number." );
return; // Causes main() to return, hence the program ends.
}
double d = Double.parseDouble( args[0] );
double sum = 0.0;
for ( int i = 1; i <= NUM_TERMS; ++i )
{
sum += 1.0 / ( Math.pow( d, i ) );
}
System.out.println( "This series out to " + NUM_TERMS + " yields " + sum );
}
}
From the Terminal again, to see that your file is indeed in there, run
Now, compile the code
and run it
Of course, it'll tell you to please pass it a real number, so run it again
Congratulations. You're programming. :)
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by depolitic:
Do not learn C then Objective-C -Programming in C will teach you things you will not know and some bad habits in regards to procedural and oop programming.
Sorry, but I disagree totally. Learning procedural as well as OO will only help you and make you more rounded as a programmer. It'll help you with that whole "right tool, right job" thing which people seem to find so difficult.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Staffs, UK
Status:
Offline
|
|
From what I've seen, Objective-C bears only a passing resemblance to pure C - especially if your using Cocoa you're going to be passing a lot of messages, and the syntax for that is something unique to ObjC.
If you want to develop a commercial skill, then Java or C# is the way to go (unfortunately, I might add).
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Angus_D:
Sorry, but I disagree totally. Learning procedural as well as OO will only help you and make you more rounded as a programmer. It'll help you with that whole "right tool, right job" thing which people seem to find so difficult.
As well as, yes. First, though? I disagree. I would learn something like Java or Io first, then move on to C with its weirdities later.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Online
|
|
I cut my teeth on C after a year of playing with hypercard. I am of the opinion that if you can handle the nitty gritty details of C, pointers, handles, dereferencing arrays, malloc then the cleaned up handholding that a good OO language provides is cake. I have also found that the language is self is almost secondary. I can pick up the basics of a syntax in a few hours, except for lisp thats a real headache. Its the application design and the framework be it cocoa or MFC and the sometimes backwards way that they work that matter most, just look at the MFC Window class.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2004
Status:
Offline
|
|
Hey
I just went out and bought Beginning Programming with Java for Dummies. What program do I use for actually writing the Java? Do I use terminal? In the book it says for mac users to go to apple's developer webpage and download the MJR SDK. Apple says that's for OS 9. What do I use in OSX??
--Brandon
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Oct 2003
Status:
Offline
|
|
> What program do I use for actually writing the Java?
For now, use TextEdit (but be sure to set TextEdit-->Preferences-->New Document Attributes-->Plain Text (rather than "Rich Text")).
> Do I use terminal?
You use the terminal to run the javac and java commands. The way it works is, you make changes to your Foo.java file, save the file, then switch to the Terminal to compile and run your program.
> In the book it says for mac users to go to apple's developer webpage and download the MJR SDK.
That's an old book. Don't do that. I think MJR is an old term ("Macintosh Runtime for Java"). Now it's called Java2 SDK, just like on Windows or GNU/Linux.
OS X has everything you need already installed (at least I'm pretty sure it does -- I installed Panther from the CD's and installed everything from the Developer CD too).
> What do I use in OSX??
Just the "javac" and "java" commands (which you can think of as the Java2 SDK) from the Terminal. That and TextEdit are all you need right now. Let us know how it goes.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by johnMG:
> What program do I use for actually writing the Java?
For now, use TextEdit (but be sure to set TextEdit-->Preferences-->New Document Attributes-->Plain Text (rather than "Rich Text")).
> Do I use terminal?
You use the terminal to run the javac and java commands. The way it works is, you make changes to your Foo.java file, save the file, then switch to the Terminal to compile and run your program.
> In the book it says for mac users to go to apple's developer webpage and download the MJR SDK.
That's an old book. Don't do that. I think MJR is an old term ("Macintosh Runtime for Java"). Now it's called Java2 SDK, just like on Windows or GNU/Linux.
OS X has everything you need already installed (at least I'm pretty sure it does -- I installed Panther from the CD's and installed everything from the Developer CD too).
> What do I use in OSX??
Just the "javac" and "java" commands (which you can think of as the Java2 SDK) from the Terminal. That and TextEdit are all you need right now. Let us know how it goes.
TextEdit will work for basic Java programs, but I rapidly get a headache on anything longer than about 100 lines in TextEdit (mostly due to having to count lines by hand to find where exceptions are being thrown).
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2004
Status:
Offline
|
|
Thanks for all your help you guys. I finally figured out how to work it, and now I'm doing all the basics in the book. This is FUN!!!
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|