Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tntmac fans7

macrumors newbie
Original poster
Dec 31, 2007
16
0
Santa Barbara, CA.
Hello, everybody. I know I'm not the first to ask this, but I just really need some pointers. I'm a senior in high school and I am trying to begin programming, but despite the infinite myriad of resources apparently available online or elsewhere, I'm just not finding anything useful. Even the "guide" at the top of the Mac Programming thread is most helpless.

I have no experience whatsoever in programming, but I'm very eager to learn. What books/resources would you recommend that are thorough, helpful, and Mac-based. I've spent several hours looking for materials, but nothing seems to exist that addresses my particular level of naïveté; they all seem to expect me to know something. Please help me get started.

Thanks, everyone!

Ty
 
Go to your school library, or your local public library, and look for any books on the very basics of computer programming. It's not necessary that the book be Mac-specific or even Mac-related. The basics are the same, regardless of the computer.

Also discuss your question with a librarian, and ask for guidance, as they may well know what kinds of books you will find most useful.

Sometimes there's no substitute for direct interaction.

EDIT: a couple more things

1. Talk to one (or more) of your school's teachers.

2. Wikipedia:
http://en.wikipedia.org/wiki/Computer_programming

And remember, Wikipedia isn't just articles, it's links. Like this one under the Programming Languages subsection of the above article:
http://www.greenteapress.com/thinkapjava/

Even though that free book may explain everything for you, I still recommend browsing the Wikipedia articles and links. Much of it may be over your head now, but it won't always be.
 
I would definitely recommend general programming (like Java) rather than trying to do something specific for Mac OS X to begin with.

Java is a very easy language to get into and it works very well on Windows, Linux and Mac OS X.
 
I'm just learning to program too - only started on Saturday.

I was pointed to 'Head First Programming' from O'Reilly Press. (Actually, I was pointed to 'Head First HTML with XHTML and CSS' and then to 'Head First Programming' - they're both great.)

For me, the Head First books are fantastic - more like a fun class than a dry book. They have pictures, cross-word puzzles, interviews and a conversational style. I tried a number of other programming books as well. I got a half dozen from my local university library and they were all hopelessly confusing.

I'm 3 chapters in and it has already explained logic flow, strings and functions - I'm about to hit chapter 4 - Data Files and Arrays.

It's great because it assumes you know absolutely zip about programming and they are focusing on the concepts rather than a particular language. They use Python in the book because they say it can do a lot of good things and doesn't get in the way of learning the concepts with a complicated syntax. Which so far seems to be true!
 
Personally I would recommend starting with some kind of scripting language like Tcl or perl. They are easy to learn, intuitive, and don't require a compiler.

If you wanted to start with a compiled language, I recommend Kernighan and Ritchie's "The C Programming Language." It's a pretty standard reference.
 
So there are basically two schools of thought on the best approach to take. Some people suggest starting with a low-level language like C (upon which a great many languages are based). C is going to be harder to learn than some of the "higher level" languages, but in the end you'll have a better understanding of how everything works (kind of like driving a manual car).

The other approach is to start off with a higher level language (Python is a great choice imo) and learn some of the fundamentals of using programming to solve problems, which would apply to any language you work with. This is approach is analogous to learning the basics of driving and getting a feel for how to stay in your lane, park, drive in the rain etc, without throwing in the complication of the clutch and the shifter until after you've mastered the basics.

I think the approach anyone takes should be based on how they learn best. Some people like to start with the details and work their way up to the bigger picture, others prefer to get the broad overview first and then drill down to the knitty-gritty as the need arises. When you're working with higher level languages there may be times when it feels a bit magical/black-boxish because you haven't learned the details of how it works. If you're the kind of person that has a hard time "taking it on faith" you might want to consider the lower-level approach.

Just to give you a feel of what the differences of a higher vs. lower language are like look at these 2 examples that display "I love programming" on the console.

In C the code looks like:
Code:
#include <stdio.h>

int main( int argc, const char * argv[] )
{
     printf( "I love programming\n" );

     return 0;
}

To get the same result in python you write:
Code:
print "I love programming"
 
GamePlan 101.

Well i think the most important part you have to figure out is what exactly you want to achieve accordingly decide what language you need to study (html,C/C++,pyhton,perl etc etc).
The most important part of programming is experience. sorry if this statement comes as a dream-killer but programming does not comes in a couple of days or weeks or (hopefully) years. you really need dedication and lots of hard work. And trust me when i say this. Virtually all Self taught Programmers use a trial and error method.You might not grasp everything in once go but with time things will fall into place.

If you mean Mac programming as in cocoa & obj-c. i can give you a roadmap:

1. You need to study C/C++. they are lost of tutorials online. Xcode has a very decent Command line utility. try understanding basic concepts (theory) first (eg: what is a function? what is oops? what is an object? etc etc).

2. If you have learned C try moving C++. the difference is that C++ is OOPs compared to C which is PP.

3. Move to Cocoa and obj-c. obj-c will be easy although don't get frightened if it looks messed up. trust me you first cocoa "hello, World" is quite an experience.

4. then involve your self with any open source project. i choose Adium. wow the no. of sources. it will take me some time to get a hang of it. can't do **** rite now. but i think will be in time.

Well, pyhon is very simple no doubt about it. but not sure if you will have an easy time moving to C/C++ after that. anywaz best of luck.

fk. i landed up giving you a lecture.
 
Learning with Xcode tutorial

I am also new to Mac Programming. I just started with Xcode. I did the "Hello World! tutorial. Everything went well. I have Mac OS X 10.6.2
When I tried to run the Hello World app on my wife's computer Mac OS X 10.5.8 it would not run! I then set the "Deployment target in the project to Mac OS X 10.5. Still no luck. I sent the .app directly by e mail. I also used package maker and sent that. It appeared to install like normal (same as on my computer) but still would not run.
Any suggestions?
Don
 
The 10.5 and 10.6 SDK's are different. Why bother running "Hello World" on another computer anyway? ;)

If you actually write out the code in a text editor and compile it on the other machine it should work. Does the wife's computer have Xcode? If so, all you should have to do is (in a terminal), navigate to where the source file is, and compile it using gcc or (if you are using C++) g++.

For C++:
Code:
$ g++ -o output nameofyourfilehere.cpp

$ ./output
 
It was my intent to write a simple .app and have it run on other computers in the family. Ultimately I have set a goal of writing an application for amateur radio use that could be used by other amateurs using Mac. I suppose as long as it works on mine I should be satisfied. Since I am just learning, any exercise is productive. Thanks for the tip.
Don
 
It was my intent to write a simple .app and have it run on other computers in the family. Ultimately I have set a goal of writing an application for amateur radio use that could be used by other amateurs using Mac. I suppose as long as it works on mine I should be satisfied. Since I am just learning, any exercise is productive. Thanks for the tip.
Don

Though it isn't completely up-to-date with the latest Xcode, Cocoa Dev Central is a good site for getting some tutorials on Mac-specific programming. I've done a couple of them. However, I have since seen the value of learning a language first, so I'm working on C++. Then I'll see where to go from there. :)
 
Java is a very easy language to get into

OMG!!!! ROTFLMAO!!!! EPIC FAIL!!!!

Run away from Java as fast as you can!

At least for me and both of my daughters, we found Java to incomprehensibly opaque and bizarrely freakish. It's so bad that both of my daughters took Java classes and ran away screaming from any sort of computer programming ever.

My older daughter took Java in college and will never touch a computer program ever again. She got her degree in Mathematics so you may want to avoid the "well she's not smart enough" reply.

My younger daughter took Java in high school - her introductory handout on how to start Java was 20 pages long. I reviewed it and found it to be mind-numbingly trivial and not focused on computers or programming - it was necessary, though, to get to the point where you could actually write a program. She's majoring in Chemistry now, so has the ability to handle scientific concepts, but will never program again.

I got a Computer Science degree (admittedly back in the days when dinosaurs roamed the earth and the unicorns had disco balls on their horns) where I picked up (seemingly by just inhaling) several languages. More recently I've picked up a few newer languages by buying a few books and working through them. For Java, I bought one book - useless - OK, it must be me. Bought a second book - useless - boy I must be stupid. Bought a third book - useless - I really am not smart. Bought a fourth book, this time on OOP basics - OK that makes sense. Bought a fifth book (Java again) - useless - maybe it's not me, maybe it's Java.

By the way, the first line of my reply was a rhetorical device to emphasize my aversion to the language. It's not the way I normally choose to communicate.

And yes, I'm awaiting the "you're not smart enough" or "you just don't get it" or "Java is better nanny nanny" responses.
 
disagree with above poster

I'm taking java in college right now as my second semester of programming and I think that its a solid language to start and learn object oriented programming. Also, the class made me realize i want to major in CS instead of run away from it.
 
PatrickCocoa:
What you and your daughters' experiences indicate is that the methods you tried to learn Java didn't work for you. It doesn't measure the intelligence level of the three of you, it doesn't measure the learnability of the language. With a better teacher (or a teacher at all in your case) it may have been achievable. Maybe nothing would have done it. That doesn't mean no one can learn it, or that it is a bad teaching language.

Your anecdotes are of value, but based on them you shouldn't just say "run away". Basically, the moral to take away is that it may not be a language for everyone, or more specifically the materials you tried might not have been the best. My sister-in-law had to do a programming course using Java in college. The way it was presented did not work for her, so I basically taught it to her in a way that was compatible with the way she learned. Unfortunately, courses and books are geared towards the way that the teacher or author wants to teach, probably geared toward a broad audience, not the way that each particular student learns. The point of my anecdote is that something that seems impenetrable can be made achievable with a patient instructor that's willing to adapt.

Essentially I'm replying to say:
People learn things differently. From your stories we've learned that 2 teachers and 5 books failed to present Java in a digestible way to 3 individuals. This doesn't mean that the OP will share this experience. I know a lot of CS programs at well-respected universities that use Java as a teaching language, and their students (including me) seem to end up OK.

To the OP:
Try some things. Thankfully these days it's free or close to free to try a new language. You don't have to pay for compilers, documentation is readily accessible online, there are resources like this forum to ask questions, you don't need to rent time on a mainframe to work, etc. You may choose to pay for books if online resources don't do it for you, or even pay for courses at a jr. college or university (though the latter probably doesn't have straight programming courses, CS is normally geared more toward theory than the mechanics). But really, if you try Java for a week or two and it doesn't suit you... there's an associated opportunity cost, but most of us can deal with 20 hours of free time being spent on an ultimately fruitless pursuit. A lot of us probably waste that watching inane TV every week or two. It's easy to try Java, try Python, try C, try Lisp, etc. and see what comes most naturally.

-Lee
 
I am also new to Mac Programming. I just started with Xcode. I did the "Hello World! tutorial. Everything went well. I have Mac OS X 10.6.2
When I tried to run the Hello World app on my wife's computer Mac OS X 10.5.8 it would not run! I then set the "Deployment target in the project to Mac OS X 10.5. Still no luck. I sent the .app directly by e mail. I also used package maker and sent that. It appeared to install like normal (same as on my computer) but still would not run.
Any suggestions?
Don

Make sure you send her a "Release" version and not a "Debug" version.
 
OMG!!!! ROTFLMAO!!!! EPIC FAIL!!!!

Run away from Java as fast as you can!

At least for me and both of my daughters, we found Java to incomprehensibly opaque and bizarrely freakish. It's so bad that both of my daughters took Java classes and ran away screaming from any sort of computer programming ever.

My older daughter took Java in college and will never touch a computer program ever again. She got her degree in Mathematics so you may want to avoid the "well she's not smart enough" reply.

My younger daughter took Java in high school - her introductory handout on how to start Java was 20 pages long. I reviewed it and found it to be mind-numbingly trivial and not focused on computers or programming - it was necessary, though, to get to the point where you could actually write a program. She's majoring in Chemistry now, so has the ability to handle scientific concepts, but will never program again.

I got a Computer Science degree (admittedly back in the days when dinosaurs roamed the earth and the unicorns had disco balls on their horns) where I picked up (seemingly by just inhaling) several languages. More recently I've picked up a few newer languages by buying a few books and working through them. For Java, I bought one book - useless - OK, it must be me. Bought a second book - useless - boy I must be stupid. Bought a third book - useless - I really am not smart. Bought a fourth book, this time on OOP basics - OK that makes sense. Bought a fifth book (Java again) - useless - maybe it's not me, maybe it's Java.

By the way, the first line of my reply was a rhetorical device to emphasize my aversion to the language. It's not the way I normally choose to communicate.

And yes, I'm awaiting the "you're not smart enough" or "you just don't get it" or "Java is better nanny nanny" responses.


dude, have to agree. you've got a point here. and most of all its slow. :-(
 
OMG!!!! ROTFLMAO!!!! EPIC FAIL!!!!

Run away from Java as fast as you can!

At least for me and both of my daughters, we found Java to incomprehensibly opaque and bizarrely freakish. It's so bad that both of my daughters took Java classes and ran away screaming from any sort of computer programming ever.

My older daughter took Java in college and will never touch a computer program ever again. She got her degree in Mathematics so you may want to avoid the "well she's not smart enough" reply.

My younger daughter took Java in high school - her introductory handout on how to start Java was 20 pages long. I reviewed it and found it to be mind-numbingly trivial and not focused on computers or programming - it was necessary, though, to get to the point where you could actually write a program. She's majoring in Chemistry now, so has the ability to handle scientific concepts, but will never program again.

I got a Computer Science degree (admittedly back in the days when dinosaurs roamed the earth and the unicorns had disco balls on their horns) where I picked up (seemingly by just inhaling) several languages. More recently I've picked up a few newer languages by buying a few books and working through them. For Java, I bought one book - useless - OK, it must be me. Bought a second book - useless - boy I must be stupid. Bought a third book - useless - I really am not smart. Bought a fourth book, this time on OOP basics - OK that makes sense. Bought a fifth book (Java again) - useless - maybe it's not me, maybe it's Java.

By the way, the first line of my reply was a rhetorical device to emphasize my aversion to the language. It's not the way I normally choose to communicate.

And yes, I'm awaiting the "you're not smart enough" or "you just don't get it" or "Java is better nanny nanny" responses.

There are all kinds of reasons why you may find one language harder than another. I, for instance, have spent quite awhile trying to get my head around Haskell and have failed miserably at every attempt. While I have found Erlang to be a reasonable language to learn (I'm sure if I spent more time trying I would get more out of it).

The thing that I have noticed is not that I find the language of Haskell itself difficult to pick up, but that I find it difficult to remove my assumptions about programming which I learnt from other languages. Thus the difficulty is not the language, but the retraining of the way that one thinks about programming.

That is the difficulty.
 
dude, have to agree. you've got a point here. and most of all its slow. :-(

I'm resisting this flamebait as best I can.

In any case, how fast a language is has no bearing on how well you program. Yes, C is very lean, but that's only half the story. An optimized implementation of an algorithm written in PHP could easily beat a naive approach written in C.
 
Java is not 'slow' and hasn't been for many years, but its reputation as a 'slow' language has unfortunately held on among some people from the early days. Current optimizing Java compilers are very smart and make the decrease in development time well worth the possible 5% (or whatever) increase you might get by trying to hand-optimize your C code.

Not knocking C here, but the 'Java is slow' argument doesn't hold water anymore.

Back on topic, I learned programming in Java and had no problems with it. After a semester I started learning C and have picked up on a variety of scripting languages, but five years later Java is still my language of choice.
 
Personally I would recommend starting with some kind of scripting language like Tcl or perl. They are easy to learn, intuitive, and don't require a compiler.

I agree, I would start with a good scripting language, like Perl or Python. As much as it pains me to say, I would stay away from Tcl. It's not used as much anymore and getting up to date resources for it can be a pain for someone just starting out.
 
Thanks, you guys, for all the insight. I was just wondering, though: a couple of you say there's a lot of resources online, but that's just my point; what resources? Are there particular websites you might recommend?

My ultimate goal is to make an app similar to Apple's Dictionary. It would act the exact same way, but be more of an encyclopedia. Where should I start to create something like that?

Thanks again, everyone!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.