3 ms·
C. Often people don’t learn anything about a language’s internals, or a computer’s internals, when they learn a “nice” language with garbage collection and dyn
by dblotsky 9y ago
C.
Often people don’t learn anything about a language’s internals, or a computer’s internals, when they learn a “nice” language with garbage collection and dynamic typing and massages. IMO for long-term software engineering that stuff is important to know.
Many see C as this old, outdated, uncool language, and never even realise that so many other languages are written in it.
But really, when it comes to perf and correctness, it’s still king:
- Often you can try to optimize a simple python program to make it run faster... or you can rewrite it in C and get a 1000x boost for free
- It has compilers that have proofs of correctness
- There are many tools that can prove a C program’s correctness
- It’s still the best way (IMO) to learn how the computer works while learning the language
- It doesn’t have OOP (which makes me sad), but you can get there by writing C++ as “C with classes”
- It probably has the most job security guarantees of any language: it will be a looooong time before C goes away
- It’s so standard and supported, programs from 40 years ago still run today; I don’t know if you can say that about any other language (except like, COBOL)
- jstimpfle 9y agoI get much of the effortless correctness (at least the "seems to work" type of correctness) by not trying to do OOP. Frankly that's a mess, especially when trying to emulate it in C. Instead I use simple data table driven control flow, global state, etc.
- 52-6F-62 9y agoI'm presently working my way through Kernighan and Ritchie, and the more I dig in, the more I enjoy it. I love the large feature sets with some other languages for certain projects, but the small size of C makes it easy to wrap one's head around the basics. The extended learning comes from problem solving due to specific limitations. My biggest beef is probably a little to do with number sizes (64b ++), but I just haven't learned the best method for dealing with them. I'd dabbled in it before, but this book really does open it up wide. And the potential for working with embedded devices in a more profound way, it can't really be beat, no?