I can't warn you because I put it to the trash bin long ago.
Massacring C Pointers
51–60 of 300 posts
Re: Massacring C Pointers
#52Additionally another common domain of clueless writing is computer graphics and the related math. There are so many articles written by enthusiastic people (no doubt) where the information is just adding noise. Finding trustworthy good quality information requires that you know a considerable amount already so you know what is good and what is not (talking about online content here) :)
Re: Massacring C Pointers
#53Earlier quoted context omitted.
I haven't touched C in years, but here's my descending "wtf" list: 1. Returns pointer to stack-allocated data, which immediately becomes invalid. Instead, it should be using some sort of allocation (e.g. 'malloc'), or taking in a destination pointer. 2. 'r' is arbitrarily set with length 100. Smaller strings don't need all that space, and larger strings definitely will overrun. 3. The function signature is really awk…
> 'strcpy' should usually be replaced by 'strncpy' Sorry to butt in, but this is a bit of a trigger for me: I’ve had to fix a number of programs infected with this idea. The main problems with strncpy are: When the source string is shorter than n, strncpy will pad the target to n bytes, filling with zeros. This is bad for performance. When the source string is longer than n, strncpy will copy n bytes but _not_ nul-te…
Re: Massacring C Pointers
#54It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. - Dijkstra, "How do we tell truths that might hurt?" (1975) The author, Traister, has came from BASIC. We have the explanation.
Well that is a dumb and inaccurate statement if ever I've read one. I mean I'm sure there might have been some nugget of truth back in the 70s in that it might have been frustrating to teach C or FORTRAN to BASIC programmers but it has as much relevance these days as any of the other memes people like to quite from yesteryear. I certainly managed the transition from BASIC to Pascal with ease and definitely follow goo…
Re: Massacring C Pointers
#55Made me wonder if the quality of the content in the other 11 books is anything like the one the Woz took apart.
Re: Massacring C Pointers
#56It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. - Dijkstra, "How do we tell truths that might hurt?" (1975) The author, Traister, has came from BASIC. We have the explanation.
Re: Massacring C Pointers
#57Heh, not only this but there are also plenty of C++ books that are literally less than worthless. Additionally another common domain of clueless writing is computer graphics and the related math. There are so many articles written by enthusiastic people (no doubt) where the information is just adding noise. Finding trustworthy good quality information requires that you know a considerable amount already so you know w…
I think it was this book (https://www.amazon.com/Flights-Fantasy-Programming-Video-Gam...) that taught me 3D programming better than anything else. The code was readable, the maths was well explained and it included sections on how to do things without those newfangled maths co-processors. I'd love to buy a copy now just to see if it really was a good book or if it led me astray.
Re: Massacring C Pointers
#58https://www.findagrave.com/memorial/29007415/robert-joseph-t...
Re: Massacring C Pointers
#59https://www.amazon.com/Conquering-Pointers-Robert-J-Traister...
Re: Massacring C Pointers
#60When I was learning C in the eighties, I bought a book about 3D programming, the worst programming book I've read. I believe that examples worked, at least the ones that I typed did, but the style was atrocious. The concept of function parameters seemed to be totally alien to the author. The idiot created x1, X1, x2, X3, x, xthis, xthat... variables instead. He was a former BASIC book author too. I can't warn you bec…
Hmm, I'm starting to see a pattern. Is it possible BASIC, plus lack of internet back in the day, plus attrocious books are the reasons for truning poeple into terrible programmers? I happen to know only a couple of seniors but without exception their code, no matter what language written in today, is horrible on all fronts. I used to think it was a lack of attention to detail, their lack of wanting to strive for even the tiniest bit of more than just 'good enough for tady'. Possibly stemming from lack of education and lack of continuous self-education. But maybe there's more to it. Maybe they were influenced by a bad book. And/or by a not-so-optimal language like BASIC.