
PHP for Dummies now sits on my bedside table–but it’s way too shocking for any late night reading.
Coming to PHP from the genteel, dignified world of C++ and Java is like walking into a room and discovering–Mrs. Robinson! What are you doing?
In Java, defining a variable is something that happens only after long, dignified courtship. Not even porcupines mating are so careful. The imports, the classes, the public static void main (String args [] )–and then finally, after many a bouquet of roses, you’re ready to beg the favor of, please–let me define a variable or two.
Then you have to spell out what you want, to Java’s complete satisfaction:
int number1 = 1;
String dontSayNo = “please”;
String beggingYouNotToSayNo [] = {”pretty”, “pretty”, “please?”};
Wooo–PHP doesn’t care about stuff like that:
$one_variable = 5;
$another_variable = -2.55;
$yet_another_variable = “Just show me that dollar sign, I’m there!”;
OK, that was my shock yesterday–this is today. Today I told Scott Johnson, who’s teaching me this stuff, “Mrs. Robinson just took off her skin and showed me her skeleton–I’m declaring arrays!”
In Java or C++, you have to set aside all the space you need before you start filling arrays. But PHP has that same “Hey–why not?” attitude. You can start an array, throw a couple of elements in it, and then decide later you want to add several more.
What a whole new world of freedom–it’s like being able to say, “Mom, I’m bringing a friend for dinner…” Then you show up with 7 friends, a puppy, plus (Scott adds) a parakeet and a goldfish–and Mom says, “Hey, no problem, who ever runs out of spaghetti?”
When I grow up, I want to be PHP!
