Live data from Hacker News

Don't Learn C the Wrong Way

hentenaar.com

21–30 of 53 posts

Re: Don't Learn C the Wrong Way

#21
post #10
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)

When Windows first came out, the ONLY programming language for it was C. Nothing else .

Assembly was always an option, though a painful one.

Re: Don't Learn C the Wrong Way

#22
post #3

Part 3: "Wait a tic... Where's the Makefile? I've got just about as much chance of finding it as the FBI does of finding Jimmy Hoffa. Am I just supposed to imagine it into existence?" I think the point is that the make command can use implicit rules even if there is no Makefile. It knows how to compile C source files. (This could be confusing if you know about "make" but don't know about implicit rules.) For example:…

I'm glad you posted the article on strcpy; I did not know about this behavior of strncpy and am a little surprised I never ran into it before.

That being said; it is a safer alternative to strcpy, but it seems like it isn't the safest alternative to strcpy.

Re: Don't Learn C the Wrong Way

#24
post #19

Earlier quoted context omitted.

I don't believe your paraphrase of the line you quoted from the author is accurate. His own words, strictly read, imply that: - Shaw is a writer; - The author is not a writer; - The author is an engineer. It doesn't imply anything either way about Shaw being an engineer.

The full quote is "Let me start by saying that unlike Mr. Shaw, I am not a writer. I'm an engineer. Thus, this will be written from that perspective." By implication, Zed's book is not written from the POV of an engineer (otherwise why would this be worth noting in any way shape or form? The topic under discussion is already software engineering).

That is not the implication that I took from it; as I read it, this is an apology of sorts that the critique is not informed by the perspective of a writer.

Re: Don't Learn C the Wrong Way

#25
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…

People who behave in a combative and dogmatic manner have not programmed in to themselves a check to ask "does this issue really matter?". There is no decision making code in their brain to work out if something REALLY matters. Many things, even small things, matter enough to go to war.

They also value the war/being right/the point more highly than they value maintenance of positive human relationship.

What they don't understand is that people forget the issue and remember the grace (or not) with which you handled it.

Often they are not very good at empathizing with others and find it hard to imagine what it is like to be someone else interacting with them.

I know cause I am one, hopefully reformed.

Re: Don't Learn C the Wrong Way

#26
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…

I agree that the tone of the blog post could have been less combative, but essentially all of this complaints are valid. Zed's does introduce things in the wrong order and in a very confusing fashion. The rant about C strings is also completely misguided and would lead a novice off course into using ugly thickets of macros and crappy frameworks rather than simply using C strings correctly. Any C function will misbehave if passed invalid input... and things like valgrind, which Zed is clearly well aware of, make C-style strings much less dangerous.

Zed also made many completely unjustified attacks on the K & R book, which is a well-written, easy to read book which introducse C concepts in a clear and readable way. Even if this was justified (and it's really, really not), that all belonged as a separate blog article rather than as part of an alleged "tutorial."

Finally Zed published a "rebuttal" to all of this in which he basically says that C sucks, is not worth learning, and he's learning Go. So the author quite reasonably asks, why would you want to learn C from someone who doesn't like the language or think it's worth learning?

I think we can all agree that Go (or some other high level language) probably is the better choice for most projects. But after all, there are still many places where C will continue to be used like the Linux kernel. Those people would be much better off reading K&R, as old as it is, than anything Zed has written. And his attacks on the K&R authors are just sad.

Re: Don't Learn C the Wrong Way

#27
post #24

Earlier quoted context omitted.

The full quote is "Let me start by saying that unlike Mr. Shaw, I am not a writer. I'm an engineer. Thus, this will be written from that perspective." By implication, Zed's book is not written from the POV of an engineer (otherwise why would this be worth noting in any way shape or form? The topic under discussion is already software engineering).

That is not the implication that I took from it; as I read it, this is an apology of sorts that the critique is not informed by the perspective of a writer.

I read it as a snarky smackdown of Zed as "a writer and not a software engineer".

Re: Don't Learn C the Wrong Way

#28
post #7
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…

This is the second time this post has been voted to the front page of HN. It's puzzling. Are C programmers supposed to find this compelling now, when they didn't the first time around? I wonder if it's simply a case of: 1. Zed Shaw is controversial on HN 2. I know, I'll write a post that disses Zed Shaw 3. ??? 4. Profit!

Sorry, I didn't find it the first time around. I think it's generating good discussion. I didn't post it to diss anyone.

The article seemed a little off to me, and I thought HN would enjoy picking it apart

Re: Don't Learn C the Wrong Way

#30
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…

>Things are getting better.

In what sense? MS platform had a working C compiler for decades.

Post reply on HN