first of all, why do you think this guy is a Linux programmer? his's is blog has shit about BASIC, mainframes and Lithp but not much about Linux. is this you, Nikita? make your're are game
second thing, his's is a fucking leaf and SJW.
third, it's not irrelevant bullshit. take this code: char *combine(s, t) char *s, *t; {
int x, y; char r[100];
strcpy(r, s); y = strlen(r); for (x = y; *t != '\0'; ++x) r[x] = *t++;
r[x] = '\0';
return(r);
}
his's is absolutely right, it's terrible! not only does it reinvent strcat inefficiently (and insecurely - but then again, it's not like strcat was secure in the first place), it also returns a stack-allocated local buffer, which I'm pretty sure is undefined behavior. and that's not academic irrelevant shit, this code will simply break on a modern OS. I think that the hypothesis that the author is an electronics guy with a knowledge of BASIC is right on point, and he repackages those very specific bits of knowledge into general advice without understanding that this won't work for most use cases.
basically, it's a dude writing a book on C without knowing much about C. it would maybe make sense as a 'programming AVR microcontrollers in C' (or whatever the hell that guys was using this code for), but preferably with caveats that it uses shortcuts and otpimizations which make it bad for portable code.
>>1 It is like AVGN taking some Street Fighter 2010 and making fun of it. That is okay book for learning C, to make your first DOS program, especially if there are not many alternatives and C compilers are just beginning to appear, while people still write their software in assembly.
And the example is okay, it is shows that you shouldn't return pointers to stack. I hate when people nitpick irrelevant details, like the informal style of the book and attempt to make it accessible to wider auditory, not just computer scientists.
Name:
Anonymous2018-06-26 16:45
>>9 Also, note how this retard attacks the author for writing introductory level astronomy book. A kid just wants to see some start in telescope, he wont be able to understand your astrophysics journal article.
Name:
Anonymous2018-06-26 16:46
C ``programmers'' have shit for brains.
Name:
Anonymous2018-06-26 20:36
>>9 How is that an okay book? Most of those example programs don't work at all, let alone work with most compilers.