Errands and the End Of PHP
Got stuff done.
In this case, the stuff was of a many and varied nature and involved:
- Sorting out bank accounts
- Joining Blockbuster
- Joining Library
- Posting Stuff
But also:
- Resolving that I will never again begin a personal project written in PHP.
Yesterday, you see, I managed to get PHP5 working on Atoll, my local server. It works fine, from a technical standpoint, it installed straight into the right place, it works, it access the databases and everything.
Epistula, however, doesn’t. Neither did AqWiki, Aquaintances, Klind or Pareidol. Why?
Because somewhere in the PHP5 development process, somebody wrote a function to return the contents of a directory back as an array, and called it scandir() which, co-incidentally, is the name of my stock function for returning the contents of a directory as an array. It means that, as of PHP5’s full release, my code is broken. This is, in fact, wrong.
One of the great benefits of PHP is it’s integration. Everything available was in the manual, which was searchable and contained the wit and wisdom of several years of PHP developers who had been where you are before you were there.
The greatest flaw PHP has is it’s integration. Functions have been added haphazardly over the five major revisions to the point where, given a two word function, it’s equal odds to be firstSecond() as first_second() depending on who coded it when. Also, the willingness of the development team to break every previous PHP tutorial in a minor revision (Witness the whole REGISTER GLOBALS debacle), Perl – the language with the most established collection of modules on the market – has a namespace system for added on functionality which works so well even Python copied it. PHP, however, is no longer a stable platform to develop releasable code on, since your code may stop working at any point. Worst, this will manifest itself as a PHP syntax error, and you cannot guard against new internal functions unless you check the existence of every function before you use it.
So, PHP, it’s been nice using you, but until you stop fucking around with the namespaces, it’s time to try something new.
Suggestions, anyone?
- 2004-03-29 17:59:40
- Updated 36 minutes later
- By Aquarion
- From Casarufus, Letchworth
- More Journal Entries
- Filed under Programming & PHP
Simon Willison:
mod_python continues to rock my world. I think modules or some other way of avoiding polluting the default namespace is the one feature PHP needs more than anything else – they are up to nearly 3,000 functions now!
Adrian Holovaty:
If you really must work in PHP, write a Python code generator that spits out the PHP for you. :-)
Tim Parkin:
Parrot would be nice.. :)
Tim Parkin:
Parrot would be nice.. :)
Tim Parkin:
Parrot would be nice.. :)
Senji:
Was that supposed to be mindlessly self-referential? :-)
Senji:
Is it supposed to say:
“Logging enabled, logged events have been written to the file /tmp/jabberlog.txt.”
Above the banner when I make a reply?
Aquarion:
ahem Yes, of course it is.
(Fixed the thing that caused the multiple comments, forgot to turn off logging afterwards)
Gary Fleming:
Until PHP gets some proper namespace support, you should try prepending your own namespace function names, in the same way that the output buffering functions do.
SkepticJoe:
You have to be joking!?
Aquarion:
Joking how?
Joking by skipping out on PHP?
Annoyingly, I’ve been proved wrong. I’ve been doing little but PHP since I wrote that article – professionally now – but I’m still annoyed about how sucessive itterations of PHP will break both my own code and the codebase at work, purely because we didn’t have a crystal ball handy to see which functions the PHP Dev team would include in future releases.