Live data from Hacker News

Don't Learn C the Wrong Way

hentenaar.com

31–40 of 53 posts

Re: Don't Learn C the Wrong Way

#31
post #6

To me this read like a long list of nitpicks. Sounded like the author was just angry that Zed said bad things about the K&R book.

Yup. He does not offer alternatives to Zed's work either.

I'm looking for an alternative. I found this article in https://news.ycombinator.com/item?id=9635230

Re: Don't Learn C the Wrong Way

#32
post #2

>>Let me start by saying that unlike Mr. Shaw, I am not a writer. I'm an engineer. Zed Shaw, whilst his approach to certain issues may be questionable, is not "a writer rather than an engineer". Zed is known as one of the most prolific and capable software engineers around and I have heard his C code for Mongrel 2 server https://github.com/zedshaw/mongrel2 described as being amongst some of the best examples of C cod…

At this point people just keep trying to pick fights with Zed. He's not out there picking fights with others (well any more than anyone else). And all of the posts pointing this out all disclaim that "while they don't agree with Zed about some things..." It's just kind of sad from a rhetorical perspective. It's clear that the guy who wrote this post doesn't agree with Zed's pedagogical style, but that doesn't make Ze…

It sounds like more than a just a "style" disagreement.

In the discussion of C strings, the author is arguing that Zed's arguments are nonsensical, maybe even objectively wrong. I write a lot of C, and the author is right in this case about C strings and undefined operations. In C you must arrange your code so that you always supply valid input to functions, there is no way around it, and it is perfectly safe once you do so.

I'd rather see discussion of the actual arguments, rather than complaints about the article's tone. :)

Re: Don't Learn C the Wrong Way

#33
post #30
post #14

Earlier quoted context omitted.

On the bright side, the author's hate for implicit make-rules, and inability to grasp the pedagogic value of showing implicit includes first, and -Wall later made me go and test the following in a "command prompt for VS2013" on windows: >more hello.c int main(int argc, char *argv[]) { puts("Hello world."); return 0; } >cl hello.c Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86 Copyright (C) Micros…

>Things are getting better. In what sense? MS platform had a working C compiler for decades.

Working, and "easy to use" isn't the same thing. For one thing, this is a gratis compiler from MS.

Re: Don't Learn C the Wrong Way

#36
I'd like to hijack part of this discussion and ask, if any of you know about a good modern c programming book.

Because I'd like to read the K&R C destructuring book, not just a removed chapter at the end of the book :-)

I somehow thought that notion, that K&R C is somewhat outdated in their code examples is widely accepted (biggest gripe is little to no input sanitation, afaik (?)), so a book about "this is what we learned about c in past 30 years" would be splendid :-)

Re: Don't Learn C the Wrong Way

#38
post #33
post #30

Earlier quoted context omitted.

>Things are getting better. In what sense? MS platform had a working C compiler for decades.

Working, and "easy to use" isn't the same thing. For one thing, this is a gratis compiler from MS.

Not quite sure what is new here. The MSVC compiler has been available for free for close to a decade at least and command line compilation was available ever since I first used it (in the mid 90s)

Re: Don't Learn C the Wrong Way

#39
I just read the entire article and I can't find one decent comment about why Zed's teaching methodology is wrong or why he shouldn't be writing a book on C.

All I see is the author fussing about coding style and some such.

Re: Don't Learn C the Wrong Way

#40
post #14
post #8

Earlier quoted context omitted.

And I don't even understand why he doesn't agree that C is a second-class citizen on Windows. Microsoft would rather have you code stuff in C++ or .Net and MSVC is stuck with the C90 standard (although apparently that is finally improving)

On the bright side, the author's hate for implicit make-rules, and inability to grasp the pedagogic value of showing implicit includes first, and -Wall later made me go and test the following in a "command prompt for VS2013" on windows: >more hello.c int main(int argc, char *argv[]) { puts("Hello world."); return 0; } >cl hello.c Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86 Copyright (C) Micros…

Yeah, that's great.

Now try it using some features from that super-recent, edgy, C standard from 16 years ago, C99.

Post reply on HN