what in particular do you dislike? I took the style from the BSD 4.4 cat source, and the attribution of that code is to Rob Pike himself. The one thing I did change was moving assignment in conditions and loop tests to separate assignments and tests, as in changing if (buf = malloc(bsize)){ err(1,0); } to buf = malloc(bsize); if (!buf) { err(1, 0); }, which I found (when starting to learn C) to be easier to understand.
Though I understand that C makes 0 and NULL interchangeable in many contexts, I think it’s important to reflect the type and intent of the variables and values in expressions. For instance, I think (buf != NULL) is clearer than (!buf). Similarly err(1, NULL) instead of err(1, 0).
I also think the structure of the do/while loop in main() is confusing, and probably would have been better with the use of argc and explicit handling of the no-argument case.
I’ve been voted -1 troll, though, so I suppose I’ll get my coat!
You used K&R style function declarations and C99 style line comments. At the very least, stick with either K&R, C89 (new function declaration style, no // comments) or C99.
(author here) very very rehearsed, and done in small segments. Also, the voiceover was done separately. For my paid screencasts about re-writing Git I’ve been recording the typing/talking simultaneously, but I thought a casual viewer would appreciate a quicker watch. I’ll be practicing to get to grb/Destroy All Software speeds!
I’m pretty sure I’m violently allergic to his C style.
what in particular do you dislike? I took the style from the BSD 4.4 cat source, and the attribution of that code is to Rob Pike himself. The one thing I did change was moving assignment in conditions and loop tests to separate assignments and tests, as in changing
if (buf = malloc(bsize)){ err(1,0); }tobuf = malloc(bsize); if (!buf) { err(1, 0); }, which I found (when starting to learn C) to be easier to understand.Though I understand that C makes
0andNULLinterchangeable in many contexts, I think it’s important to reflect the type and intent of the variables and values in expressions. For instance, I think(buf != NULL)is clearer than(!buf). Similarlyerr(1, NULL)instead oferr(1, 0).I also think the structure of the
do/whileloop inmain()is confusing, and probably would have been better with the use ofargcand explicit handling of the no-argument case.I’ve been voted -1 troll, though, so I suppose I’ll get my coat!
You used K&R style function declarations and C99 style line comments. At the very least, stick with either K&R, C89 (new function declaration style, no // comments) or C99.
Man that was fast!
Couldn’t help thinking, is this realtime? does the guy prepares its casts? Are you guys able to write that this fast?
(author here) very very rehearsed, and done in small segments. Also, the voiceover was done separately. For my paid screencasts about re-writing Git I’ve been recording the typing/talking simultaneously, but I thought a casual viewer would appreciate a quicker watch. I’ll be practicing to get to grb/Destroy All Software speeds!