On the Zend Developer Zone there's a new article/tutorial posted from Padraic Brady introducing you to the art of unit testing your applications and development.
Testing is an essential aspect of developing in any programming language. If you don't test your source code then how can you verify it works as expected? Manual testing can only be performed irregularly and usually only in limited ways. The answer to testing source code regularly, and in depth, is to write automated tests which can be frequently executed.
He talks about testing frameworks, its filtering in to practices on larger community projects, and a few fallacies that most people have about unit testing (including time involved, difficulty with complex code and that it's just boring). He also includes some examples of what a unit test might look like for some simple code - including explanations.
He rounds it off with some of the "why use unit tests" reasons he's found over the time he's used them like:
Automated tests can be run as frequently as required
Unit Testing can improve the design of code especially with Test-Driven Development
Unit Testing forces you to confront the problem head on
With a comeback from the eight reasons not to write for the PHP manual, Philip Olson has made his own post with a few of his own reasons why you should.
How do we appropriately credit the kind souls who seemingly work anonymously within the php.net CVS repository? Not sure, but here are about 8 reasons why you should write for the official PHP manual.
Among the items on his list (longer than eight reasons) are things like "You'll own a cool @php.net email address", "You'll gain experience using DocBook and the related tools to create documentation", "You'll make new friends" and "You'll help make something better, something you use. It's good to use things that get better, right?"
Check out his full post for the rest of his reasons.
Starting off the week on a light note, Hannes Magnusson has posted a few reasons why *not* to write for the PHP.net manual.
His tongue-in-cheek list includes:
You get a free pass to conferences by converting your work into presentation
You get a "trading card" and considered a star
You can flame the documentations without needing to do anything about it
You can license your work to forbid any commercial use or further improvements
Hannes also responds in a later comment to the post:
More and more people are thinking about themselves and publish their work on their blog or sell it. There isn't anything wrong with that, but its very annoying that user need to search for information on blogs, commercial websites or magazines rather than the manual.
Krystian Hoffman has posted to his blog today a few reasons (10 to be exact) that he likes and uses PHP. Fortunately, most of them are some of the best reasons for anyone to use the language.
ended up with ten points on why I use PHP and I guess this would be a good post here on my blog, as it seems people like lists in general and maybe I could get some people out there that aren't really sure about whether PHP is good or bad, to get some insight at least.
It's always interesting to get an outsider's perspective on the language that we all work with and love (or hate, just depends on how debugging's going). In his latest blog post, Chris Justis does just that with some of his comments from an interview with IEEE magazine about why Java will outlive PHP.
I had the good fortune to be interviewed by an IEEE magazine in February to comment on the demise of Java (vs. PHP). A 45-minute interview turned into a paragraph in the article, but I thought that I might put all of my thoughts up on my blog.
There's some interesting ideas here, but I'm not sure that most of them mean the "victory" of Java over PHP. In fact, most of them seem to reinforce the thought that PHP and Java will coexist happily for a good long while.
I've never disputed the fact that PHP has problems, but for some reason, everyone who tries to explain why PHP sucks misses most of the actual reasons it does. It's astonishing.
Chris also makes the comment that he doesn't actually give six reasons, but the first three of the ones he gives are solid ("No lexical scoping", "No namespacing", and "World's worst configure system").
On her blog today, Ligaya Turmellebrings up some comments made previously by Rasmus himself to answer the question "why use PHP5?" and encourage adoption of this powerful version.
Noticed an interesting thread on the PHP-general mailing list. The original thread was someone asking why should the world start adopting PHP5. Rasmus came back and answered the question with a list of benefits of making the change (using 5.1 not 5.0). Now I admit to not working with any of these, but many of them certainly look interesting enough for a second glance.
The items listed include:
SimpleXML
Improved DOM support
the inclusion of xmlreader/xmlwriter
SOAP functionality
a native date/time mechanism
The PHP5 adoption rate is slowly on the rise as more and more development is done on it, but it's still surprising to me how much of the world is still back in PHP4-only land.
According to the reasons listed here, PHP isn't good for much more than just the smallish, more personal sites. It was originally written back in 2004, but has just been recently updated (April 2006) with a more current state of PHP.
I have been developing in PHP for six years now. PHP is very easy to program in. But PHP also has some serious flaws. Below I give some reasons why you have to do some serious thinking before implementing a large scale web application in PHP.
Some of the reasons they give include:
Many PHP-modules are not thread safe
Non-standard date format characters
No Unicode
It's interesting to see how many of these reasons seem to be more of a preference than a real standard, and the "crippled for commercial reasons" comments are very interesting. Also, several of these will be addressed in the next version of PHP, version 6.
Justin Silverton has posted a comparison between PHP and Perl, with the first part coming more from the PHP side comparing it to Perl and the second the opposite.
He starts off with some of the differences between the two langauges, including that PHP was made for the web, Perl was not and that PHP scripts take less overhead for the web server to run that Perl scripts as CGIs. There are also four larger topics that he looks at:
PHP has separate functions for case insensitive operations
PHP has inconsistent function naming
PHP has no lexical scope
PHP has too many functions in the main namespace
All but the top item (that one could be argued either way) are reasons that a Perl user might cite against using PHP. For each of the items, there's a bit of description following to give you a better idea where they're coming from.
He quotes from their site where it mentions that their goal is to "continually evolve by attracting a community [...] to provide additional functionality to the already existing rich feature set."
Of the five raeasons he gives, here are a few:
difficult to integrate into an existing design
admin navigation issues
security
While some of the issues her points out here are a matter of personal preference, the "security" aspect caught my eye. These days, especially with all of the talk about security in the PHP community, that should be one of the first things groups look at in their software. From his comments, OSCommerce doesn't make it very easy to implement a patch either.