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

as the great lords have said, :To each his own:.

Well first off, I would like to say that simply learning a language or a dozen more of them won't make you a better programmer - just like learning a lot of English vocabulary wont make you William Wordsworth or Shakespeare.

To learn programming you will have to choose the path that suits YOU well.

Learn atleast two languages well. One procedural(such as C) and one object oriented(C++ is the next best choice). Then pick up books on Algorithms and Datastructures and program them to know how data can be structured, stored, sorted, retrieved and all the tradeoffs that come in. Learn the BigO notation and all those mathematical concepts that are related to programming.

I would also recommend learning Python as the first language. I remember learning C++ on my own which was a steep learning curve(yes no classes at school for C++) and I was frustrated.

Also remember, learning a language will require you to consult MORE THAN ONE BOOK.
Here is the path I chose:

My first language when learning programming(7 years back, when I was 15) was C. I was never taught about programming at school so I had to learn everything by myself(including which compilers to choose and which books to choose, so you can rest assure I read a LOT of books on C). I started out with online tutorials but they didnt help me much. After struggling with The C Programming Language and having read it for atleast 10 times, everything began to make sense.

Learning C isn't just about writing code, its about being able to read other's code and let me tell you C is not the kind of language you can begin reading in a month or two. It takes ages of practise. But when I got everything right, it all made sense.

Having written substantial amount of code in C and read others code,
My next language was C++.

By the time I came across C++ my foundations on C were very strong. I always wanted to learn C++(that I had been hearing about it on the internet and all the great tools being written in C++). Book I consulted was Stanley Lippman's C++ Primer. Yes its a HUGE book(I learnt from 3rd edition IIRC). But each concept has been emphasised and re-emphasised, explained and illustrated very very clearly. Having knowledge of C, my entry into C++ was not that hard, since I had to only learn how to use the OBJECT ORIENTED FEATURES of C++.

This is when the things changed. After struggling to learn OOP in C++ and quite often failing at understanding the meaning behind Objects, I consulted languages - often esoteric - that led to creation of C++(Yes I read the manual on Simula). Knowing why C++ language was invented in the first place sets you in the right path of learning the methodologies and that was when the whole point of "Simulations" struck to me and I began to start thinking in Object Oriented Paradigm.

After having read that book, I moved to Bjarne Stroustrup's The C++ Programming Language(if you can't afford it, I suggest you borrow it from the library(I did that too, I live in India and back then the book costed about 3000 rupees, so you're quite lucky)). I carefuly read every chapter in the book. It not only teaches you C++, but also teaches you programming practises used by successful C++ programmers (like in part3 and part4). And that changed everything. After learning C++ on my own, I could pick up any language and learn all by myself.

Java, C#, VB.NET, Python, Perl, Lisp, php you name it.

I also read books on algorithms which created a sort of template in my head on how programs should be created and how they can be optimized.

That said, learning Assembly level programming also helps in long run. It teaches you how your computer works, so you can create better programs a point emphasised by Randall Hyde in his book "Writing Great Code, Writing High Level, Thinking Low Level".

I recently got a mac(like a week ago) and I already programmed a few applications in ObjC. ObjC is very easy to pick up after you know atleast the WHOLE of C and atleast one Object Oriented Language.

Advice when learning to program:
1) Use as many resources available to you as possible. Operating systems, compilers, books, internet, coffee :p
2) Pay attention to detail on how programs are constructed in the language you're programming.
3) Dont be afraid to play with your programs. Write your own programs and test them out. Its ok if you copy them from your text. :p
4) You should reach a point where you can express your ideas in any language of your choice.
5) Learn slowly, take your time in understanding the practises and underlying concepts.
6) Enjoy what you do. If you get bored with a certain topic or find it hard, skip it and come back to it later when you're intrested again.

Last tip and this is again a personal note: Donot learn C++ as your first language. Remember though Bjarne suggests its OK to learn C++ as your first language, his favorite book on programming STILL is "The C Programming Language" by Kernighan and Ritche(also known as K&R). If you want to program for a mac and learn ObjC like the back of your hand, I suggest skipping C++ altogether and going with Java because ObjC and Java share the same object model called the smalltalk object model.

Cheers and all the best.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.