I was wondering how this compares with or compliments K&R, when I came across [this section][1] of the book that seems to slap it in the face. Here's a section from the second paragraph:
You see, "K&R C" is actually riddled with bugs and bad style. Its age is no excuse. These were bugs when they wrote the first printing, and the 42nd printing. I hadn't actually realized just how bad most of the code was in this book and recommended it to many people. After reading through it for just an hour I decided that it needs to be taken down from its pedestal and relegated to history rather than vaunted as state of the art.
This seems a bit hyperbolic to me... I just read K&R several years ago during school (could definitely use a re-read) but remember absolutely loving it for the combination of brevity and density of information conveyed. I'm not much of a C programmer though so I don't really know. Could a modern C programmer respond / elaborate?
It's a bit like claiming memcpy() is bugged because it can crash your program. Well, true, it is good style to program defensively against memory corruptions, buffer overflows etc, and in that respect K&R may teach students bad habits.
I think it's a bit much to say that it should never have been written like that, as at the time people knew so much less about building complex projects, sources of error and defensive programming.
Keeping a book up to date takes a lot of effort, as I'm sure Zed (npi) appreciates. It's an old book, it has warts. As you stated, the density of information was what many people like about the book, so any replacement for it will have to replicate that. I don't think the criticism is unfounded though.
Guitar however is a weird instrument that doesn't really work with notation, so guitarists have an alternative notation called "tablature".
This is incorrect. Guitar works perfectly fine with standard notation. It may be somewhat difficult to figure out fingerings if the music isn't arranged for guitar, but it's not much harder than playing piano without fingering information. I agree with the overall analogy (that tablature is initially easier than sheet music, but ultimately restrictive), though.
Just a warning to everyone, like the book this course is in development as I write the book. It's covering a lot of the chapters, but I have to go back and clean up some videos and do the final ones. That's why the price is low for now.
You talked about installing xcode. For newer osx versions, people may be able to install just the [command line tools for xcode][1], which is only about 170MB or so. It might save some people from waiting around for the full xcode.
What's your method for making the ePub version of your books? I'm considering writing a custom program for my own stuff, but I'd love to be able to use something off the shelf.
In case one does not want to spend $29, the free HTML book [1] (currently in beta) is good enough. I have been following along the book, and can vouch for it. It is a great way to learn to code in C.
EDIT: By posting the link to the book, I by no means meant that the videos are redundant. I would love it if more people en-roll for Zed's Udemy course and support him.
You can also compile the book into a PDF if you'd like. Zed made the code available so all it takes is the effort involved to install the right LaTeX modules.
Took part of an afternoon to figure out how to build it.
I just scanned through the free HTML book and this looks definitely a good start for a modern "get started fast" book about C: everything is important about the language seems to be covered. Good work.
I'm excited - Learn Python the Hard Way completely jumpstarted me into what has become a large internal django site, and I refer back to it often. I really enjoy python, and I thank Zed for the straightforward aproach.
So even though I love python I want to see if the same technique can introduce me again to C, a language I never felt comfortable with.
Learn Python the Hard Way is great, although I can't say I've read that many Python books, but I though his approach was a very good way to learn Python.
What I really like about LCTHW (after reading K&R and then just not doing anything with it) was starting you out using the tools and best practices right from the beginning. Make and valgrind up front. It got me over the hump of syntax&language --> actually using.
I disagree with your disdain for IDEs... I hope that you are not totally misleading the people who will learn from your book because learning how to use the capabilities of Visual Studio or any decent IDE is very valuable. How are they going to debug complex graph data structures in their CS class if they don't have a great debugger? How are they going to understand the power of intellisense in modern programming? How are they going to learn about compiler flags without getting a headache? How much time are they going to waste compiling and linking with the commandline?
I like the no-copy-paste and straight notepad approach trust me. It works for everyone, it's a solid way to get these things into your brain. You need to write code, there's no way around it. But to tell people to never use IDEs because they are bad and they make you a bad programmer is BULLSHIT.
and what would they do if they cannot use this functionality, for example debugging something embedded, or something that cannot be debugged the way you pointed out
IDEs are bad for you. It's much better to simply use a real programmer's editor that you can craft into being what you need. In fact, I can usually take vim plus cscope, exuberant ctags, and ack and demolish any code base you throw at me. Similar with emacs and other power editors.
IDEs are usually useful if you're stuck using them to build GUIs or use specialized build tools they require.
Nevertheless, Zed is helping lots of people out there who is eager to learn coding like me, I could imagine back in the days if you want to learn coding there are tons of resources out there, probably too many, that you don't know which one is good and it cost you money. Now, people like me can always go to his book finish the course and look for what is missing without spending a buck.
The video course is being worked on by me while I write the book, so expect it to be rough around the edges.
But, I say try going through the HTML version online, and as you do get stuck write comments to ask me questions. That's why I put it online for free, so that I get student feedback while I write the book.
Harvard's CS50 (cs50.net) is an introductory computer science course that teaches C. Full course (lecture videos + problem sets) is available free online.
It's funny how, I started getting annoyed seeing people still learning to code on books while free tutorials were starting to pop up everywhere on internet.
And now people are starting to charge for those tutorials. And I know people here in HN love Zed Shaw. But come on, there are hundreds of free great tutorials to learn C on internet.
I did look at this book a while ago, I was unable to make amendments to the code examples. early versions made common C gotcha mistakes, although of the more subtle and less disasterous kinds... starting with non-standard entry-point function signature and generally relying on non-standard features of particular compilers. fortunately someone else seems to have gotten there in the end... i'd be wary, simply because the author is (as much as I am a fan of much of his work) clearly not an experienced C programmer.
I am a very experienced C programmer, and I have full comments on any page. You find an error, drop a comment and I'll fix it immediately.
Chances are though, you're someone who read the K&R chapter, then went through nitpicking minor semantics about things like "NULL is 0" and then consider all the code broken in the book.
But, any errors you find, let me know and I'll fix them. Just don't call me an inexperienced C programmer.
[+] [-] waffle_ss|14 years ago|reply
You see, "K&R C" is actually riddled with bugs and bad style. Its age is no excuse. These were bugs when they wrote the first printing, and the 42nd printing. I hadn't actually realized just how bad most of the code was in this book and recommended it to many people. After reading through it for just an hour I decided that it needs to be taken down from its pedestal and relegated to history rather than vaunted as state of the art.
This seems a bit hyperbolic to me... I just read K&R several years ago during school (could definitely use a re-read) but remember absolutely loving it for the combination of brevity and density of information conveyed. I'm not much of a C programmer though so I don't really know. Could a modern C programmer respond / elaborate?
[1]: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
[+] [-] Jabbles|14 years ago|reply
I think it's a bit much to say that it should never have been written like that, as at the time people knew so much less about building complex projects, sources of error and defensive programming.
Keeping a book up to date takes a lot of effort, as I'm sure Zed (npi) appreciates. It's an old book, it has warts. As you stated, the density of information was what many people like about the book, so any replacement for it will have to replicate that. I don't think the criticism is unfounded though.
[+] [-] byproxy|14 years ago|reply
Guitar however is a weird instrument that doesn't really work with notation, so guitarists have an alternative notation called "tablature".
This is incorrect. Guitar works perfectly fine with standard notation. It may be somewhat difficult to figure out fingerings if the music isn't arranged for guitar, but it's not much harder than playing piano without fingering information. I agree with the overall analogy (that tablature is initially easier than sheet music, but ultimately restrictive), though.
[+] [-] mkr-hn|14 years ago|reply
[+] [-] readme|14 years ago|reply
You bet it will be hard to learn when you shun the best book ever written on the language, coauthored by the designer of the language!
[+] [-] zedshaw|14 years ago|reply
[+] [-] stock_toaster|14 years ago|reply
You talked about installing xcode. For newer osx versions, people may be able to install just the [command line tools for xcode][1], which is only about 170MB or so. It might save some people from waiting around for the full xcode.
[1]: http://kennethreitz.com/xcode-gcc-and-homebrew.html
[+] [-] mhartl|14 years ago|reply
[+] [-] aseembehl|14 years ago|reply
[1] http://c.learncodethehardway.org/book/
EDIT: By posting the link to the book, I by no means meant that the videos are redundant. I would love it if more people en-roll for Zed's Udemy course and support him.
[+] [-] DannoHung|14 years ago|reply
Took part of an afternoon to figure out how to build it.
[+] [-] johnohara|14 years ago|reply
Books, videos and course materials don't just happen because we say so. Real people create this stuff.
[+] [-] antirez|14 years ago|reply
[+] [-] skrubly|14 years ago|reply
So even though I love python I want to see if the same technique can introduce me again to C, a language I never felt comfortable with.
[+] [-] zedshaw|14 years ago|reply
[+] [-] mtgx|14 years ago|reply
[+] [-] 2mur|14 years ago|reply
[+] [-] mitchi|14 years ago|reply
I like the no-copy-paste and straight notepad approach trust me. It works for everyone, it's a solid way to get these things into your brain. You need to write code, there's no way around it. But to tell people to never use IDEs because they are bad and they make you a bad programmer is BULLSHIT.
[+] [-] malkia|14 years ago|reply
[+] [-] zedshaw|14 years ago|reply
IDEs are usually useful if you're stuck using them to build GUIs or use specialized build tools they require.
[+] [-] millerfung|14 years ago|reply
[+] [-] bendemott|14 years ago|reply
[+] [-] rudiger|14 years ago|reply
[+] [-] Mithrandir|14 years ago|reply
[+] [-] arturhoo|14 years ago|reply
You probably want to fix that.
[+] [-] thdn|14 years ago|reply
[+] [-] zedshaw|14 years ago|reply
But, I say try going through the HTML version online, and as you do get stuck write comments to ask me questions. That's why I put it online for free, so that I get student feedback while I write the book.
[+] [-] philsmith35|14 years ago|reply
[+] [-] baby|14 years ago|reply
And now people are starting to charge for those tutorials. And I know people here in HN love Zed Shaw. But come on, there are hundreds of free great tutorials to learn C on internet.
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] zedshaw|14 years ago|reply
http://programming-motherfucker.com/become.html
[+] [-] z1g1|14 years ago|reply
[+] [-] ryansama|14 years ago|reply
[+] [-] LilValleyBigEgo|14 years ago|reply
[deleted]
[+] [-] jheriko|14 years ago|reply
[+] [-] zedshaw|14 years ago|reply
Chances are though, you're someone who read the K&R chapter, then went through nitpicking minor semantics about things like "NULL is 0" and then consider all the code broken in the book.
But, any errors you find, let me know and I'll fix them. Just don't call me an inexperienced C programmer.