Live data from Hacker News

Ask HN: Learning C

news.ycombinator.com

41–50 of 66 posts

Re: Ask HN: Learning C

#42
post #3

Sure! Knowing C can definitely help with your overall understanding of how things work. It's especially helpful when learning new languages. I uploaded a copy of K&R ANSI C for you. In my opinion, it's probably the best way to learn it. http://whitepaperclip.com/files/ansi_c.pdf Have fun!

Unfortunately K&R is all-rights-reserved copyright by Bell Labs, so this is illegal. It's also a bit ironic that you have this at the bottom of your own website:

    © 2005-2009 White Paper Clip, Inc.
    All Rights Reserved. Stealing leads to beatings.

Re: Ask HN: Learning C

#43
post #25

Best beginner text after K&R is Kelly and Pohl's "A Book on C"; very newbie friendly and at the same time uses traditional C examples (i.e. memory management, serializing and reading-back record-oriented data stored in structs, file and directory manipulation, string manipulation, etc.) Most other C books will just treat it as a stepping stone for C++ which is a different beast, and a few awful offenders will stretch…

> Best beginner text after K&R is Kelly and Pohl's "A Book on C";

That's the book I used to teach myself C and I though it was just brilliant.

Re: Ask HN: Learning C

#44

Just about everybody who answers this will say that K&R is good, and I agree, but in addition to this I found that learning the basics of assembly was helpful. You can really see what's going on with the stack, what a pointer really is (pointers are really the only tough part about learning C, everything else will be the same old same old if you already know how to program), and the difference between a system call a…

what do you recommend for understanding assembly?

Re: Ask HN: Learning C

#45
If you can program well in C, everything else seems like both a blessing and a compromise.

While K&R is great, my copy is far less used than Pointers on C by Ken Reek. If you can find a cheap copy I highly recommend it. If you are working through K&R make sure to do each of the sample problems. The text is just the support to let you figure out how to do them.

Re: Ask HN: Learning C

#46

Just about everybody who answers this will say that K&R is good, and I agree, but in addition to this I found that learning the basics of assembly was helpful. You can really see what's going on with the stack, what a pointer really is (pointers are really the only tough part about learning C, everything else will be the same old same old if you already know how to program), and the difference between a system call a…

what do you recommend for understanding assembly?

I used a book called "Programming From the Ground Up," which is not comprehensive but it teaches you the basics, which is really all you need for this purpose. It's online somewhere.

Re: Ask HN: Learning C

#47
If you've got the time, I highly recommend taking CS107 at Stanford (for free): http://see.stanford.edu/see/courseinfo.aspx?coll=2d712634-2b....

I became incredibly comfortable with C -- memory management, handling pointers, having a very clear picture of how types are represented in memory -- after taking that course. The lecturer (Jerry Cain) is fantastic as well.

The course changed this year so I don't have any thoughts on the current CS107 offering if you plan on taking it through their online course offerings for pay. The lectures, syllabus, and materials on Stanford Engineering Everywhere (OpenCourseWare at Stanford) are all from the course I took two years ago.

Re: Ask HN: Learning C

#50
post #4

C isn't hard, don't worry! It's actually a fairly simple language. But it's medium/low-level and there is a lot of power within its simplicity. Fast to learn, but a long time to master, as one might say. I don't know what people are using to learn C these days, but the standard has always been the white book http://www.amazon.com/Programming-Language-Prentice-Hall-Sof... You will find yourself spending more time thin…

Indeed, the problem with C is just that. Once you understand how it works, you'll realize it's just a thin abstraction layer over assembly language. It really is just that simple. My last job was almost purely C, and what made C "scary" at times were: 1. naming conventions. I don't know why C programmers use the strange names that they do. 2. macros. C macros are a pain to read and follow. I hope things will be easie…

They use the strange names that they do because a function declared in C is declared everywhere in the whole program. They use strange names to try to stay out of your way; i. e. it would be really bad if two functions had the same name.
Post reply on HN