Live data from Hacker News

Learn C The Hard Way by Zed Shaw

udemy.com

71–80 of 100 posts

Re: Learn C The Hard Way by Zed Shaw

#71
post #45
post #44

Earlier quoted context omitted.

Just a little something that irked me: 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…

Huh, really? I always figured piano had an unambiguous mapping from pitch to keys, whereas guitar typically has 2 or 3 possible fingerings for a given pitch. I find it pretty easy to get stuck with awkward positions on my first few times through a guitar piece--except those in which transitional notes are annotated with fret positions. Is that what you mean by "arranged for guitar"?

Yes, string number/finger number positions are what I was referring to. And, as Goladus pointed out, getting stuck in those awkward positions definitely happens on piano, too.

Re: Learn C The Hard Way by Zed Shaw

#72
post #51
post #50

Earlier quoted context omitted.

The mapping from pitch to keys is (generally) clear, but what isn't clear unless you are fairly skilled is the mapping from keys to fingers. eg: Beat 1: root-position C-Major triad (C,E,G) fingers: (1,3,5) Beat 2: first-inversion a-minor triad (C,E,A) fingers: (1,3,?) If the pattern is legato or fast and you can't lift up your hands, playing both G and A with the 5th finger will be difficult for most players. The eas…

Oh, of course! Thanks for the explanation. :)

No problem. I can't comment much on the initial comparison between tablature and fingering since I don't read tablature or more than the very basics of guitar.

It is true that if you map in the reverse direction, tablature can represent playable music even if it's not particularly expressive, while piano fingerings can not. (Well, I suppose you could write music with only piano fingerings and let the performer improvise, but I'm sure that's not the point of this discussion :)

Re: Learn C The Hard Way by Zed Shaw

#73
post #57
post #41

Earlier quoted context omitted.

Well I explain all the many reasons this is the wrong way to think about it in the end.

Your argument with permutations of inputs is wrong IMO - this argument can be used to claim that any functionality which calls user code (through callbacks, inheritance, whatever, functors) is also defective. Strictly it may be so, but the defectiveness is massively outweighed by the convenience - the most obvious example is calling a late-binding function - but it extends to easier to grasp examples like the C qsort…

Aren't you as the person providing the application ultimately responsible for knowledge of what library calls work well and, thus, which you should use? I think Zed's cautionary statements are merely summarizing a bunch of his experiences, ultimately that this library call isn't worth using.

Permutations of input is not "wrong", its a valid mechanism for exposing unexpected/undefined behavior. "Massively outweighed by the convenience" is subjective and, in many circumstances, very suspect.

Re: Learn C The Hard Way by Zed Shaw

#74
post #56

Earlier quoted context omitted.

The problem is that the examples and explanations don't justify the level of castigation. Yes, you should always use strncpy() instead of strcpy() for instance, but that doesn't protect you from all bugs. The example of a safercopy() still relies on the assumption that the pointers given to it are valid, and that assumption is just as impossible prove as the assumption that copy()'s input strings are valid. Safercopy…

"Yes, you should always use strncpy() instead of strcpy() for instance, but that doesn't protect you from all bugs." I agree with your argument, but I don't enjoy encouraging programmers to use strncpy and co... the reason is simple, I don't want to encourage programmers to stop thinking about their code. Not having to think about something is great, when laziness is acceptable (RAD, web development etc.) but not in…

The knowledge is esoteric to what is being done. I know its convenient to believe so, but there are smart people that make mistakes. Misusing one of these methods isn't discouraged because its obvious, its discouraged because it fails in non-obvious ways. Ways that have probably cost humanity many man years of development time.

Re: Learn C The Hard Way by Zed Shaw

#75
post #32
post #29

Earlier quoted context omitted.

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…

memcpy is just fine because it has a size parameter. I think you mean strcpy(), which does cause defects.

[deleted]

Re: Learn C The Hard Way by Zed Shaw

#76
post #48
post #31

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.

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.

I'm ditching ePub. It's a crap format that has a bewildering number of options and it seems every viewer wants to implement some different subset of them.

From now on, it's PDF and HTML only.

Re: Learn C The Hard Way by Zed Shaw

#77
post #44

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…

Just a little something that irked me: 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…

No, it doesn't. Go find middle C. See how on the piano it's in the middle of the piano, and also in the middle of the grand staff? Now, find one of the many on the guitar. Not really in the "middle" are they? Even the left and right hand and the grand staff fit better. The location of submediant, inversions, arpeggios, distance in intervals, all map better on a piano than a guitar.

Re: Learn C The Hard Way by Zed Shaw

#78
post #55
post #37

Earlier quoted context omitted.

Try going through the HTML version, and drop comments when you hit problems. That'll help me make the book solid.

Are guest comments ever going to be an option? I don't really want to make a disqus account. I understand if not, but I figured I'd ask anyway.

No, I'm fully blocking and moderating comments. They are for serious students who need help, not drive-by netizens. In the past I had them open, but after the first two hits by HN or reddit I had to lock it down so that students wouldn't get thrashed.

Re: Learn C The Hard Way by Zed Shaw

#79
post #53

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 t…

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.

Re: Learn C The Hard Way by Zed Shaw

#80
post #68

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? Ho…

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.

Post reply on HN