TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Recommendations to Learn C from a Ruby Programmer

4 pointsby slyvalmost 12 years ago
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!

5 comments

tonteldoosalmost 12 years ago
A couple of throughts from someone who recently moved from C (plain vanilla) to Ruby:<p>1] O'Reilly has a sale on C e-books on that expires today - have a look at them (<a href="http://shop.oreilly.com/category/deals/c-owo.do?code=WKCPRG" rel="nofollow">http://shop.oreilly.com/category/deals/c-owo.do?code=WKCPRG</a>)<p>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.<p>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).<p>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.<p>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.<p>Good luck - hope this helps :)
a3nalmost 12 years ago
When I learned C it was in the air. Everyone around me was using C at my jobs.<p>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<p>The best thing you can do is work on some really hard shit for a long time with a smart set of colleagues.<p>My first book was K&#38;R &#60;glances up at bookshelf&#62; but my favorite was Harbison and Steele &#60;glances up at bookshelf&#62;. These days probably one of the O'Reillys is good enough.<p><a href="http://www.faqs.org/faqs/C-faq/" rel="nofollow">http://www.faqs.org/faqs/C-faq/</a><p><a href="http://c-faq.com/" rel="nofollow">http://c-faq.com/</a><p>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.
macarthy12almost 12 years ago
Try Zeds <a href="http://c.learncodethehardway.org/book/" rel="nofollow">http://c.learncodethehardway.org/book/</a>
czbondalmost 12 years ago
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.
评论 #5783987 未加载
ksherlockalmost 12 years ago
Look through the ruby source code.