Books and advice?
Hi, i'm new to C but not to programming, i used to write basic on my C-16 when I was about 9 and then I did pascal at college so I have a good understanding of variables, arrays, loops etc. It was a long time ago (over 15 years) since I wrote programs in pascal or any other language except for bits of php, html and css that I have scripted on my website. I've decided I want to take my website to another level by creating an ipad/iphone app that people can use to listen to my music etc.
So, i've decided to start at the beginning with C and i'm currently on chapter 1 of 'The C Programming Language 2nd Edition' Prentice Hall (1988). I have decided to start with C to brush up on coding practices and to get to grips with the commands that are used in Cocoa and x-code. (Am i right in assuming that they are very similar)
Anyway, i just want some advice from some more experienced programmers as to what books to read and use after I finish the Prentice Hall book. Also would you say that it is best to learn C first before moving onto cocoa or would C ++ have been better. I only chose C as that book looked really good.
At the moment I'm struggling with the exercises so i've been picking up the answers on the net and then re typing (not copy/pasting) them to learn the answers and solutions and also examining the code and working out what does what. It makes sense when I read it but i'm not at the point where i can confidently write code myself.
Any help or advice is much appreciated.
Is it better to learn C as a prerequisite to learning C++? No. In fact, it might just make matters worse.
If you're going to learn both languages, then there is likely no difference to what language you learn first.
I can't give you a "C or C++" answer as even though they seem alike they both have their own place in the programming world.
I can, however, suggest that copying solutions to problems is not going to teach you how to solve the problem... It's like kids these days who can't do math without a calculator. They know how to get the answer but don't know how the answer is reached. What you really need to do is work on understanding the problems, working out your own solutions, even if they are radically different than those in your book and coding them successfully in C (or C++, at your discretion). The overarching truism here is that no programmer --no matter how skilled or experienced-- can ever code the solution to a problem he doesn't understand.
Like you I've done the BASIC - Pascal - C progression. I initially thought I'd brought most of the necessary skills forward with me but rapidly discovered that about half of what I knew from previous languages wasn't very helpful here. I then resigned myself to learning C from scratch, was very careful not to compare it with previous experience and then it began making sense to me. It may look a lot like Pascal, but it don't work nothing like Pascal and it took a while to realize that.