Archive for June 5th, 2006
Dev Shed - June 5th, 2006
Do you think that programming sockets with PHP is really hard work Not at all. If you re still not convinced read this final part of the series Handling sockets with PHP. In three parts this series shows how to work with low-level sockets in PHP. It introduces some of the typical tasks such as creating sockets as well as reading and writing socket data….
(Advertisement) MKS for SEI Capability Maturity Model Level 3 Free MKS whitepaper that focuses on providing an understanding of the requirements and tools that are necessary for an organization to reach CMM Level Three. Includes a short successful case study on Lockheed Martin.
Continue Reading ·
PHP Developer - June 5th, 2006
Unit testing in PHP applications is growing more and more in popularity, so much so that some developers get into it, test all of their code and aren’t exactly sure when enough is enough. Jim Plush has a suggestion for those kinds of testers - consider the cyclomatic complexity.
It’s one of the most common questions you ask when you first start using Test Driven Development or Unit Testing in general… When am I done?
It’s the point you feel confident when all your tests exercise the code in your classes. How do I know when that point is? I’ve come across a new way of finding this point using something called cyclomatic complexity. Developed by Thomas McCabe in the 70’s cyclomatic complexity is a simple measurement of how complex a piece of code is. One of the nice parts of it is that you can use it when working with unit tests.
To illustrate, he gives a simple example of a function with only a function call and return inside. This has a cyclomatic complexity rating of 1 (the lowest). Now, start adding in ifs, loops, and other ways for the data to go and you start adding more complexity levels. Jim suggests that this can be another useful unit testing measurement - one more unit test for each level of complexity.
He also notes a pleasant side effect of this sort of classification:
The other nice part of a CC number is you can quickly find out when a method is ripe for refactoring. If you have a method with a CC number of 20 you know you most likely have a problem on your hand.
(0 comments)
Continue Reading ·
PHP Developer - June 5th, 2006
DevShed has posted the third part of their “handling sockets in PHP” series today, taking things one step further than the basic TCP server from before and making a basic web server.
It’s time to pay attention to the subject of this final part of the series. In this article, I’ll show you how to use low-level sockets to emulate the functionality of a basic Web server on your own testing machine.
They start with a quick look back, mentioing what the simple TCP server could do and (briefly) how it worked, including its entire code. Since it was simple to extend, they create a new class, WebServer, to add the functionality it needs to response as a web server. It’s made to serve up one file - a static HTML - whenever the user hits it with a request.
His simple server dosen’t conform to any of the standards, but it does transmit data out over the standard port in an HTML format. It’s a step in the right direction…
(0 comments)
Continue Reading ·
PHP Developer - June 5th, 2006
Damien Seguy of Nexen.net is back again this month with the latest usage statistics for our favorite language for the month of May 2006.
Some of the highlights he mentions for this month include:
- a move by PHP 4.4.2 towards becoming the dominant PHP version in use by June 2006
- PHP 5.1.2 rules the PHP 5 world
- PHP 5’s adoption went up again, another 8% (and is being adopted at a greater rate now as well)
- PHP 4.3.9 and older are still alive and kicking with 46% of the share of hosts/domains still using one of them.
For each of the types of stats gathered, there are graphs and charts to make quick viewing possible - some of which are a little surprising. It’s always interesting to me to see the “adoption by country” map’s results, a good reminder that PHP is everywhere and is definitely being used.
Also, be sure to check out the PHP’s evolution results for data on the actual language’s current state.
(0 comments)
Continue Reading ·
PHP Developer - June 5th, 2006
In an FYI kind of message from the folks at php|architect, the Call for Papers for this fall’s edition of php|works/db|works is just about over - ending tonight around midnight.
This year’s event is being held in Toronto, Canada from September 13th through the 15th with some seminars starting before it on the 12th. The theme for this year’s conference is “Lighter. Faster. More Powerful”.
For more information on the Call for Papers, check out all the details here and get your submissions in today!
(0 comments)
Continue Reading ·