I am a first-time user of this forum, but I have used several WROX books in the past as both reference and tutorials. I have recently encountered a problem that I have experienced before with WROX books, and I would like to express this here.
I am currently in the beginning chapters of working my way through Matt Doyle's Beginning PHP 5.3. It is important to note that in the intro and description of the book, the author says:
This book is intended for anyone starting out with PHP programming… the book assumes no prior experience of programming or of building web applications. That said, it will help if you have at least some knowledge of other web technologies, such as HTML and CSS.
That's great. Just what I am looking for, as I have plenty of experience with both CSS and HTML.
But when I get to Chapter 3 (PHP Language Basics) and out of NOWHERE, I encounter this:
PHP's bitwise operators let you work on the individual bits within integer variables. Consider the integer value 1234. For a 16-bit integer, this value is stored as two bytes: 4 (the most significant byte) and 210 (the least significant). 4 * 256 + 210 = 1234.
I know what an integer is, and I know what a byte is, but the rest of that paragraph is a mystery to me. Am I supposed to be able to follow what is going on there?
Then he goes on to a lengthy discussion of how bitwise operators let you manipulate bits directly, and there is an extensive chart with a list of bitwise operators with examples like:
14 & 3 = 2
00001110 & 00000011 = 00000010
All this with no preface or breakdown of what is actually happening when the author says something like:
For a 16-bit integer, this value is stored as two bytes: 4 (the most significant byte) and 210 (the least significant). 4 * 256 + 210 = 1234.
Perhaps I am in the minority in that I have not studied the sub-atomical depths of integers and bits and bytes since high school (many, many years ago), but as a reader and student of the teachings of this book, this took me right out of the flow of the text and frustrated me to no end. Did I miss something? Will I be able to navigate the coming examples and lessons when I have not grasped the unexplained concepts in this section? The author gives no insight.
I asked a friend of mine who is a PHP programmer about this. His take on it was:
"The deal with bit and bitwise ops is that mostly you never need to think about them, unless you're doing REALLY low level stuff with binary and such.
The take home is to understand how the operators work and what they do."
This is great. This is what I needed to know and get back on track. It would be awesome if the author included notes like this to his readers so we don't get hung up on an out-of-left-field concept that appears needlessly cryptic with no real explanation or set up.
Again, maybe I am simply lacking in a certain level of knowledge of mathematical concepts. But the description and intro of the book contain no disclaimers about this - simply that if I have a good knowledge of HTML and CSS (and a basic awareness of web applications and how they function as a user) , I should be able to follow this book.