Chris Lott wrote:
> Looking for suggestions for a PHP textbook for an "Intro to Web
> Programming" class that will be using PHP5 and MySQL. This is a
> first-semester course, so no programming experience required.
>
> It would be nice to have a text that adhered to (what I see as) good
every that shines is not gold - or to put it another way: horseshit to
your good practice.
> practice using quotation marks... i.e.
>
> print 'The cost is ' . $cost;
> NOT
> print "The cost is $cost";
I almost certain that the above to equate to the exact same OPCODEs when
the php is compiled ... and you will never be able to benchmark a valid
difference
between them either way.
> AND CERTAINLY NOT
> print ("The cost is $cost");
the brackets are superfluous - but not incorrect.
newcomers should be taught to understand what the brackets are
actually doing (effecting operator precedence)
>
> echo substr('abcdef', 1);
> NOT
> echo substr("abcdef", 1);
rather nitpicking - again you'll never be able to measure the difference in a
meaningful way, nonetheless my preference goes for single quotes unless the
string literal I have contains a single quote.
explain to your noobs the difference between the quotes and tell them what your
preferences are and why - in the real world they'll come across all the
variations
that you/they/me/us/he dislikes so they might as well be given the facts up
front, no?
jmho.
>
>
> I will be teaching, so a book that a student can-- before the class--
> work through and understand is good-- doesn't have to be a traditional
> textbook! But it shouldn't be a reference manual either.
avoid anything where the title ends in 'for Dummies' ;-)
>
> c
> --
> Chris Lott
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php