You should learn C because it's a gateway to deeper knowledge. The kernel uses it, about a thousand programs shipped with Linux use it, embedded programming uses it. It helps you understand how lower level network protocols have been designed, how to efficiently use memory, how to design algorithms and why they're harder than you think. There's a crapton of libraries in C, most higher level languages have some extensions to take advantage of them. Sensitive security software will use it, due to various attack vectors that are slightly easier to deal with at a lower level. It's handy and expands your brain. And it's not going away anytime soon.
I can't say I learned much by programming in C, if I even learned anything at all. Mostly I just grumble at the needlessly verbose and complex way of doing some things (e.g. anything with strings) and get annoyed by the syntax and quirks of the language and surrounding toolchain.
It is of course useful for a whole bunch of reasons, including being able to figure out "why does this do X?", but that's not really "deeper knowledge", IMO.
Compared to writing code in assembly language it is a dream, though!
I think C lets you think about low-level details of how systems work, strings being arrays of characters with an explicit terminating NUL character, for example. Although again assembly language gives you _real_ lower-level understanding and insights if you use it.
Time is finite. Learning C is not necessarily aligned with everyone's goals or path. For example, if I care more about building products than low level software it's probably not worth learning C unless I happen to be interested in it.
To me that seem akin to saying "if you just care about running it's probably not worth learning to walk"
It is always "worth it" to understand the machine you are manipulating, and no matter what you think about the C virtuel machine, the very real machine in front of me has been shaped by its relationship to C.
I was able to learn that deeper knowledge without learning C, via Sinclair Basic, Turbo Basic, Turbo Pascal, Z80 and 80x86 Assembly, before eventually learning C.
And it wasn't even proper C, it was RatC at the time.
There are plenty of alternatives to expand our brain in systems programming, and even better they show we don't need to compromise on security to do it.
However, yes one needs to learn C, because it has snuck everywhere and as the COBOL of systems programming languages (ruffly 10 years younger), it isn't going anywhere.
Agreed, it helps you understand what’s been abstracted away from you in many higher level languages. From a security perspective I think you learn to avoid C wherever possible.
Isn’t that the same argument we used to use with Latin? It would be nice if we could all stop time and learn the fundamentals better. However, in the reality we actually live in, most of my coworkers don’t even have time to truly learn SQL, let alone C.
"On my 18th birthday, my girlfriend asked me to drive to Barnes & Nobles. She strolled in, then strolled out at a much faster pace. Then she handed me a copy of The C Programming Language, which she had just stolen..."
(3) She stole his gift instead of investing actual effort to save up and purchase it.
I know the world will always have its share of thieves and liars, but I’m still always a little taken aback when people are shameless enough to celebrate it.
The bare minimum for “marriage material” would have been putting thought into his gift before his birthday, buying it, wrapping it, and surprising him with it.
What a great book! It was my introduction to 32-bit assembly on Linux. Learning AT&T syntax has both its advantages as well as drawbacks. I've noticed a lot of GNU code uses it, whereas reverse engineering literature loves Intel syntax, which is an interesting cultural difference.
> Beej’s Guide to C Programming
> It’s straightforward and to the point.
I'm not saying its a bad book/guide, but with sections like these:
>Before we go on, why would I even begin to bother pointing out that a pound sign is called an octothorpe? The answer is simple: I think the word octothorpe is so excellently funny, I have to gratuitously spread its name around whenever I get the opportunity. Octothorpe. Octothorpe, octothorpe, octothorpe.
It claims to be aimed at programmers who are already proficient in high-level languages, but spends a whole paragraph explaining what code comments are.
Ha! You've got me, "to the point" is going too far. But I should say that it's a relatively quick, light read. Moments like the octothorpe thing actually make the read easier, because the humanity of it makes my brain wake up a little.
Learn enough C so that you can push your module written in Java/Ruby/Python/Node into C, and all the other high level language users can pick it, compile it and use it natively in their language.
Imagine you wrote a new 3D model file-format and all other language users have to load the Ruby interpreter to use it.
> Then she handed me a copy of The C Programming Language, which she had just stolen (though at $80, it’s not clear who was robbing whom to begin with).
No, she wasn't dishonorable. She took the hard route, risking her own security out of love. I condemn theft, not because it's theft, but because it's harmful. In a utilitarian way, I feel like she helped me more than she harmed B&N. In terms of virtue, she displayed bravery and caring.
She just didn't care about B&N or property law. Maybe you do care about those things - I'm not condoning theft here!
Now, if you had said Code of "This Chick Turns Out To Be Completely Insane And This Should Have Been A Red Flag" you'd be closer to the mark, but that's for the next post!
If you want to be a Haskeller, learn some C too. They are fully complementary. The Linux tooling, gamedev libraries, etc you have available if you leverage C is great. And Haskell's FFI and C tooling making it simple.
It is of course useful for a whole bunch of reasons, including being able to figure out "why does this do X?", but that's not really "deeper knowledge", IMO.
I think C lets you think about low-level details of how systems work, strings being arrays of characters with an explicit terminating NUL character, for example. Although again assembly language gives you _real_ lower-level understanding and insights if you use it.
It is always "worth it" to understand the machine you are manipulating, and no matter what you think about the C virtuel machine, the very real machine in front of me has been shaped by its relationship to C.
And it wasn't even proper C, it was RatC at the time.
There are plenty of alternatives to expand our brain in systems programming, and even better they show we don't need to compromise on security to do it.
However, yes one needs to learn C, because it has snuck everywhere and as the COBOL of systems programming languages (ruffly 10 years younger), it isn't going anywhere.
Deleted Comment
Marriage material! :D
(2) She made him an accessory to a crime.
(3) She stole his gift instead of investing actual effort to save up and purchase it.
I know the world will always have its share of thieves and liars, but I’m still always a little taken aback when people are shameless enough to celebrate it.
The bare minimum for “marriage material” would have been putting thought into his gift before his birthday, buying it, wrapping it, and surprising him with it.
1. She turned out not be marriage material
2. Y'all are way too sensitive about a teenage girl who shoplifted one time.
> https://download-mirror.savannah.gnu.org/releases/pgubook/Pr...
There is an updated version of the book from the author: "Programming Under the Hood" or "Learn to Program with Assembly". See[0]
[0] https://github.com/johnnyb/programming_under_the_hood
I'm not saying its a bad book/guide, but with sections like these:
>Before we go on, why would I even begin to bother pointing out that a pound sign is called an octothorpe? The answer is simple: I think the word octothorpe is so excellently funny, I have to gratuitously spread its name around whenever I get the opportunity. Octothorpe. Octothorpe, octothorpe, octothorpe.
It claims to be aimed at programmers who are already proficient in high-level languages, but spends a whole paragraph explaining what code comments are.
I'm not sure it qualifies as "to the point"
Imagine you wrote a new 3D model file-format and all other language users have to load the Ruby interpreter to use it.
Code of Dishonor
She just didn't care about B&N or property law. Maybe you do care about those things - I'm not condoning theft here!
Now, if you had said Code of "This Chick Turns Out To Be Completely Insane And This Should Have Been A Red Flag" you'd be closer to the mark, but that's for the next post!
If you think a corporation is evil, you don’t have to shop there.
Dead Comment
Deleted Comment
Deleted Comment