

Ask HN: Recommendations to Learn C from a Ruby Programmer - slyv

Hey all - I am going to be needing to program a lot in C in the near future, and am looking for some good recommendations to get me started from the basics of the language to how to program advanced topics in C. I've never really worked with a low-level language like C, mostly working with Ruby to develop scripts and web applications. I am now needing (and wanting) to learn C.<p>What are some good tutorials to start learning C? I would prefer ones freely available online right now to begin with so I can start programming in C right away. But, any book recommendations are also highly valuable. How did you (if you have) learn C to begin with? Are there any standard tutorials for C?<p>Any help would be incredible. Thanks!
======
tonteldoos
A couple of throughts from someone who recently moved from C (plain vanilla)
to Ruby:

1] O'Reilly has a sale on C e-books on that expires today - have a look at
them (<http://shop.oreilly.com/category/deals/c-owo.do?code=WKCPRG>)

2] Your biggest hurdles will be going from object coding to procedural coding,
and going from dynamically typed to statically typed variables. Focus on these
topics.

3] Once you have the basics of C, start focusing on dynamic memory usage
(pointers, etc) as soon as possible. It's one of the most difficult topics
(especially for someone that's only used managed languages), but also one of
the most useful and powerful features in the language (and also the source of
much pain if not done properly).

4] A possible way to start coding immediately, is programming C plugins for
Ruby. MRI is very well suited to this, and will cover quite a bit of ground
from points 2 and 3 above. There are heaps of tutorials available too.

5] As far as online tutorials go, there are many, and most tend to cover the
same ground. Find one that you're comfortable with, and just do it. For the
moment, focus on syntax and language elements, but DO NOT neglect to look into
the fundamentals of how C actually works at compiler level at some point. It's
an amazingly internally consistent design, and will make understanding and
using some features a lot easier.

Good luck - hope this helps :)

------
a3n
When I learned C it was in the air. Everyone around me was using C at my jobs.

I learned C by programming in C, talking to my neighbors, and obsessively
reading comp.lang.c. That used to mean usenet, but these days most people will
get to it via Google: groups.google.com/group/comp.lang.c

The best thing you can do is work on some really hard shit for a long time
with a smart set of colleagues.

My first book was K&R <glances up at bookshelf> but my favorite was Harbison
and Steele <glances up at bookshelf>. These days probably one of the O'Reillys
is good enough.

<http://www.faqs.org/faqs/C-faq/>

<http://c-faq.com/>

These days I don't think I could program my way out of a paperbag with C. But
I did like it a lot back then.

------
macarthy12
Try Zeds <http://c.learncodethehardway.org/book/>

------
czbond
Objective C, C#, or C++? (I'm guessing Objective C ... Ios_)? C is a great
language, especially coming from Ruby. It's more structured than Ruby, which
is closer to Perl. C is more lenient than Java, but still a heck of a lot of
fun.

~~~
frostmatthew
It's pretty clear the OP is asking about learning C, not any of the higher
level derivative languages you mentioned.

To the OP: while I sadly don't have any resources to recommend I do applaud
you for tackling a lower level language like C, I think you'll get a lot out
of it. Best of luck!

~~~
czbond
It's not clear - and many people who've used other languages simply call all
derivations "C" - when they're clearly different. Also, if you're going to be
a betting person.... is a Ruby person more likely to learn C or Objective C?
Right. So I was in fair ground. :)

~~~
slyv
Heh ;)

For clarification, I was meaning pure C.

------
ksherlock
Look through the ruby source code.

