chasekaylee

chasekaylee

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!

Most Liked

dimitarvp

dimitarvp

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.

dimitarvp

dimitarvp

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.

chasekaylee

chasekaylee

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.

Where Next?

Popular General Dev topics Top

AstonJ
I just watched this: (tldr: remove bad choices so you don’t need to use willpower) It got me thinking about ways to incre...
New
axelson
Can anyone recommend a tmux session switcher? I’ve used https://github.com/siadat/session-finder in the past but it’s not very actively m...
New
AstonJ
Always interested in seeing what apps people use and how they organise their phones/home screens! Here’s mine…
New
mafinar
I always start with excitement and then get busy on 9/10th day. This year, like the year before this, and the year before that, I intend ...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
DevotionGeo
The Odin programming language is designed with the intent of creating an alternative to C with the following goals: simplicity high per...
New
jamiedumont
This is all going to be a bit hand-wavey and straight off the top of my head, so bear with me, but it’s a thought/debate that’s been ratt...
New
dwaynebradley
In their weekly newsletter, Jared Santo from the Changelog shared this blog post by Mark Ericksen over at fly.io: What is really inter...
New
ohm
I just switched jobs to tech lead with a small team of about 6 other developer. This is my first tech lead job. What do I need to know? A...
New
New

Other popular topics Top

Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1139 25582 756
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
OSZAR »