Hacker News new | ask | show | jobs
by schme 1446 days ago
I'd go with C first. Rust would teach you everything C does and more, but C will lay the foundation in cleaner strokes. This will help you later no matter what language you decide to learn next. C is also in a way the language of the FFI, so you are very likely to need it in the future regardless.
1 comments

Had a feeling a reply like this was coming. Could you help me understand a bit more about why C would be a better place to start and how it’d lead to me growing my skills in core areas vs something like Rust or C++? I hear about C++ and can’t wrap my head around the benefits of going with something like C that has less features. I recognize I’m asking what will help me grow/learn and am saying, “why use this if x has more niceties?” but hopefully you can humor me. One thing I hear a lot is that Rust is the language for the next few decades, and while I’m sure C isn’t going anywhere, I’d be very curious to hear from someone with more experience about why C would be the way to go here. I’ll admit I’m intrigued as I used to have a professor in college who was a wizard and did everything in C — especially since a game I like from 2001 has an active modding community so long as you know C/ASM.

Explicitly: I’d be curious to know what the “cleaner strokes” are.

I also have never even heard of an FFI so thanks for starting my next research binge! I always thought two langs could interact once they’re both compiled to machine code, but I’m guessing i took that for granted and that C does that heavy lifting..

To list something: C teaches memory management, memory addressing, stacks and heaps, some disassembly, binary interfaces. Basically, you see the layer on top of machine language. Python, Go, etc. are a layer on top of that.

Rust and C++ teach these things as well, but C keeps things minimal so you see the ideas more clearly. A lot of languages are written in C, forming a common way to think about implementation and problems, one you see glimpses of working in almost any other language as well. A lot of "why is it like this" questions have answers beginning "because in C..".

The FFI part is due to the extremely stable and simple ABI. Compiling C produces predictable and known binaries, setting a lowest common denominator among languages (for bettet or for worse). Thus knowing the capabilities and limitations of C is useful even when working with other languages.

A lot of this knowledge can be grasped quickly and you will get reminded of them for the rest of your programming life, so it's not necessary to dive deep into C to get the knowledge. C just provides the shortest and cleanest introduction, and you can quickly move forward without missing a beat really, since a lot of the stuff is so universal.

Thanks for the additional info! Very helpful and I appreciate it greatly.