Learning C and Objective C... advice?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Learning C and Objective C... advice?

Post by Luke »

Hey y'all! Long time no post! I've decided to venture into the wonderful world of C and eventually Objective C. I bought a book on Objective C which gives kind of a crash course in C, but I would actually much prefer to build my objective c knowledge on a solid foundation of C. So, can anybody suggest some good ways to learn C properly? The first language I ever learned was PHP (unless you count my rudimentary knowledge of javascript in the late 90s, which I don't) and I feel like coming from a PHP background has spoiled me as a programmer in a lot of ways. I know much less about how things work under the hood than I really should and that is one of the major reasons I want to learn C. So... can anybody point me in the right direction? This forum basically taught me how to program properly so I trust you guys to steer me right!
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Learning C and Objective C... advice?

Post by Weirdan »

Kernighan & Ritchie is a never fading classic.

Dabbling into microcontroller programming might have some benefits as well: you'd be exposed to a lower level of a simpler architecture, learn some C (and soldering :) ) and could create something useful, all at the same time.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Learning C and Objective C... advice?

Post by Luke »

Weirdan, I spent probably 3 or 4 hours last night reading about assembly programming concepts. I had downloaded this book on programming C and it mentioned assembly a few times, which got me curious. So I started reading about assembly and before I knew it, hours had passed. But it was interesting stuff. I certainly am learning how much I don't know :-D
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Learning C and Objective C... advice?

Post by Weirdan »

Life is too short to code in assembly, but knowing basics never hurts.
User avatar
mecha_godzilla
Forum Contributor
Posts: 375
Joined: Wed Apr 14, 2010 4:45 pm
Location: UK

Re: Learning C and Objective C... advice?

Post by mecha_godzilla »

Because C itself is fairly minimal, you should be able to pick up the basics very quickly - having just started programming in C myself, I've found that many of the design decisions in PHP have been directly influenced by it. That said, I have two C books to hand and neither of them gets beyond basic command line operations (even after several hundred pages). To really understand C in modern usage, I think you need to find yourself an open source/free project and start learning how to use libraries - maybe start with an audio player project, something that will make extensive use of libraries, file i/o operations, etc. Just make sure that the project is about something you're interested - music, graphics, emulation, whatever - so that you have some incentive to really spend time learning about it. I submitted my first patch for a free software project after I found that the audio export function worked in earlier versions of the software but not later ones, and wanted to fix that issue.

At around the same time I started learning Objective C as well, but it made *no* sense to me at all given what I knew about C by that point - and prior to that I had a reasonably good understanding of assembler from some Z80 development and PIC microcontroller projects.

Mecha Godzilla
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Learning C and Objective C... advice?

Post by McInfo »

If you have hours to spend watching lectures, Richard Buckland's computer science courses on YouTube are an excellent starting point for learning C. Watching those videos and carefully reading "The C Programming Language" by Kernighan and Ritchie (ISBN 0-13-110362-8) should give you a solid understanding of the language.
Post Reply