PHP5 Just Around the Corner
HitByASquirrel writes "Just doing the rounds and I found that Zend has released PHP 5.0 Beta 4: 'This fourth beta of PHP 5 is also scheduled to be the last one (barring unexpected surprises, that did occur with beta 3). This beta incorporates dozens of bug fixes since Beta 3, rewritten exceptions support, improved interfaces support, new experimental SOAP support, as well as lots of other improvements, some of which are documented in the ChangeLog.' Hopefully they won't have any 'unexpected surprises' and we'll see this before summer!"
... wake me up when PHP 5 final is ready.
Recently I've had a chance to do some web design with PHP. Previously I'd used Pearl because I'd heard from many people that Pearl was the end all and be all of scripting languages for the web. Imagine my suprise to discover that PHP was vastly superior! I know this is a bold statement, but I have solid arguements to support it.
Before I begin, let me just clarify something. I'm not arguing that PHP is better than Pearl in all cases. There is certainly still a use for Pearl. Also, PHP isn't perfect but it does manage to fix many of the shortcomings I've had with Pearl. Here are a few of the things I've noticed about PHP. Finally, I'm not the most talented Pearl programmer out there. I generally prefer to use the vastly superior Phyton, but can use Pearl if I have to.
- Ease of use. After about a day I had an excellent understanding of both PHP and SQL. I was able to get a stable, useable and presentable website up within 24 hours of reading the basics of PHP. Learning Pearl took me weeks and I'm still not even as good with it as I am with PHP. I would definitely not recommend anyone new to programming begin with Pearl.
- The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Pearl's OO still needs work (whether or not OO is all that great is another discussion.) Hopefully Pearl will be patched up so it supports such must-have OO features like introspection, reflection, self-replication and ontological data-points.
- Outstanding database support. PHP supports virtually every DB under the sun (although Berkeley DB is missing, oddly enough.) Pearl seems limited to MySQL and PostgreSQL, and its really a kludge for the later. I've heard that this will be fixed in upcoming versions of Pearl though.
- Speed. PHP is one of the fastest languages I've ever used. While it won't be replacing assembly or C, its definitely faster than Pearl in almost every case, particularly in regex which has long been Pearl's strongest point. I'm sure there are cases where Pearl is equal to PHP, but I can't think of any at the moment.
- Portability. I can take PHP code off my Linux box and plop it onto an IIS server, or even one of those new McIntosh servers and have it run without having to change a single line of code. Try doing this with Pearl! Its as though it was written in assembly, Pearl requires that much rewriting.
- Graphics. PHP comes with a nice little graphics library. While I wouldn't use its to code the new Doom (VB would be a better choice) its adequate for most web pages, and should be considered as a substitute for Flash for certain things. Pearl lacks a graphics library of any kind.
- Data Structures. Under PHP you can create any type of datastructure you need: Linked lists, binary trees, hash tables, queues, inverse Reiser-biased recursion trees, etc. Under Pearl you're extremely limited in what you can do. This is because Pearl isn't OO (so you can't create Node classes, for example, usefull in a linked list) and because it lacks pointers. Some of you may notice that PHP lacks pointers, but look deeper! Behind the scenes, hidden from the user pointers are used. Because of this, PHP can support complex data structures.
Again this is just my experience. I don't mean to offend any Pearl coders because Pearl was an excellent language. However, in certain cases it may behoove one to write the back end in PHP instead of Pearl.Are they rewriting the docs to actually explain the features of the language
and how to use them? I tried to learn PHP, but I got really tired of reading
about how much "better" PHP is than Perl because it's Not CGI(TM). Come on,
stop *saying* it's better and *show* me it's any good. What features does
the language have? How would I go about using them? If PHP is so good, the
docs ought to be able to convince me of that without endlessly repeating it.
I also got tired of seeing what ought to have been one-liners written in
fifteen or twenty lines of PHP. Is the language really that needlessly
verbose, or are those just bad examples?
In summary, the documentation is so bad, I can't even make a decent evaluation
of whether the language is any good. The *first* thing the PHP crowd needs to
fix is the documentation. It ought to be rewritten from scratch.
Cut that out, or I will ship you to Norilsk in a box.