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

What do you recommend to learn as first languages?


  • Total voters
    43
What can you guys then recommend for learning before C?
What books/places can you recommend?

I have searched around Google, but can't find some good recommendations...

Thanks again! :D
 
What can you guys then recommend for learning before C?
What books/places can you recommend?

I have searched around Google, but can't find some good recommendations...

Thanks again! :D

If you're interested purely in learning, perhaps Pascal or Basic? They're relatively easy to learn, but not particularly C-like in their syntax though.

Javascript / Actionscript(Flash) are more C-like so you might consider those. Some say if you don't start off learning C, and pointers and memory management right at the start, your brain won't be capable of doing it later.

I have to disagree. The worst thing you could do is take on too much too quickly, get confused and frustrated, and give it all up. Pick any easy language, learn it, and accept that you'll have to go back and learn some aspects in much more detail as you go forward.

An important consideration, is the developer environment. It's sooo much easier to learn a language if you have decent debugging tools to see what's going on.
 
I disagree, scripting languages are usually loosely typed and probably will not prepare the OP for Objective-C and Cocoa touch.
And if people say learning C will give you "bad habits" just think about what kind of habits you pickup from PHP or Python.

Many of the best programmers I've met know multiple programming languages, including those that can give one "bad habits" (awk, Perl, Fortran, Basic, Forth, assembly). Trying to enforce good programming practices by teaching only "one true language" metaphor seems more like a matter of religion to me. "Bad habits" are more a matter of programming practice (and knowledge and discipline); you can write unmaintainable cruft in ObjC, Java or Ada, and clean well-documented code in structurable Basic or even macro-assembler. I've seen both types.
 
My question is, how is your book working out for you? If you are making good progress, I would suggest you finish the book, up to the point where you have a good handle on Objective-C, then expand your knowledge deeper into C.

Every programming language is the same, only different. Once you understand one of them, then next one becomes a matter of getting the differences down. But it would be a good idea to at least acquire an understanding of assembly so you have an idea what is going on underneath.
 
My question is, how is your book working out for you? If you are making good progress, I would suggest you finish the book, up to the point where you have a good handle on Objective-C, then expand your knowledge deeper into C.

Every programming language is the same, only different. Once you understand one of them, then next one becomes a matter of getting the differences down. But it would be a good idea to at least acquire an understanding of assembly so you have an idea what is going on underneath.

I guess it is working well, but with only 60 pages read, it ain't that advanced yet :)

Your answers are great and I appreciate you have helped me so far :)

But...

I still have an unanswered question: What is good to learn before C? Would JavaScript be a smart place to start? What books can you recommend or online places?

For JavaScript, how is this book: http://www.amazon.com/Learning-MySQ...p/dp/0596157134/ref=pd_ts_b_1?ie=UTF8&s=books? I know it also says PHP and MySQL but if I some day in the future wanted to make a website (which is positive), I see no problem :)

Thanks again! :D

EDIT: Please bear in mind I have no programming skills as in my signature :) So language/books should be for a programmer on a small experience level
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Damn it, this thread went so off topic the topic changed itself!!

I'll try to stay there:
** There are valid reasons to learn C before moving into Cocoa/Objective-C.

** There are much fewer reasons to learn "something else" before learning C.


It sounds like the OP is too afraid to "begin" and wants to know all the possible avenues of success without actually doing any real learning.
 
Damn it, this thread went so off topic the topic changed itself!!

I'll try to stay there:
** There are valid reasons to learn C before moving into Cocoa/Objective-C.

** There are much fewer reasons to learn "something else" before learning C.


It sounds like the OP is too afraid to "begin" and wants to know all the possible avenues of success without actually doing any real learning.

About the too afraid, maybe you right or maybe not. I have thought about it myself, so I won't lie about that.

If I understand the rest of the sentence, I don't see any problem with being 90% - 100% sure about the right road.
I have seen/heard some people, what choices they made and they wasted a lot of time because they didn't choose path.

But sure I can just start learn C, even if I have a hard time learning it, and then find out it was a good idea learning some Java, JavaScript, PHP, Pascal, whatever, before C that could make it so much easier to learn C.

Btw, as English isn't my motherlanguage (Danish is), I have to do some extra focusing on just reading + I am 15 years old. I am not telling this as I had a handicap, just like to inform you :) What "brain" the thoughts was coming from

A LITTLE POLL:
Should I learn something before C? If, what?
Shouldn't I learn something before C?

Thanks again! :D

P.S. I am not saying C is hard and it will be, but some of the posts + some review on the book tells it's hard
 
A Book On C was our course text at Edinburgh Uni when I was there. I thought it was very good and actually teaches you the language.

Hi Robbie!

Small world - that was my course book when I was at Edinburgh Uni too. ABC as the tutors called it. I came to really hate that book, and ripped it up when I was finally done with the course.

Now I know for sure that I'm not a programmer and shouldn't really have been on that course, but I was young and naive in these days. :eek:
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
My 2 cents.

There are some concepts that are nearly universal among all procedural programming languages. Assembly language has these concepts (shared with higher-level languages): data types, loop control, conditional control, and arithmetic operators. The data types available in assembly is generally limited to integers, though some support floating point or allow different widths of integers. Assembly generally also supports pointers (i.e. indirect addressing of memory), but this concept is not present in all programming languages.

Above those basic concepts, object-oriented languages add: classes, inheritance, polymorphism, and dynamic binding. Obj-C has categories and protocols. Java has interfaces. C++ has templates. All these various concepts may or may not be equivalent.

Some languages like Python, Perl, and Javascript use a data typing that is dynamic (or weak). That contrasts with strongly or statically typed languages like C.

In addition to the concepts, each of the languages has an "environment" that is available to make things easier for you so that you can accomplish "interesting" things instead of doing lots of low level stuff. These cover things like input/output, drawing windows, math functionality, etc. Depending on the language, the environment things might be called "libraries" or "modules", among other possibilities.

So when you're learning a programming language, you're learning some of the concepts supported by that language plus the environment that surrounds that language (which may include an OS). You don't need to learn everything about a single language. You just need to learn enough to accomplish what you want.

P.S. My first language was BASIC in high school, but that is what was popular at that time.

P.P.S. I voted for learning C, and my rationale is that it has fewer concepts to learn plus you don't need to learn everything about it. Unfortunately, to do interactive things with C programs you'll probably use/learn C's scanf or printf functions which are superseded by better functions in the Mac OS environment when using Obj-C.
 
I'm not sure there is a "the" best book for learning C, or learning programming in a more general sense. Different strokes for different folks.

If you like a terse, thorough approach and ponder things like "I wonder how a memory allocator keeps track of all the small blocks of memory an application uses" then Kernighan & Ritchie is fine.

If you easily get bored if by the second chapter you haven't written a 3D shoot-em-up, you should probably get one of the "learn X in 21 hours" type of books (but don't expect to get any in-depth understanding).

When examples in a book are close to your area of interest, you'll likely have an easier time learning.

Disclaimer: I wrote a book myself (see signature) with examples taken from physics/math/generic science stuff. It uses C but each chapter contains a section comparing the stuff presented in that chapter to other languages.
 
Thought I'd throw my 2pence worth into this.


I started of learning Visual Basic way back in High School and in my first year at College. Then in the second year I learned some C and then about all you can learn from a book on C++.

From this I progressed onto Objective-C and Cocoa, seemed a logical way of doing it, but there are some differences between C and Objective-C that you may think are big to start with but you soon get into a habit.

After holidays were finished after College I'm now at Napier Uni in Edinburgh, first semester of second year was C#, god how boring that language is, if you want to jump into any C language C# is sooo easy to learn and to use, but you will end up moving away from it quickly because it takes a lot of the programming away from you. Now I'm onto a module that uses Java, and having never looked at Java I thought definite fail, but I've found it very similar to everything I'd done before, just little differences here and there but nothing major.

So personally what I'd say is if you are aiming to program for the Mac the choose Objective-C and learn EVERYTHING there is to learn on the language, like about pointers, arrays etc. Personally I wouldn't say then C then move onto Objective-C because by the sounds of it you don't want to learn C and if you don't want to do something then why do it?

Remember just my thoughts and at the end of the day its entirely up to you.

Stephen
 
P.S. I am not saying C is hard and it will be, but some of the posts + some review on the book tells it's hard

Find any language that seems ok to you, and start learning on it. Any experience is good experience. Once you're used to the concepts which are common to all programming languages, you should be able to learn other languages much quicker.

I don't understand why people say C has to be learned first. It's like saying:
Step 1: Learn to do things the hard way.
Step 2: Now learn the easy way.

That's the reverse of every other kind of learning/teaching. Learn in any language you can; but just accept at some point you may need to learn things like memory management which you previously took for granted.

But at least you'll have a good grasp of programming at that point, not just "Learn Everything Now". As I said above, the worst thing you could do it try to learn too much right away, get frustrated, and give up.
 
I don't think it matters. Learn the language that you want to start using right away. The others will come easily if/when you need to learn them.
 
Find any language that seems ok to you, and start learning on it. Any experience is good experience. Once you're used to the concepts which are common to all programming languages, you should be able to learn other languages much quicker.

I don't understand why people say C has to be learned first. It's like saying:
Step 1: Learn to do things the hard way.
Step 2: Now learn the easy way.

That's the reverse of every other kind of learning/teaching. Learn in any language you can; but just accept at some point you may need to learn things like memory management which you previously took for granted.

But at least you'll have a good grasp of programming at that point, not just "Learn Everything Now". As I said above, the worst thing you could do it try to learn too much right away, get frustrated, and give up.

I don't think anyone is saying that the OP should learn everything C has to offer and write a full fledged program in C. We are saying Objective-C will make a whole lot more sense after working your way through a short book like the Learn C on the Mac book I mentioned earlier. I went through that whole book in like 5 days.

"Learning" C is not hard, and can be accomplished in a week if you are even somewhat dedicated.

Oh and it looks like the vote is swinging towards C @ 70% right now
 
I don't think anyone is saying that the OP should learn everything C has to offer and write a full fledged program in C. We are saying Objective-C will make a whole lot more sense after working your way through a short book like the Learn C on the Mac book I mentioned earlier. I went through that whole book in like 5 days.

"Learning" C is not hard, and can be accomplished in a week if you are even somewhat dedicated.

Oh and it looks like the vote is swinging towards C @ 70% right now

Define "learning C". :)

Yes, you might understand the syntax and structures after a week, but you could still be utterly baffled by memory management problems for many months after.

Which is why I'd recommend starting with something simple, mastering it, then moving up.
 
Define "learning C". :)

Yes, you might understand the syntax and structures after a week, but you could still be utterly baffled by memory management problems for many months after.

Which is why I'd recommend starting with something simple, mastering it, then moving up.

In the "Learn C on the Mac" book there is a chapter where the writer makes a dvd cataloging program using structures and malloc() free(). Then later writes it to a file. I personally found it easy enough to follow along, it is a modern book, and in my opinion, teaches good clean code with #defines to make code easy to change. Some of the later topics were over my head at the time, but I just moved on to Objective-C and iphone programming and I turned out just fine. I read this LCotM less than a year ago and I have 2 apps on the iTMS and another one in review right now that is much more impressive than my current ones.

EDIT: I didn't want to get all nit picky, but you can't "Learn Cocoa" without "Learning Objective-C". Cocoa is a framework, a lot of it GUI, that is written/accessed through Objective-C. Also I'd like to say whomever voted for C# C++, you either don't care and are just being different, or you didn't read what the OP wants to accomplish.
 
In the "Learn C on the Mac" book there is a chapter where the writer makes a dvd cataloging program using structures and malloc() free(). Then later writes it to a file. I personally found it easy enough to follow along, it is a modern book, and in my opinion, teaches good clean code with #defines to make code easy to change. Some of the later topics were over my head at the time, but I just moved on to Objective-C and iphone programming and I turned out just fine. I read this LCotM less than a year ago and I have 2 apps on the iTMS and another one in review right now that is much more impressive than my current ones.

Sounds like that approach has worked well for you, well done! I've been coding a hell of a lot longer than that, and have yet to finish anything for the App Store (I'm hoping that's laziness/lack of free time rather than ability! :) )

I don't have any problem with learning C first, I just don't think it HAS to be C first. I've seen a hell of a lot of people struggling with C memory management bugs and getting frustrated; for these people I'd suggest at least starting with a simpler language.
 
I think it would probably be best to finish the book you are working on now, then learn standard C, because you will eventually need it on the Mac anyway. Assembly language itself is nearly useless in this day and age, but learning it has definite merits, in much the same way as learning metallurgy is important for welders. You would not actually have to write any assembly language programs, but it would help you understand what is going on underneath.

After that, you can explore other languages and find out what suits your needs and interests. 15 is a good age to start, that is how old I was when I first learned programming. Be patient, do not try to do it all at once.
 
I don't have any problem with learning C first, I just don't think it HAS to be C first. I've seen a hell of a lot of people struggling with C memory management bugs and getting frustrated; for these people I'd suggest at least starting with a simpler language.

I think this speaks to the point of why this poll question is fairly useless. People learn differently. Probably the worst thing that could happen is that a potentially talented programmer gets discouraged early and gives up (unless of course programming really isn't for them--then the sooner they figure this out the better).

People want to get different things out of programming. Some like coding really close to the metal, others like working with high level abstractions that allow them to do complicated things quickly. Some people are really passionate about programming specifically for Apple platforms, others want to program professionally where knowledge of many languages and technologies is critical. Some are interested in pursuing programming as a hobby and having "fun" is the prime motivation.

That's why there's no universal answer to this question. The answer will vary from person to person depending on their goals and learning style. Given these variables, I have a few suggestions based on some over-simplified stereotypes derived from an aggregate of the many similar threads on this subject:

Hit the ground running This person wants to get up and running on Apple technologies quickly and will get discouraged if they aren't able to start working with Interface Builder making simple GUI apps relatively quickly. I say go for the Kochan-Hillegass Route. After you've satisfied your need to make "physical" things and see the basics of how apps are made, come back to C and invest the time and energy into mastering the details of how everything works.

Meticulous This person is very detail oriented and wants to build from the ground up; they are patient and don't want to move on to the next thing until they've mastered what they've covered. This person should probably start with C or possibly even assembly.

Broad and Diverse This person's ultimate goals is learning a range of languages, but they like to start off with the easier concepts, and dig deeper into the details after they understand the high-level concepts. I think Python is a great language for this type of person. They will have fewer syntactical issues to deal with and will be able to write code that works on a variety of platforms. Once they feel comfortable solving problems with code they can move on to lower-level languages.

These categories are neither perfect nor exhaustive, but hopefully they are helpful in giving someone trying to figure out how to start some direction (because honestly, with such a diversity of languages figuring this out can be daunting).
 
Not exactly on topic, but my App was approved today!! I'll post a link to my video overview of it soon.

Congrats. It is not exactly off topic either. There appears to be good money in iPhone apps, which are Cocoa. Could be a good place to start.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.