4 ms·
> Expressions “return a value.” Yes, "returning" is problematic, because that has a very specific meaning in the context of a function call. But even if we for
by molf 6y ago
> Expressions “return a value.”
Yes, "returning" is problematic, because that has a very specific meaning in the context of a function call. But even if we forgive the author the inaccurate terminology, it is also an incorrect statement. You can evaluate an expression. But in C in particular, an expression does not necessarily evaluate to a value.
A somewhat better statement might be:
"Expressions can be evaluated. Some expressions produce a result value."
This statement can probably further improved upon; it definitely still does not capture everything that expressions are in C: such as being able to cause side-effects! That might not be evident, but can certainly be important. But then again, I am not writing a book about C.
> “A pointer is a special variable that returns the address of a memory location.”
Indeed "returning" is problematic here. A pointer does not return anything, it points to something.
> Somehow I feel this was written with an air of superiority, the author doesn't expand on anything. I get that feeling a lot with articles about c
If you're going to write a book about C in order to teach programmers how to work with pointers, better explain things with the correct terminology.
If this were a journal, then of course you can forgive the inaccuracies. But it's a published book that supposedly teaches certain concepts to readers. The author of the blog post says as much in their notes:
"This provides some insight into the mind of the author: he's just picking up concepts and terms as he learns about them and tossing them in without any regard for the reader. This book is pretty much his journal — that somehow became a book with two editions."
> the author doesn't expand on anything
The author expands on a lot more than I would have the patience for; see the notes [0]. Why certain things are incorrect, misleading or dangerous does require some C knowledge. The article + notes won't be a place to learn more about C; but neither is the book that's being reviewed.
[0]: https://wozniak.ca/blog/2018/06/25/1/notes.html https://wozniak.ca/blog/2018/06/25/1/notes.html
- kaetemi 6y agoAlthough, if you are writing a book to teach programming, you can't suddenly drop stuff like "evaluating expressions" on readers either. It might be meaningless to them. For example. If they come from a 'toy' programming background where they just call functions that return values, set variables, jump to labels, and do some math... Even if they're experts at that task, the words "evaluating expressions" might likely have no meaning to them at all. You'll have to explain first with concepts they already understand. In this case, it seems the writer might've come from such a background. (And assumed his contemporaries were in a similar mindset.) :)
- Droobfest 6y agoThere's an extensive list of everything wrong with the book but not a single point on how to do it better. If you show the wrong way to do things, it's always good to give a few pointers to a better path so part of your reader base doesn't feel excluded.