HACKER Q&A
📣 aa6ll

How to be a good C programmer?


I’m 20. Self-taught.

I’ve been through some hoops of python and JS, but nothing professional.

I want to make software. I know making awesome software will take time, and I’m working hard.

C comes to mind as the most adventurous, impactful solution for that.

What are your tips for becoming a better programmer in c?

I want to know what should I focus on early on? What are good practices? How to deep dive into contribute to open sorce?

Currently reading Modern C by Jens Gustedt.


  👤 heartag Accepted Answer ✓
This isn't really advice, but I just want to say I sympathize. I struggled quite a lot in learning C and C++ back in school. The thing that wound up helping most was to pick one or two projects that I actually wanted the results of (in my case, software to resurrect an old pen-plotter). That kept me going when other tasks like following along to "blink the LED on Arduino" tutorials just left me languishing.

👤 borlanco
That's easy. After learning the language, study good C code. Try to grok how the masters build higher-level abstractions.

Learn from widely used C code that is not a toy. Examples: sqlite.org, git-scm.org

If you don't understand something, look it up in the C standard doc.

Most of the time, you will want to program for speed, and C will let you. Learn and practice C profiling.

Also, you will need to learn defensive programming. The best source about this is "Learn C The Hard Way" by Zed Shaw: https://github.com/zedshaw/learn-c-the-hard-way-lectures