4 ms·
I'm the author of The Silver Searcher (aka ag)[1]. I wrote my first C program almost 20 years ago, and I have some not-very-nice things to say about this guide.
by ggreer 11y ago
I'm the author of The Silver Searcher (aka ag)[1]. I wrote my first C program almost 20 years ago, and I have some not-very-nice things to say about this guide. I hope the author won't take it personally.
First, Zed Shaw's Learn C the Hard Way is not worth reading. I agree with most of Tim Hentenaar's criticisms.[2] It's confusing, incomplete, and overly opinionated. If you want to get started with C, read the K&R book. It's not perfect, but it's better than anything else I know of.
As for the guide itself, the quality of its advice varies greatly. Some bits are great. Some are good. Some are controversial. Some are dangerously double-edged. And some are Not Even Wrong. It would take too long to go into detail, so I'll just say: Please don't blindly follow this guide. Explore other codebases (including the ones the author linked to). Talk to other programmers. Write your own projects, and get feedback from those who are more knowledgable.
You might notice that this advice generalizes to every language. That's because C isn't special. If anything, the language itself is simpler than most. C has just had more time to accumulate cruft, both technical and cultural. So don't feel intimidated. Once you learn those bits of historical trivia, you'll be fine.
1. https://github.com/ggreer/the_silver_searcher https://github.com/ggreer/the_silver_searcher
2. http://hentenaar.com/dont-learn-c-the-wrong-way http://hentenaar.com/dont-learn-c-the-wrong-way
- plonh 11y agoZed Shaw is wonderful, his name is an easy to spot sign that a thing is more about trying to sound edgy and Internet-tough, than being technically useful, so I know if a writeup is worth reading, depending on what I am in the mood for.
- fit2rule 11y agoI concur .. another good book that will teach you more about C in a productive way, is "Expert C Programming- Deep C Secrets": http://www.amazon.com/Expert-Programming-Peter-van-Linden/dp/0131774298 http://www.amazon.com/Expert-Programming-Peter-van-Linden/dp...
- WYSIMOLWYG 11y agoI just finished reading "Expert C Programming", and thus far it's been the best C book I've read! You'll learn a lot about the intricacies of the language, and you'll actually laugh while reading some sections (most C books can be quite boring and dull). Disclaimer: I've only been writing C for a bit over two years (so still very new), and my list of C literature consists mainly of the following books: - K&R - Mastering Algorithms with C - Kyle Loudon - Understanding and Using C Pointers - Richard Reese - Test Driven Development for Embedded C - James W. Grenning - Expert C Programming: Deep C secrets - Peter van Linden
- deleted 11y ago[deleted]
- btrask 11y agoThanks for for the comment. I'm the author of the article. I'd really appreciate some more specific feedback, particularly the parts that you think are dangerous or "not even wrong." I'll take a look at the Silver Searcher's code and see what pearls of wisdom I can gain.
- ggreer 11y agoIn hindsight, my comment seems rather curt and dismissive. Thanks for taking my criticisms like a champ. Honestly, I don't think ag is very good code. It's worth reading if you want to see optimizations like memory-mapped I/O, pthreads, Boyer-Moore strstr, etc. But if I had to grade the quality of the code, I'd give it a C-. Many parts have grown organically, and I haven't had time to restructure them. Also, ag's use-case is not exactly mission-critical. Nobody is going to die if it crashes or errors-out. Add my time constraints and… the result is some shoddy code. I'll add "C Programming Guidelines" to my queue of blog posts to write, but I make no guarantees about when I'll get to it. Sorry.
- btrask 11y agoCool, I'm looking forward to it.