6 ms·
I agree completely about C being the gateway to the computer. It really is the only way to go if you want to learn real programming. That doesn't mean I'm disco
by _RPM 10y ago
I agree completely about C being the gateway to the computer. It really is the only way to go if you want to learn real programming. That doesn't mean I'm discounting JavaScript developers, but I like C better and it's more fun.
- Others 10y agoI think you're right that C is a gateway to learning how computers work. But I think using the term "real programming" in any context is flame bait...
- Koshkin 10y agoSure, with C, you will learn about some "low-level" things about computers that you never will if you only program in most other languages. I am talking about things like memory, bytes, addresses, the stack, binary arithmetic, bit twiddling... But that's pretty much it. Yet, there is much more to how computers work than that, and many (far from all, though) of those things you can only get a feel for if you learn some assembly programming. From there, you will see that C is a high-level, rather abstract, programming language, if only somewhat reflective of the idea of a computer of the von Neumann type. That's all. In the end, even the "machine language", of which assembly is a human-readable representation, today is usually interpreted or otherwise translated into a "true" machine instructions that get executed by the hardware. To get but a glimpse of what is going inside a computer - still on a somewhat high level - take a look at an excellent article by Mark Smotherman at https://people.cs.clemson.edu/~mark/uprog.html https://people.cs.clemson.edu/~mark/uprog.html. If you really want to go deeper, there are transistor-level CPU simulators that run in the browser, such as the famous "visual 6502".
- collinmanderson 10y agoSlightly off topic: The way I look at it, C and C++ are the bedrock of all programming languages, because the popular compliers (llvm/clang, gcc and VisualStudio) are written in C and C++. JavaScript, for example requires a browser to compile, which requires gcc or clang to compile. Python, Rust, etc all depend on programs written in C and C++. Go is one recent exception of a popular language whose main implementation is completely self hosted. Though, Go doesn't host other popular languages.
- rat87 10y agoI hate that way of looking at it because I think it's totally wrong. C (this view is usually presented as only about c) isn't fundamental or bedrock in any way. Most of our current stacks just happen to be written in it. The original Mac OS for instance was written in Pascal and C. The most popular open source compilers are written in c++. Most browsers are written in c++ not in c. And there's no reason these days you couldn't rewrite llvm (a set of compiler libraries and compilers mostly written in c++, not that rust compiler uses llvm for code generation but the frontend is in rust) in haskell or java or javascript(they'd be slower but they would work). Haskell has useful features for writing compilers and a lot of language analysis libraries already. If you re-wrote in in rust it'd be just as fast. Hell this guy (https://github.com/jameysharp/corrode https://github.com/jameysharp/corrode) wrote a rust-c source-to-source compiler in literate haskell. Also in a few years servo will be a full browser in rust and Firefox is already adding components written in rust. Other then os interface & c binary api linking there is nothing special about c or c++.
- collinmanderson 10y ago> Most of our current stacks just happen to be written in it. Sure, there's nothing special about the languages themselves, but _currently_ C and C++ are the foundation for (almost) all other languages. In theory you could rewrite llvm (or use a different complier), but I don't see that happening any time soon. That's why I call it bedrock, because it would be very hard to change. (Though, I do wonder when llvm will stop depending on Python 2 :)
- codygman 10y ago> Go is one recent exception of a popular language whose main implementation is completely self hosted. Though, Go doesn't host other popular languages. It wasn't self-hosted in the beginning, only since version 1.5 IIRC.
- _RPM 10y agoI'm not sure something can be self hosting from the beginning in the context of computing.
- gnaritas 10y ago> I agree completely about C being the gateway to the computer. It really is the only way to go if you want to learn real programming. Nonsense. That's as absurd as claiming assembly is the only way to go if you want to learn real programming. > but I like C better and it's more fun. Which is the only reason you think the above, nothing to do with reality, everything to do with personal preference.