Do you recommend learning C?

Hi everyone! I have been in the professional industry for ~2 years now coming from a boot camp. I started a base foundation by programming heavily with JavaScript. I have various full stack experiences, and love learning everything related to computers + tech. I have recently been heavily invested in learning all about Linux, cloud development, + Elixir (random side note).

That being said, because of my background, I sometimes feel like I am behind in the core fundamentals in CS. I first started to learn programming and have the most experience with JavaScript, but sometimes I feel like it has not provided me with the solid foundation to become a proficient back end developer. I have been putting a lot of effort on data structures and algorithms (not the best but I really enjoy learning about these) and have been trying to build a solid cs foundation for myself.

Do you guys recommend me learning C to gain a more solid understanding of fundamental computer theories / how computers think? If so, I would really appreciate some of your recommended resources to get started! Thanks again for reading and any advice you have! If you recommend any alternatives I would appreciate that as well!

3 Likes

I am not 100% clear on your goals – they are rather vaguely stated. If you want to go the lowest possible level before reaching for assembly and machine code then sure, C can teach you how are things done in x86 / x86_64 land (not very sure it can teach you much about platforms like ARM and MIPS but it probably could). Can be useful if you are very much into programming various IoT devices, car mini-computers and in general devices where even slightly higher-level system languages (D, Rust, Nim, Zig) are a no-go – but mind you, that gap is being eliminated little by little every month.


Now for my opinions.

If you want to go low level I recommend learning C only to an extent and then reach for Zig. It’s an amazing language aimed to directly compete with C and recently its author also added very valuable integration with C compilers. I strongly recommend reading this article, it’s very insightful both for C and Zig compilation!


Kudos for reaching for Elixir. It’s a secret weapon for many (myself included) and is generally underestimated – but it has a runtime (well, Erlang has, but Elixir gets it by the virtue of stepping on Erlang) that all other languages out there can only dream of: transparent green thread multiplexing on all CPU cores/threads, lag-less operation, predictable performance even under heavy load, supervision trees / auto-restarts on minor failures, message passing between actors/processes… These are things that I and many others tried to make in C++, Java, PHP, JS, Ruby, Python and other languages over the courses of our careers – and failed every time, while Erlang has been there all along.


…If you are looking for code much faster than JS, natively compiled, and with strong static typing then definitely go for Rust. As much as I love Elixir and always will, Rust beats it in no small amount of areas: it has an absolutely fantastic community (Elixir as well; it’s one of the best communities I ever participated in!) – very smart and experienced people, amazing documentation (their official online learning book has different styles depending on if you prefer to read more or exercise more), and they are very keenly aware of the shortcomings of the language compared to stuff like C++ and Java and are working day and night to erase the gap. There is a huge amount of libraries, like anything you can think of is 99% likely already there (sadly not the case for Elixir). They are also working on having a runtime like Erlang’s (the BEAM VM) but sadly that seems far away from happening just yet – no wonder, the BEAM is 30 years old. Rust can get compiled on a plethora of platforms as well. Not as wide-reaching as C but it’s pretty close.


Haskell and OCaml are other very strong contenders. But have in mind that, especially with OCaml, you will mostly be learning on your own – there are a ton of resources out there, mind you, but stuff you take for granted (like UTF-8 strings) you have to specifically take care of in those: they have libraries for them but in general you have to be much more explicit in what you want. And those languages’ strong points do require heavy upfront learning investment to become really good at (especially Haskell’s monads).

I sit somewhere a bit higher on the stack; I’d like some things to be baseline and then build on top of that (Elixir and Rust have UTF-8 strings built-in, for example). But, you know, preference.

In case it matters, in the last several years I worked exclusively with Elixir and just recently started a job with Rust. These two languages can cover like 99% of everything I ever needed in my 18.5y of career.


Lastly, to answer the title: I recommend learning C only to an extent. Learn pointer arithmetic, learn basic vtable dispatch (emulating the OOP class/method constructs), learn stack buffers and heap memory semantics. But don’t tarry on C. Just go for other languages – Rust is my top recommendation.

Hope this helps, even if it’s largely a personal take on the topics you raised.

6 Likes

Good question and great reply by Dimi :smiley:

You could also try some articles like this one: https://www.tutorialspoint.com/basics_of_computer_science/basics_of_computer_science_quick_guide.htm to see if that helps fill any of the blanks?

3 Likes

Wow… Thank you for your amazing response. I appreciate it so much. Apologies if my original goal in mind was stated very vague. Since I was originally taught programming in a way to get a job as fast as possible, learning JS, various web frameworks, NodeJS, etc. I feel like I have a gap of knowledge between myself vs “CS majors and MSCS” programmers in terms of my knowledge of theory + “core CS fundamentals” . I’ve been trying to fill that gap recently, by teaching myself various CS fundamentals and was just curious to the best way to approach that. I wanted to note I really enjoy learning and teaching myself these fundamentals in my free time (vs. forcing myself to do this). Also worth noting I have been doing fine at my current job in terms of performance. These are just my own internal thoughts.

My thoughts are still all over the place and I’m rambling, but you definitely helped me with a starting place! I guess Impostor Syndrome still sets in every once in a while :smiley:. I appreciate your help! You are definitely right about the Elixir community though. I have been starting to try and get more actively involved and it has been an amazing experience so far. Thanks again for the thorough insight and sorry again if my thoughts aren’t completely clear.

4 Likes

Great! I will definitely check that out. Thanks!

2 Likes

I also performed quite fine with imperative languages but… there was always something missing. I was keenly aware that I was riding on the shoulders of giants and had no real idea how stuff below worked (well, I did because I started with Assembly and C about 19y ago but I don’t know how the JS runtime works to this day). I wanted to know how the engine under the hood worked!

So I get the sentiment fully. :slight_smile:

To really bend your brain and learn a bit more about the mathematical side of programming – invest in FP. Doesn’t matter much if it’s Elixir, Erlang, LISP, Haskell, OCaml or what-have-you (although LISP is likely the closest to math and programming at the same time).

I recently bought Hands-On Data Structures and Algorithms with Rust but haven’t read it yet so can’t give you a recommendation for/against it.


The impostor’s syndrome is very real and you should to your best to fight against it. Academic prowess rarely wins the day; it’s the practical people who know technology good enough but are excellent communicators who get the big money in the end.

6 Likes

Do you guys recommend me learning C to gain a more solid understanding of fundamental computer theories / how computers think?

I’d recommend learning C if you want to do serious Linux/BSD hacking. Otherwise, it’s good to have some knowledge of C just for historical context, since so many languages seem to be descendants of C, but you could probably learn CS fundamentals and algorithms with most languages. For example, the famous Wizard Book (Structure and Interpretation of Computer Programs) uses MIT Scheme, which is a LISP dialect.

But if you want to learn C, I’d start with the second edition of The C Programming Language by Brian Kernighan and Dennis Ritchie. They’re two of the Bell Labs geniuses who helped create C and Unix.

4 Likes

I’ve worked as a full stack dev, mostly backend for 10 years and I’ve always wanted to learn more C but it has never made any particular sense for what I’m doing professionally. So no, I don’t believe you need it. I also lack the thorough CS fundamentals as a self-taught dev. I’m doing very well regardless.

Understanding low-level stuff is useful but so is understanding high-level stuff. The key is learning a lot of things I think and your total model of how software works, should work and how you want to build things. I’ve been the specialist backend and server person, not because I specialized but because I’m a voracious generalist.

4 Likes

Totally captured my thoughts perfectly. Thanks again for the great answers and support! I will get learnin :smiley:

2 Likes

Sweet, I’ll check those out! Thanks for the help!!

2 Likes

Makes sense. Yeah I feel such a strong need to learn everything so sometimes it gets overwhelming haha :laughing:

2 Likes

From my perspective knowing C is valuable. Mostly because it is so ubiquitous and is used in so many places and from other languages. I am not a C developer but it was the first language taught at university. (Or rather I think it was a bastardized mixed between C and C++ but more C than C++ and nothing like C++ is today). I don’t write any projects from scratch in C but I do write integration with existing C libraries. I do look at lots of C code (because it is so common everywhere that if you want to know what is going on underneath the hood you must know how to read and understand C).

My level of C knowledge is not high but it is highly valuable so I think the return on investment is pretty good.

4 Likes

This just showed up in my inbox and I remembered this thread :smiley:

Whether you’re new to software development or just looking to fill the gaps in your knowledge, the CS Foundations track teaches you how to solve the problems that professional programmers face every day.

50% off if you buy all three titles via the link here: https://pragprog.com/promotions/

Titles:

@dimitarvp Nice and informative answer!

What do you mean by a runtime like BEAM? Is there some project like that in progress. If so, I’d love to know more about it, since Rust is my second favorite after Erlang/Elixir. I know about things like actix, the actor framework for Rust, but didn’t hear about an effort for a full-fledged BEAM like runtime.

1 Like