Found in 30 comments on Hacker News
redis_mlc · 2021-04-23 · Original thread
Just learn C by reading and working through the K&R book. (It's one of the best CS books ever written.)

Also, there's nothing magical about pointers - scripting languages use "handles", which is the same thing except they're read-only to the end-user programmer.

The real challenge with C is multi-threaded programming, so don't do that if you don't need it.

_osorin_ · 2022-10-08 · Original thread
I would like to take it a step further and ask a question that has been bothering me a while. On my time in the academy I studied the following two books (regarding C):

[1] Advanced Programming in the UNIX Environment

[2] C Programming Language

In combination with other classes (and books) on networking, operation systems, data structures we covered a big variance of use cases with C. My question is: How do I take this to the next level? For example I feel I never missed a concept from those classes but when I see C code posted on a thread here it's probably something completely unreadable and complex. Can anyone provide resources to advance a little? What should I study if my goal is to make good and useful modern C software?

I feel like my typing is a bit abstract but I will be happy to clarify.

PS Yes, I've heard of C++ and Rust ;P

whydoyoucare · 2019-12-03 · Original thread
As far as I know, prices of books differ between rich and developing nations. For e.g., The C Programming Language that costs $50 in the US [1], is sold for Rs. 259 (~$4 US) in India. I believe that is the case with most "economy editions" specifically targeted at developing nations. It certainly isn't an "year's wages".

While I do understand your point, it still does not justify encouraging modern-day Robinhoods' and breaking the law.

[1] [2]

lossolo · 2017-05-07 · Original thread
I don't share your opinion and most people I know that do C do not share it also. It's good base to get familiar with language, no one say you can't expand your knowledge further after reading this book.

I've read some other "modern" books about C like "21st century C" but they are not for people that do not know C and they are not so good for people that know it.

Can you provide any arguments to support what you wrote? What alternative you would propose for learning C?

Read what majority of opinions say. It's really easy to criticize without giving better alternative.

jasonlhy · 2017-04-20 · Original thread
C is a very "strict" language. It do the right thing only if you write the right code. It has many undefined behaviors. One of the undefined behaviors I found when I studied the compiler course. The purposed grammar from allows this kind of structure, there can be statements after the switch but before the case labels. gcc also accepts this, but those statements will not be executed. Note: code modified from

#include "stdio.h"

int main () {

   /* local variable definition */
   char grade = 'B';
   int a = 1;

   switch(grade) {
      printf("great!\n" );
      a = a + 1;
      case 'A' :
         printf("Excellent!\n" );
      case 'B' :
      case 'C' :
         printf("Well done\n" );
         printf("a: %d\n", a);
      case 'D' :
         printf("You passed\n" );
      case 'F' :
         printf("Better try again\n" );
      default :
         printf("Invalid grade\n" );
   printf("Your grade is  %c\n", grade );
   return 0;

pdog · 2016-12-22 · Original thread
Why did people think otherwise? Chapter 5 of K&R[1] is titled Pointers and Arrays and basically explains that arrays and pointers are equivalent.


bra-ket · 2016-10-08 · Original thread
I learned programming without a computer in the 90s with Kernigan & Ritchie "C Programming Language", one of the best coding books ever written:

I'd also learn SICP:

and algorithms from either CLRS or Skiena Algorithm Design

What's the rush?

Learning C is difficult because you need to know how the machine actually works. Trust me, there are no shortcuts. The year can be 2036, learning C will be the same.

With that said, these books are excellent:

percept · 2016-03-04 · Original thread
I looked forward to a complete chapter on IO (not unlike, but didn't see one.

Perhaps a future edition...

echeese · 2015-06-23 · Original thread
You can get a copy here:
sgt · 2015-03-05 · Original thread
For those of you who are not familiar with "The C Programming Language" (also written by Kernighan), see:
kgabis · 2014-06-24 · Original thread
It was released years ago:
angersock · 2013-11-15 · Original thread
Some helpful starting points:

Learn about the Unix Way:

Learn about crufty neckbeard stuff:

(cat-v has all kinds of interesting things)

Learn C:

No, really, learn C:

Learn about networking with sockets:

(it's in C, but the principles are in other language bindings as well)

Devops/sysadminning is mostly just damned superstition and voodoo and hard-fought experience...that said, consult notes from others:


If you want more hands-on experience, setup a VPS and make something:

If you find stuff in there you don't understand, ask your devs for help.

chadnickbok · 2013-06-02 · Original thread
As many people have said, no, you're not too old to get started. And despite what some people might say, a multi-year degree program, with a decent GPA, is a great way of showing employers that you're a decent potential candidate.

That said, software engineering is one of the fields you can get employment without a degree, provided you can 'show your work'. The hard part is building up your skills in a way that can easily be demonstrated. The common wisdom these days is to create a github profile, build some interesting things, commit to some open-source libraries, and use your profile as a resume of sorts.

Here's interesting article on being a well-rounded programmer:

We're also in a 'golden age' of self-guided learning, with online tools to help learning galore, here are a few:

Also, get a few decent books on "Programming 101". Common wisdom suggests you learn C, one of Ruby/Python, Java, and a functional language like Haskell. Here are some good books to learn from:

The C Programming Language (some people say you should start here, I'm one of them!):

Learning Python:

Learning Java:

I hope you do choose programming as a career, its been very rewarding for me :)

robomartin · 2012-11-27 · Original thread
OK, if you don't have any real experience in low-level embedded coding (relevant to device drivers), RTOS or OS design in general, file systems, data structures, algorithms, interfaces, etc. And, if you have "hobby level" experience with Assembler, C and C++. And, if your intent is to write a desktop OS, from the ground up, without making use of existing technologies, drivers, file systems, memory management, POSIX, etc. Here's a list of books that could be considered required reading before you can really start to write specifications and code. Pick twenty of these and that might be a good start.

In no particular order:






















































54- ...well, I'll stop here.

Of course, the equivalent knowledge can be obtained by trial-and-error, which would take longer and might result in costly errors and imperfect design. The greater danger here is that a sole developer, without the feedback and interaction of even a small group of capable and experienced programmers could simply burn a lot of time repeating the mistakes made by those who have already trenched that territory.

If the goal is to write a small RTOS on a small but nicely-featured microcontroller, then the C books and the uC/OS book might be a good shove in the right direction. Things start getting complicated if you need to write such things as a full USB stack, PCIe subsystem, graphics drivers, etc.

kaolinite · 2012-03-08 · Original thread
As you're interested in electronics you may be interested in Arduino, which you can program in C (and perhaps some other languages too). If you do decide to pick C, I'd really recommend picking up a copy of K&R's "The C Programming Language":

You're also interested in games, so you could consider Python and the PyGame library: Or if you want to go with C, try the allegro library: (Learning this library was what taught me C, after picking up the basics of C I picked up the rest as I went along).

End of the day though, just pick something and learn it. It's better to be learning than worrying about what to learn.

whamill · 2012-02-10 · Original thread
Basically the book for that language which is considered 'The Bible' by its developers. The K&R book for C ( or the Camel book for Perl ( are this type of book.
andymoe · 2011-11-07 · Original thread
Joel likes the sink or swim approach apparently.

The first book, Code - Charles Petzold, is only ten bucks on the Kindle right now (SOLD) and I own the other two.

I remember SICP being like 90 bucks for my hardcover copy and I'm pretty sure I bought it after reading the Joel on Software article "The Perils of Java Schools" while I was loving life as a bank IT guy so this is workable advice. It only took five years to become a "real" programmer after that. Also I sure don't remember K&R being $68[1]. (Yes I know SICP and K&R are both online for free)



wyclif · 2011-10-30 · Original thread
I would be far more impressed and gratified if Prentice Hall were cool enough to offer Kernighan & Ritchie's classic "C Programming Language" (2nd Edition) at 1/2 off their $57.99 sticker-shock price.

nswanberg · 2010-12-17 · Original thread
Here's the slightly modified answer I just posted there (even though it's an old question):

Back when he was still doing podcasts Joel Spolsky answered the similar question, which was partly "Does a good programmer without a CS degree really have a chance to get a job at Fogcreek?[1]" (It's near the end of the page.)

He says that for a good self-taught programmer who began with a high-level language, say PHP or Java, who comes at programming from a practical perspective, there are a few important parts of the CS curriculum the person may have missed out on, and goes on to list some books that would help fill in those gaps.

Off the top of his head he named these books in about this order:

- Structure and Interpretation of Computer Programs[2] (also free online[3])

- C Programming Language[4]

- The Unix Programming Environment[5]

- Introduction to Algorithms[6]

He said that those books covered the aspects of the CS curriculum his company needs in a good programmer, e.g. being able to create algorithms for an uncommon data structure.

Those books all have the added advantage of having exercises, and all being a very pleasant read. SICP is an introduction to many of the big ideas in CS: data structures, streams, recursion, interpretation, compilation, register machines, etc., and their implementation in Scheme (a kind of Lisp). It's a great place to start. The next two focus on implementation details like pointers and memory allocation. They are compact, powerful books. The last, Introduction to Algorithms, seems misleadingly titled, as it is fairly comprehensive and used in both undergraduate and graduate courses. If you work your way through the entire book, chapeau!







markerdmann · 2009-10-24 · Original thread
The classic C book is The C Programming Language by Kernighan and Ritchie (
jonke · 2009-05-07 · Original thread
This is like a never ending issue. One way to start the path to a better practice of C is to read after you finished
tumult · 2009-04-26 · Original thread
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

You will find yourself spending more time thinking about programming concepts rather than dealing with C syntax, since it's pretty concise. I don't know how difficult it is to learn about pointers if you have already been programming for a while but haven't had to use references directly, but it's very important to learn. C does not do too much for you on its own, so handling references yourself is an important skill. It will also help you understand how higher level languages and concepts work.

If you are working through it and find that you're enjoying yourself, congratulations, you're a programmer :] Then it's time to pick up the 1st volume of Knuth and start working through that.

Fresh book recommendations delivered straight to your inbox every Thursday.