Google Blogoscoped

Saturday, July 17, 2004

PHP Criticism

I'm following up on some PHP criticism pointed out over at Gadgetopia.

PHP is a very pragmatic approach to programming; it works for many things on many servers.

But one thing it's not: elegant. In fact PHP syntax is a big mess. Just playing around with the language and exploring it following its own rules is impossible.

First of all you have inconsistent function naming. It's "strip_tags" but "stripslashes", to name just one. Thus writing PHP means paying regular visits to the homepage ( Remembering most of the function names is a hard job. Especially considering most programmers will have to remember more than just one or two programming languages.

Then you have annoying variable "$"-prefixes (which were designed without European keyboards in mind, like most programming or markup languages).

You also have just plain too many functions doing similar things, and they are all available in global scope (somewhat over 3,000).

Another woe is you can't force variable declaration. This means you will have a tough time hunting certain bugs. I saw the following example:

"DELETE FROM customers WHERE areacode LIKE '$areacode%'"

What if you misspell "$areacode" so it will not be set to a value? Well, then the whole table will be emptied. (It's good style to use something like "LIMIT 1" here, but this is just an example.)

XML is non-existant, or where it exists, it's not standards-compliant. The whole purpose of XML is that it is a standard (or recommendation, as the World Wide Web Consortium likes to call it). If you don't conform to these standards, you might as well use any kind of text file to store your data. Luckily, the XML problem has been solved in PHP5 (along with the lack of OOP in PHP4).

A large amount of trouble in PHP is introduced by settings which don't make sense. Like a magic-quotes feauture (no, they won't call it bug) which escapes all incoming user input with back-slashes. So "It's a test" becomes "It's a test". Thank you, maybe you want to force a spellchecker on me as well? You wouldn't believe how many PHP web applications fall in this trap and show user input with back-slashes because PHP disrespected their data. To work-around this, you need to include the following into your scripts:

if ( isset($param1) && get_magic_quotes_gpc() )
    $param1 = stripslashes($param1);

Another issue with PHP are its utterly cryptic error messages. I stopped reading them. The error line mostly does not indicate at all where you forgot that semi-colon.

Well, so why don't I just switch to Python? After all, Python is much more beautiful. Because Python doesn't run on every directory on my server. The same goes for ASP, ASP.NET, JSP or anything else. PHP is not a beauty, but it's highly pragmatic for many things on many servers. Which is why it will probably be around for a very long time and who knows – one day it might even become prettier. In the meantime most programmers will use whatever environment they have to work with to get their job done.

A Strange Google Journey

(This is a free speech.
All sentences are quoted...
By using Google’s search engine.
Everything I’ve found using Google.
Every single sentence I write from now on.
Just copy the line and paste it in your browser.
In occasional spots I’ve adjusted punctuation and paragraph breaks for greater clarity.
Every line belongs to one person.
Every line belongs to one organization.
Remember these are all true quotes.
Including the headline of the submitted article.
Including this first paragraph.
I know you can google it yourself. Sometimes we lack in content, but we compensate with style.)

So, what is the meaning of life, really?
And are blogs going to ’usurp’ big media?
(Big Media – as in ’Big Media, the homogenous monolith’.)
You realize, of course, that this may be the most dangerous part of our journey. Or any journey you’ve ever taken.
And so the Google journey began.

I wanted to write a text that is relevant so as to show students how physics applies in their everyday world.
I mean, everyday I go and I do things because I have to.
We all are forced to suppress our natural response to stress.
These days everybody wants a winner and athlete’s are forced to or willing to do whatever it takes to win.

Mind you, the winner would have to fight Brian my killer radish.
OK, before this turns into another soap opera, we have seen email that a security site is down, and that is enough.
To Explain How to Answer a Call from Space.
Or rather, to explain the many elements that go into arranging and performing good tango music.
Seriously, this is all so awesome - thank you so much for finally making it easy for us to do something we’ve wanted to do for so long.

This text is actually a combination of computer-driven exercises.
This text is actually a blank Flash movie that has the text from the H1 tag pumped into it.
All it takes is Google to find them.
Of course, using random sentences wouldn’t make a very good Italian sonnet.
Then again, Italians have long joked about being a nation of “saints and explorers,” and space is, after all, the final frontier.

So, what is the “final frontier” in emulation technology?
Or technology in general as a means of saving education.
What is the final frontier? Ask any scientist and the likely answer will be “the ocean.”
So, how does this work? Let us start with basic facts.
The function set made available to the genetic programming search for each sentence needing repair is derived from the set of partial analyses extracted.

I wanted to write a poem... but I didn’t.
’Opus’ means a ’work or construction’.
I guess I wanted to write about what we all want and can never have – the ability to rise above our lives.
After all, life has something serious in it.
Though not the kind of seriousness that sits heavily on the soul like puritan theology.
Not the kind of seriousness that seems to come along with a Billy Graham sermon, “This is your only chance!”

I just type the exact name of what I’m looking for, and start the search. Old Google hasn’t let me down yet, I’ve found some real off
the wall things.
I’m using google to post messages.
I’m using Google to think of stuff.
This is not everyday stuff here.
I mean, it’s more complicated than that, but my point is...
I mean it’s more like team work.

Success on the Web is a team effort.
A team effort that took the Brazilian men to victory.
What can be accomplished with a team effort that cannot be accomplished with individuals working separately.
Teams are unique, no two work exactly alike.
Teams are unique because they are comprised of young adolescents utilizing community technology centers as laboratories for their work.

The Web revolution is not about computers or technology.
What is the World Wide Web, really? What they know about you.
But who are they, exactly? What is their training, and what help can they offer you?
What is the web supposed to be? A resource for good quality content.
What is it the search engines are supposed to favor?
I believe search engines are still the ultimate form of advertising in terms of both the time and financial investment required.
Advertising today means working with electric e-commerce and traditional creativity, exploring the best possibilities.
Truth is or at least should be a basic principle in advertising as in all communication.
And this is just as important - if not more so - in online advertising as in any other marketing tactic.
That’s because tactics are but means of achieving strategic objectives. So, always plan strategy first.

Can you do a Full Corporate Murder Mystery for us?
Can you climb the Latin Mountain 1,000,000 M high?
How well can you use the web?
How well can you follow directions?
How well can you Spell?
How well can you write?

Questions. Nothing but questions, and unfortunately for the Indiana women’s water polo team, there are still no answers.
Sounds crazy? Well, yes. Yes, it does.
It’s crazy, because these will just write themselves since I’ve spent so much time thinking about them.
Language, metaphor, sentences out of nowhere, as if this miracle is something more – religious, blinding.
A rectangular matrix is populated with these words in random positions and directions.
Not Matrix the movie. I wish I hadnt given them my money.
The Matrix – that is, the world.

Our World, Your World, Europe in the Service of Globalisation with a Human Face.
This is not the “old Europe”, as Rumsfeld says.
Come on, Rumsfeld is right – freedom is untidy!
(Everything I know I plagiarized in high school.)
Google is just so smart. Conversions, phone number lookups.
Real live conversations that surround me all day.

Every sentence you read or book that you flip through will affect your writing, just as every place you go and lesson you learn adds to the whole of your person.
Not only Google but also specialist search engines - plus the ones in between like Teoma.
I’m using quotes here a bit cynically.
Now I’ve written myself into a corner. At the heart of these “revelations” is truth. Yes, I’m using quotes.
Google this, Google that, Google Google Google.

(Google this, Google that. Is it always the best search engine? No.
For past two months, all we have heard is Google and nothing else in Silicon Valley.
Search engines are not the only means whereby people find sites.)

How else do you think the Dolphins escaped the Vogons?
Humanity needs to understand the Universe to survive. How many of us actually realize the importance of the present moment in the human history?
Humanity needs to know!
Humanity needs to make fundamental changes in how they live in, relate to and understand the world

Just like dolphins we are of like mind and yet very individual in what each of us brings to the pod.
As living beings, we are woven into the web of life, just as all other life forms are woven into that web
We are pure energy and totally interconnected with other living beings.
The Web makes it possible to assemble and integrate all those components into the text itself.

Because it is time, the eyes open, the body stands up, the hand stretches out, the fire is lit, the smile contends with night’s wrinkles.
We grab what we think (what we hope) will fill our yearnings.
And in our hands, we will leave something as a legacy for society.

Evolution wants us to believe that species progress an infinite ladder upward.
We only act because the evolution wants us to spread our genes.
How can the dream of absolute liberty and the reality of absolute
interdependence be resolved while our genes survive?
Will we survive if we lose two games, three games, maybe even five?

Especially in the last decade, liquidity, simultanaety, transparancy, and access for all bring to the ring not only the fittest of the fleet thinkers
In fact, the best of us are generalists who know a little about many things.
It’s all about knowledge and learning. It’s what I relish. It’s how I live my life.
Divine life wants to learn first and then enjoy.
Life wants to help you to develop to your fullest potential, scoping out your options as you decide where you can contribute.

So next time you think of the cashier at the bank as other, when you see your parents or spouse as other, remember what you’re doing to yourself.
If we are all striving to develop ourselves spiritually, then we should have something constructive to discuss.
Society these days has lost the lack of “communication” in the community, so we rely on the government to help us out instead of each other.
But society cannot transform the individual; it is the individual who can transform society. By negating the individual, it negated its own success.

With these things in mind, you should be just about ready to embark on your very own web logging journey.
If not in a blog, then in one of many possible ways.
May you always remember: those lives you have touched and who have touched yours are always a part of you.


Blog  |  Forum     more >> Archive | Feed | Google's blogs | About


This site unofficially covers Google™ and more with some rights reserved. Join our forum!