Code Samples
Code samples presented in this book will be displayed on a different colored background in a monospaced font. Samples are not to be taken as copy & paste code snippets.
Code examples are used through the book to clarify what is written in text. They will sometimes be usable as-is, but they should always be taken as outline/pseudo code only.
A code sample will look like this:
class AClass
{
...
}
//A Comment
$obj = new AClass($arg1, $arg2, ... );
/* A note about another way of doing something
$obj = AClass::newInstance($arg1, $arg2, ... );
*/
The presence of 3 dots ... in a code sample indicates that I have left out a chunk of the code for brevity, they are not actually part of the code.
I will often place multi-line comments /* ... */ in the code so that I can show alternative ways of achieving the same result.
You should read the code examples given and try to understand them. They are kept concise so that you are not overwhelmed with information.