The Reasons To Attend PHP Conferences

Thursday, February 4th, 2010

Recently, php|architect announced that they were extending the early bird pricing for the TEK-X conference being held this year in Chicago, IL. As someone who has been and will be going this year, this conference represnts a great opportunity for anyone who hasn’t gone to a PHP conference to attend one.

There are some good reasons that you should be attending.

Before I attended a conference, I had no idea what others were thinking with regards to PHP. The first big conference I attended was ZendCon and it was there that I discovered an entire world that I knew nothing about – the greater PHP community. But more than that, I discovered Really Smart People(tm) that I could interact with, be friends with, and who shared my passion for technology.

If you’ve put off attending a PHP conference, or simply are on the fence, you should seriously consider attending TEK-X this year. The conference itself has a great lineup, but I also know several people who are going to be there that are bright, talented and very enthusiastic about the PHP world.

That’s a great reason to go.

1:00 am | Comment (4) | Print | Categories: Community

HipHop For PHP: Who Benefits, Who Doesn’t

Tuesday, February 2nd, 2010

There’s been lots and lots of discussion regarding the Facebook “Hyper PHP” release of HipHop for PHP. This new technology is an in-production converter for PHP that takes PHP code, converts it into C++ code, and creates a complete binary that can be run on a server natively. Facebook claims improvements of up to 50%, and their model represents a shift in thinking about scripting languages like PHP.

Ostensibly, lots of people are going to be thinking about how this will benefit them and their organizations. Here are some thoughts on who will benefit and who will not benefit.

Who benefits
There are lots of benefits for producers of large-scale web applications written in PHP. The ability to convert PHP code into something else that is more efficient without having to retrain their developers will ultimately reduce server load and deployment costs.

In particular, anyone running a web application with more than two servers will certainly benefit, as there is likely the traffic necessary for such a large web application. With a 50% improvement, one could conceivably use only one server; however, for redundancy reasons, it’s likely a good idea to maintain at least two web servers.

Others who benefit include those who distribute PHP code to clients directly. The ability to deploy an application on a web server in a compiled format ensures that reverse engineering is more difficult and protects intellectual property. There is considerable debate as to whether or not compiled or obfuscated code is worthwhile; given that the product designed by Facebook must be efficient, the idea of distributing a PHP-based binary makes a lot more sense.

Who doesn’t benefit
For all the benefits, there is a large group of PHP developers that won’t benefit: the average, every day developer. There are a vast number of websites that have a single server and not very much traffic; there are also lots of sites that run on shared hosts, or sites that have multiple sites on the same server. Since HipHop runs one web application at a time (with a built-in webserver), it’s impossible at the moment to run more than one website on a box. This is obviously less than optimal for most folks, and will limit adoption.

Also, early adopters of PHP 5.3 won’t be able to use HipHop straight away. Currently, it supports PHP 5.2 (as most of Facebook is written in PHP 5.2), though there are plans to modify HipHop to support PHP 5.3.

Bottom Line
HipHop is still pretty awesome, and will certainly change the way PHP applications are developed. There are great opportunities here, and Facebook has certainly developed a revolutionary system. What will ultimately happen remains to be seen; regardless, it should be an exciting year for PHP development overall.

8:31 pm | Comment (12) | Print | Categories: General PHP

Some Soul Searching

Friday, January 29th, 2010

This entry isn’t about PHP.

It’s about where those of us who develop for a living, PHP or otherwise, see ourselves in the future.

From time to time I do some soul searching and think about where I’ve been and where I’m going. With a tough few months in the books, I wanted to take some time and figure out my next moves, and where I’m heading.

Soul searching isn’t easy, because it requires us to examine ourselves, and in particular, our mistakes, to decide whether or not what we’re doing is appropriate and good. Soul searching means reexamining every hard decision that we made and thinking about whether or not we decided rightly. And it means taking a hard look at where we said we were going, and whether or not we actually got there.

I’ll be doing some soul searching this weekend as I think about the direction I want to go. And then I’m going to employ my resources to get there.

1:00 am | Comment (2) | Print | Categories: Uncategorized

Cool DateTime Functions In PHP 5.3

Monday, January 25th, 2010

Over time, the PHP DateTime object has become one of the best objects available to PHP developers. This object has grown since early PHP 5 into a robust class that has the ability to do lots of great things.

Recently, I was exploring some of the functionality provided by the DateTime object as of PHP 5.3 (and wishing that Ubuntu had PHP 5.3 as a package distribution). Here are some of the new things in PHP 5.3 that are really cool.

Note: you can read the manual on the DateTime object here.

DateTime::add() and DateTime::sub()
The add() and sub() methods are about adding or subtracting the number of days, months, years, etc. from a DateTime object. The interface is a bit clunky, requiring you to pass in a DateInterval object. However, this still provides an easy way to modify a DateTime object.

For example, let’s say we wanted to add 3 weeks to our DateTime object:

<?php

$dt = new DateTime(); // Set to now.
$dt->add(new DateInterval('PW3'));
echo $dt->format('n/j/Y'); // Outputs 3 weeks from today's date.

?>

How is this an improvement over using the DateTime::modify() method? It improves on it in one specific way: it’s object-oriented. Rather than passing a string you have the ability to pass an object.

DateTime::diff()
One of the coolest PHP 5.3 features introduced was the ability to diff two DateTime objects. This returns to you a DateInterval object, which contains the details of how different the objects are.

$dt1 = new DateTime('August 3rd, 2004');
$dt2 = new DateTime('August 10th, 2006');
var_dump($dt1->diff($dt2));

The result that you get looks like this:

object(DateInterval)[3]
public ‘y’ => int 2
public ‘m’ => int 0
public ‘d’ => int 7
public ‘h’ => int 0
public ‘i’ => int 0
public ’s’ => int 0
public ‘invert’ => int 0
public ‘days’ => int 737

This can be extremely useful in determining the time difference between two objects.

DateTime::getTimestamp() and DateTime::setTimestamp()
Sometimes it’s just useful to be able to grab the Unix timestamp from the DateTime object. But prior to PHP 5.3, to do so required some clunky code using strtotime() and a formatted date string. PHP has fixed this, and you can now use these getter and setter methods to get the Unix timestamp.

1:00 am | Comment (11) | Print | Categories: Object-Oriented Development, PHP 5

Why Subversion Still Beats Git

Thursday, January 14th, 2010

There are lots of projects heading over to Git these days. It’s not hard to see why: Git offers great merging support, distributed version control, and a great playground. Spots like Github even offer centralization crucial to large open source projects. But when it comes to the corporate world, Git may not be ready for prime time.

Corporate America needs a centralized version control system. Subversion still offers this: Subversion centralizes the repository and simply checks out a working copy (versus Git, which gives you a complete repository). Corporate America still needs to have cannonical version numbers, and the ability to see the progress of a product over time as a single line – not a bunch of branches and independent repositories.

Git is a great piece of software. It is fantastic for distributed version control. It is my opinion that when it comes to corporate work, Subversion will still continue to win out

1:00 am | Comment (17) | Print | Categories: Version Control
« Older Entries
Search:
Copyright © 2008 - 2009. Some Rights Reserved.