12 ms·
Learn enough C to survive
- the_jesus_villa 4y agoJust a bibliography of some C books
- metadat 4y agoThat's cool, but I am avoiding substack articles because the reading experience is subpar, the registration modal which pops when you are reading and start to scroll down interrupts my concentration and then I bail. That said, please enjoy the upvotes and I wish you all the best, Jebus.
- ryan-duve 4y agoHave you tried reader view? It's the little button that looks like a document on the right side of the URL bar in Firefox.
- the_jesus_villa 4y agoI appreciate the kind vibes, and I'm sorry Substack isn't an ideal medium (ha) for you. I decided to publish there just because so many writers I admire are there, and I want to write like they do. If I switch to a static blog I'll let you know!
- seibelj 4y ago> 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). Code of Dishonor
- snvzz 4y agoAt least buy it second hand, like I did back in the day.
- deleted 4y ago[deleted]
- the_jesus_villa 4y agoNo, 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!
- seibelj 4y agoThe “$80 is too expensive” comment is dishonorable. You can choose not to buy something - for books especially considering the library is free. If you think a corporation is evil, you don’t have to shop there.
- the_jesus_villa 4y ago>If you think a corporation is evil, you don’t have to shop there. I don't think charging $80 is evil, but it's a high enough price to merit some light teasing. To clarify: I'm just making fun of B&N for charging a lot for a book I wanted. This isn't meant to argue that charging a lot justifies theft. >If you think a corporation is evil, you don’t have to shop there. This is a more interesting argument, that has nothing to do with what I said, but is still fun to think about. Surely, if a corporation is evil, a reasonable response would exceed "don't shop there".
- jjtheblunt 4y agoThis is so strange : the original Kernighan and Ritchie The C Programming Language book from the early 1980s was a couple hours front to back read, and you're done, and you're up and programming. (Or you're not a computer person at heart perhaps?) The followup edition I think had the C89 draft ANSI standard, and was the beginning of the way way way more wordy era. That the idea of "learn enough C to survive" is a concern for anyone seems to mean the concise clarity of the original K&R book is long lost?
- AlotOfReading 4y agoThe state of modern C is so far removed from K&R that memorizing it probably counts as "just enough to survive". Someone that doesn't have a good grasp of UB and knowledge of the compiler/machine would be slightly terrifying to let loose in a C codebase.
- jjtheblunt 4y agoI've actually seen that happen, and it was not good, as you predict!
- boppo1 4y agoI read ANSI K&R, is it yhat much bigger/more complex? Took me about 4 days to read iirc (without doing exercises).
- jjtheblunt 4y agoi think 228 pages for K&R 1st edition (1978) which had a long appendix, and 288 for 1988 K&R 2nd edition with draft ANSI standard. Interestingly, the description from K&R for the 1988 version (I had both btw) said they tried to maintain the succinct clarity of the 1st edition. :)
- throwawaaarrgh 4y agoYou 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.
- thebytefairy 4y agoAgreed, 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.
- deleted 4y ago[deleted]
- jimbob45 4y agoIsn’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.
- xboxnolifes 4y agoI never happen across works written in Latin. I come across a lot of C code.
- 9wzYQbTYsAIc 4y agoLorem ipsum?
- 4y ago
- whateveracct 4y agoIf 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.
- catiopatio 4y ago> 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, it’s actually crystal clear.
- 3a2d29 4y agoI think that’s a joke
- deleted 4y ago[deleted]
- postsantum 4y agoA go-to strategy of responding to lame jokes is to pretend you don't understand them and make the other person to painfully explain until it becomes crystal clear for every party how bad they are
- the_jesus_villa 4y agoMy goto strategy is to laugh at how silly the joke is, rather than try to make people painfully explain something to show everyone how bad the joke is. I guess some people really dislike like lame jokes, though!
- vkou 4y agoIt also works with inappropriate innuendo.
- behnamoh 4y agoIsn’t a more future-proof approach to learn Rust instead? Linux kernel is incorporating Rust, and programmers often adopt open source packages written in their favorite language. Rust being the most favorite language for 5 years in a row must say something.
- nine_k 4y agoLearning Rust is certainly useful! But C is not going to disappear, and the huge reams of important code written in it, like the Linux kernel proper, are not going away, too. But C is so much simpler than Rust, it comes almost free. It does give you an appreciation what really unsafe code is, and why is it so unsafe. It also gives you a better understanding of how the machine works on the lower level.
- lmm 4y agoIs C actually simpler than Rust? It's certainly less powerful, but it has so many weird edge cases (e.g. the integer promotion rules) that I'm not convinced it's actually easier to learn fully.
- anta40 4y ago>> But C is not going to disappear My impression too. Very unlikely that Linux and BSD kernels will be re-written in Rust.
- foul 4y agoIt may happen. It would kill both projects, because Rust is arguably future-proof in its syntax.
- Normille 4y ago>Rust is arguably future-proof in its syntax. I'm not so sure about that. Given how many people dip a tentative toe in the Rusty waters and give up, baffled by the arcane syntax, I really wouldn't be surprised if Rust-2032 bore little resemblance to Rust-2022
- kensai 4y ago"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..." Marriage material! :D
- the_jesus_villa 4y agoThe story actually gets way crazier after that!
- andi999 4y agoI am listening...
- the_jesus_villa 4y agoSorry, but... you'll just have to wait for the next Substack post! ;)
- catiopatio 4y ago(1) She didn’t plan his gift ahead of time. (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.
- jyscao 4y agoyou missed the point and/or joke, which is implicitly that crazy girls are great in bed
- deleted 4y ago[deleted]
- habibur 4y agoLearn 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.
- steve76 4y ago
- wodenokoto 4y ago> 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. I'm not sure it qualifies as "to the point"
- the_jesus_villa 4y agoHa! 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.
- pksadiq 4y ago> Programming from the Ground Up > https://download-mirror.savannah.gnu.org/releases/pgubook/ProgrammingGroundUp-1-0-booksize.pdf 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 https://github.com/johnnyb/programming_under_the_hood
- justusw 4y agoWhat 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.
- deleted 4y ago[deleted]
- pkrumins 4y agoC is life.