 |
 |
Learning...
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Hi, I was wondering if it's feasible to learn a programming language without a formal course if you have no experience at all?
Can someone recommend a source to learn programming "Concepts" without having to delve to deeply into the syntax?
Most of the beginning programming books out there are Windows oriented any GOOD Mac written intros to Programming?
Any beginning non-programmers guides to Cocoa?
Thanks for any insight you can impart...
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status:
Offline
|
|
GoTo  developer.apple.com
There is tons of documentation and a few tutorials there.
Once you get past that, get Aaron Hillegass' book on OS X Cocoa programming called "Cocoa Programming for Mac OS X". This will help you with Objective-C and Cocoa programming.
For more information and links to reviews on this book, GoTo http://www.bignerdranch.com/Book/
Hope this helps you out.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Aug 2002
Location: Northeastern NV, USA
Status:
Offline
|
|
If you have no prior programming experience, I suggest you start off with Cocoa programming for Dummies or Learning Cocoa with Objective C (both available at most online resellers like Amazon, B&N, etc...) BEFORE jumping into Aaron Hillegrass' book, "Cocoa Programming for Mac OS X." The Hillegrass book is excellent and very recommended, but if you have absolutely no foundation in any language at all you will be lost. (And in case you're wondering, no; --HTML does not count as a language!)
In fact, both of the books above still assume you possess at least a minimal bit of programming experience. So to get past a few rough spots I strongly advise you to purchase a book on programming in C as well. (Don't get a C++ book, just a C book.) The two books above will walk you through how to enter a program, compile it, and create a usable application. But, before long you’ll discover that you still need a little bit of fundamental understanding of the C programming language.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Location: Macfreak7
Status:
Offline
|
|
Do a search, i'm sure you'll find a ton of similar threads.
Then check this and this

|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
<snip>In fact, both of the books above still assume you possess at least a minimal bit of programming experience. So to get past a few rough spots I strongly advise you to purchase a book on programming in C as well. (Don't get a C++ book, just a C book.) <snip>
why not C++? is it because cocoa and objective-c are not at all related to C++? or is there some other fundamental reason that if i/someone wanted to learn to program for OSX/mac that C is better than C++?
nick
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status:
Offline
|
|
having never touched C++...it's my understanding that C++ is kind of messy and unnecessarily complicated. Like, it was the first attempt to pile object oriented programming on top of the existing C language. And that Java and Objective C have the advantages of OOP but they were better thought out from the start. That's my general impression...that it's not for greenhorns, that it will confuse more than help
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status:
Offline
|
|
I'd start by learning to program in C with basic command line apps first. Once you get a good enough grasp of this then you can move onto trying out some of the Cocoa or Carbon API stuff.
You could also start with Java since it lacks some of the more obscure features of C such as pointers and global variables.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
Originally posted by iJed:
I'd start by learning to program in C with basic command line apps first. Once you get a good enough grasp of this then you can move onto trying out some of the Cocoa or Carbon API stuff.
You could also start with Java since it lacks some of the more obscure features of C such as pointers and global variables.
would there be examples of command line apps in a C book? or samples on the 'net if i searched for that type of app/tutorial?
thanks!
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by zanyterp:
would there be examples of command line apps in a C book? or samples on the 'net if i searched for that type of app/tutorial?
There certainly would. Any tutorial worth your time will have usable code samples to show you how it's done.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
Originally posted by iJed:
I'd start by learning to program in C with basic command line apps first. Once you get a good enough grasp of this then you can move onto trying out some of the Cocoa or Carbon API stuff.
<snip>
how are the command line apps written? compiled? would gcc, if i use terminal, compile a text file written in, say, TextEdit? or better with vi or pico?. . .or is that another jar of worms? or would project builder work and then just run the program in the terminal?. .. or by command line you mean without a GUI and all the glitz that is more than typing text into a prompt?
thanks!
nick
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
Originally posted by iJed:
<snip>
You could also start with Java since it lacks some of the more obscure features of C such as pointers and global variables.
would java programs, rather than applets, be run from a browser? or just double-clicked?
nick
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status:
Offline
|
|
Originally posted by zanyterp:
how are the command line apps written? compiled? would gcc, if i use terminal, compile a text file written in, say, TextEdit? or better with vi or pico?. . .or is that another jar of worms? or would project builder work and then just run the program in the terminal?. .. or by command line you mean without a GUI and all the glitz that is more than typing text into a prompt?
thanks!
nick
Yes you can use any text editor you like since source code is just a text file. You can do this with C, C++ and Java. Just create the text file then invoke the compiler (i.e. cc -o exe source.c for C, or javac javasource.java then java javasource to execute).
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status:
Offline
|
|
Originally posted by zanyterp:
would java programs, rather than applets, be run from a browser? or just double-clicked?
nick
Java programs can be executed from the command line. Say your class is called myprogram.class. Just execute by typing 'java myprogram' (without the quotes).
If you use ProjectBuilder I believe there is a way to create double-clickable .jar files.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2003
Location: Atlanta, GA
Status:
Offline
|
|
Originally posted by zanyterp:
why not C++? is it because cocoa and objective-c are not at all related to C++? or is there some other fundamental reason that if i/someone wanted to learn to program for OSX/mac that C is better than C++?
nick
It's not that C is "better" than C++;
C++ _IS_ C with OO extension on top (just as Obj-C is).
The reason you want to learn C FIRST (I recommend doing this before you even touch your first Cocoa/Obj-C book) is to have a foundation to build from. Most Objective-C books assume you have a working, competent knowledge of a standard procedural programming language (C, Perl, even tsch shell scripting).
The fact is, if you simply pick up "Cocoa for Dummies" or some such book, you'll learn how to hack a few working things together in OSX... The problem is that you'll be a very poor programmer because you understand very little of what you're actually DOING.
I see this all the time, especially on the cocoa-dev list. People whose only "coding" experience is slapping together HTML tags trying to tackle Cocoa head on. You might be able to sneak something working through, but in the end it will most likely be of poor quality/stability.
I'd recommend (having been on the comp-sci @ GA Tech path for quite some time, though now far removed from it) starting with the basics. Learn the basics of program flow and memory management w/ C. Learn how to set up structures and enumerators; learn how to define your own datatypes with typdef etc. Learn the basics of debugging and stack tracing. And for god's sake, learn how to properly abstract your code with useful/repeatedly used functions.
Once you've done that, picking up Objective-C (or Java for that matter) will be a snap. Both are very similar in basic concept (with Java having a much harder line towards cross-platform compatibility). Take some time and get a good book on Object Oriented Programming (generic, theory based). Once you understand the concept of an object and inheretence and such like that, you should be able to dive into the Hildegass book (an EXCELLENT source) fairly easily.
It won't be a quick process, but in the end you'll be a MUCH better coder because of it.
|
Alex
G7 Software: home Tetrinet Aqua
-----
"Utopia" 1Ghz TiBook SuperDrive w/ 1Gb RAM.
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
I've you don't know anything about programming, C and C++ are not good first-language choices. Pick something more modern, more high-level, and more forgiving.
I strongly recommend Python as a first language. It has an interactive interpreter, it supports all the good object-oriented concepts that you need to learn, and it's free. It was designed as a teaching language. It's also included with OSX.
If you are against that idea, I'd recommend java as a second choice. It's more like C than python, but doesn't have pointers, and it enforces the object-oriented approach.
C and C++ (and to lesser extent, Objective C) are useful tools, but they're not good choices for a non-programmer to learn programming. You'll learn a lot of bad habits that way.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status:
Offline
|
|
Originally posted by Arkham_c:
<snip>C and C++ (and to lesser extent, Objective C) are useful tools, but they're not good choices for a non-programmer to learn programming. You'll learn a lot of bad habits that way.
if you don't mind my ignorance, why could i pick up bad habits from them? what are the bad habits i could pick up? is there anything i could do to avoid picking them up, or is that just inherent (sp?) with these languages?
thanks!!
|
|
some people are like slinkys: they don't do much, but are fun to push down stairs.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2001
Status:
Offline
|
|
if you don't mind my ignorance, why could i pick up bad habits from them? what are the bad habits i could pick up? is there anything i could do to avoid picking them up, or is that just inherent (sp?) with these languages?
"Bad habits" meaning thinking about what the machine is doing under the covers. Which may not be a bad habit depending on what sort of programming you want to do.
If you like systems programming, then by all means start with C or C++. They get you into the habit of thinking about where/when memory is being allocated and deallocated -- which I like.
If you want to get started writing compilers, then think about learning PowerPC assembly. I don't know any assembly at all, but I here that it's real frontier-style programming. :)
I'm just now learning some Objective-C, and it's a lot like a very pared-down C++ where every object goes onto the heap and everyone just passes addresses around, collectively agreeing on how to handle their lifetimes.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2002
Status:
Offline
|
|
Originally posted by zanyterp:
why not C++? is it because cocoa and objective-c are not at all related to C++? or is there some other fundamental reason that if i/someone wanted to learn to program for OSX/mac that C is better than C++?
c++ is a very dirty language. it was created (by a committee) to add (the then new idea of) Object Oriented programming onto the best programming language: c.
you can't access the bulk of Cocoa from c++. there is a special language, called "Objective-C++" which blends Objective-C with C++, but even then, all your Cocoa stuff is first going through objc.
most programmers would agree that Object Oriented design is wonderful. and when you learn c++, they tend not to stress OO, but instead tack on objects to a very procedural language. With Objective-C, and a good API, OO is pretty much forced on you (not in a bad way), so you have to learn good OO design. Java is much the same, in that good OO concepts are taught.
It's not that C is "better" than C++;
well, it is better.
back to the original question: i learned programming without any formal courses (though I later took them to get college credit). i own several books on programming, but the only one i ever finished from back to back was "How To Program" (which was about BASIC). after you learn the syntax of a programming language, learning new ones is relatively easy. and once you know the strong points of OO and procedural designs, you'll know how to apply them to whatever language you are in.
|
|
dont phear if ya hear a fourin soun' to ur ear. iss al'ight mah.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2002
Status:
Offline
|
|
Start by learning the basics of programming, storage (variables), control structures (loops and conditional statements), subroutines/functions and basic IO (like command line input/output).
You can do all this in C with your Mac, write the code in TextEdit and compile and run in the Terminal using gcc. Stick to really easy stuff just to "get your feet wet".
Then when you feel that you can tackle a very simple command-line program, like a conversion calculator or something like that, start reading materials that talk about more advanced data structures. Learn about things like arrays and lists. THEN start getting into Object Oriented stuff. Having taken the time to learn the fundamentals will let you really understand OO programming and will illustrate why it exists and why it's so popular.
All of the above can be done in C and Obj-C, probably by starting at the Apple dev pages, but really it's irrelevant which language you use up to this point.
It should take you a month or two to absorb this stuff, and then you can start thinking about a real project (real simple, but at least using a GUI).
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by thuhFreak:
c++ is a very dirty language. it was created (by a committee) to add (the then new idea of) Object Oriented programming onto the best programming language: c.
Actually, Smalltalk -- the language that gave us the term "object-oriented" -- had been around for quite some time then. It wasn't really a new idea, just an idea alien to C. (I'd also beg to differ that C was the best programming language, but whatever. That's not quantifiable.)
most programmers would agree that Object Oriented design is wonderful. and when you learn c++, they tend not to stress OO, but instead tack on objects to a very procedural language.
I don't know what horrible school you went to, but this is not the case everywhere. I agree that C++ is not ideal for OOP, but in every C++ class I've heard of, they do their best to teach OO philosophy within the framework of the language.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Oct 2003
Status:
Offline
|
|
thuhFreak wrote:
c++ is a very dirty language. it was created (by a committee) to add (the then new idea of) Object Oriented programming onto the best programming language: c.
(Note: just changed username from greenOne to johnMG.)
Not sure what you mean by dirty. It's got a lot of dark corners and crufty syntax in some places but I think it's a nice balance between high-level and low-level. I like it for graphics/math stuff.
Also, I don't think it was created by a committee. It was created by Bjarne, and then later picked up by a committee after becoming very popular.
you can't access the bulk of Cocoa from c++. there is a special language, called "Objective-C++" which blends Objective-C with C++, but even then, all your Cocoa stuff is first going through objc.
I didn't know you could access *any* of Cocoa with C++. I think the term "Objective-C++" is just describing that you can name a source code file *.mm, put both Obj-C and C++ code in it (not mixing Obj-C and C++ class hierarchies or anything nasty like that), and build it successfully.
See
/Developer/Documentation/ReleaseNotes/Objective-C++.html
for more details.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by johnMG:
I didn't know you could access *any* of Cocoa with C++.
Code:
NSPoint aPoint = NSMakePoint(5, 92);
cout << "aPoint is {" << aPoint.x << ", " << aPoint.y << "}" << endl;
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status:
Offline
|
|
ah, but an NSPoint is a C struct and C++, being an extention of C, can access anything that is C. ie, structs, so that's kind of a cheap response. I'm PRETTY sure he meant that you can't access any of the Classes sub-classed off of NSObject. (of course i could be wrong). 
|
|
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2003
Location: Canada
Status:
Offline
|
|
Originally posted by zanyterp:
would java programs, rather than applets, be run from a browser? or just double-clicked?
nick
Java applications are run in a text-based environment which depends on the platform you are running it on. For example, on Windows your Java applications are often run in a DOS window, on Unix (and probably Mac OS) they can be run in whichever shell you're using, and IDEs often have their own custom execution window.
Java applets are completely different. I'm taking my very first programming course right now, and I think from my experience so far that Java would be a good language to learn with. From what I'm seeing, the dev environments and compilers are very forgiving, so it would make your life a bit easier than starting with, say, C++.
If you're learning with Java, expect to learn the concept of object oriented programming as well. I'm finding it pretty intuitive, with my only problem usually being getting syntax correct when I'm coding.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Location: Colorado Springs
Status:
Offline
|
|
i strongly recommend formal schooling for learning the basics. There are some boring/mundane (but still important to know if you want to do the really cool stuff) aspects of Computer Science and/or software engineering that I just wouldn't have bothered to learn had I not been FORCED to by class curriculum. Now that I have the basic principles of programming down, self-study works fine for just learning new programming languages or APIs.
I went to college with what I thought was a good working knowledge of C. All I really had was the ability to hack simple things together that crashed for inexplicable reasons. My professors had to beat proper programming style (you have an 800-line main() function, WTF is wrong with you, where are your indents, how can you read this??) and concepts (never learned OOP, thought it was too much trouble, now I appreciate being made to learn it by a professor who cared) into my head.
using books and tutorials on your own will give you a decent introduction to programming as a 'prelude' to formal instruction, not a substitute for it.
all of this is, of course, IMHO.
|
RhythmScore
iMac 27" Quad i5 | PMG4 2x867 (RhythmScore test server) | iPhone4
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by Kibon:
Java applets are completely different. I'm taking my very first programming course right now, and I think from my experience so far that Java would be a good language to learn with.
Java applications are just like regular applications. They are typically distributed in a "jar" file (JAR = Java ARchive). You double-click the jar on OSX or Windows 2000/XP and it launches like any other app.
Java applets are an abomination. The java standard should never have included them. They are one of the major reasons that java is not taken as seriously as a language as it should be.
As far as programming languages go, java is one of the best strong-typed languages out there. It's quite nice, and is portable across platforms to boot. You can make a living writing java (I do).
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2003
Location: Canada
Status:
Offline
|
|
Originally posted by jcadam:
i strongly recommend formal schooling for learning the basics. There are some boring/mundane (but still important to know if you want to do the really cool stuff) aspects of Computer Science and/or software engineering that I just wouldn't have bothered to learn had I not been FORCED to by class curriculum. Now that I have the basic principles of programming down, self-study works fine for just learning new programming languages or APIs.
I went to college with what I thought was a good working knowledge of C. All I really had was the ability to hack simple things together that crashed for inexplicable reasons. My professors had to beat proper programming style (you have an 800-line main() function, WTF is wrong with you, where are your indents, how can you read this??) and concepts (never learned OOP, thought it was too much trouble, now I appreciate being made to learn it by a professor who cared) into my head.
using books and tutorials on your own will give you a decent introduction to programming as a 'prelude' to formal instruction, not a substitute for it.
all of this is, of course, IMHO.
I have to agree with this, but keep in mind that of course I haven't tried it the other way.
I'm having some problems getting my head around some of the finer points to object oriented programming, but things are going quite well so far. Two more courses that use Java to go, at which point the language used will be C++.
Interestingly enough, the University I'm at has chosen to partially embrace FreeBSD for the more advance programming courses, so it's the platform of choice for the C++ labs. Personally I think it's a strange choice, but maybe they'll adopt Mac OS X in the next year or two. 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status:
Offline
|
|
If I didn't go to school for programming, I definitely would never have taught myself linked lists, red-black trees, hash tables and the like. I definitely wouldn't have bothered forcing myself to break my code into the smallest possible bits (I have a few 800 line main() methods myself  ).
Also, OS X has been a godsend. I'm doing all my development on my PB and I didn't have to pay a penny for the tools to do it.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Nov 2001
Location: Seattle
Status:
Offline
|
|
If possible, I recommend showing your code to other programmers for feedback while you're learning to program.
I learned to progam on my own, and made some fairly complex programs, but my progams were full of hacks and often had poor overall design. It wasn't until I took some progamming classes in college and had some intern experience (which involved homework assignments/code reviews) that my code had clear design and was understandable. I'm not saying you have to take a formal class to learn to program (though of course it helps); rather, that having others more experienced to point out how to improve your work is incredibly helpful. A good program not only tells the computer what to do, but communicates clearly to the programmers reading it what it's doing and how it works. Well designed, well written programs are much easier to maintain and modify. Even if you are the only one working on a program, it's nice to be able to look at a piece of code and not have to say "What the f is going on here? It'll be easier to rewrite this from scratch than to understand this mess." Anyway, end of rant. Having others coach you along is the best way to get good at something, just like lots of things in life. 
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Aug 2002
Location: Montreal
Status:
Offline
|
|
Originally posted by Macfreak7:
Do a search, i'm sure you'll find a ton of similar threads.
Then check this and this
I have to agree these are the 2 best free places from a newbie stand point.
I will be starting from the same place myself as soon as I can get X Code for DL.
I did also find this place...free for now.
|
|
G5 DP 1.8 Rev.B 3g Ram
20" Apple Cinema.
Tigger 10.4.1
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

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