PHP is the new VB
- 2009-03-15
- Trackback URL
- General
For those who don’t know, I’m the webmaster for OutVentures. I volunteer my time trying to provide the membership of the club a kick-ass web site. Last winter, I completed a full rewrite of the site, which I’m told is the envy of other local LGBT sports organizations. Anyhow, it’s just my way of giving back to the community. When the site went up last spring, all of the core features were present but I’ve spent the past year or so periodically adding improved functionality for users and the board. For example, last week I added a trip reports listing section.
One of the original design goals of the site was to reduce the amount of manual intervention required by administrators. In particular, I wanted to streamline the membership sign up process. The process on the old site (which I did not write but which I maintained for a year) was:
- User fills out form on website to join the club.
- An email containing the membership information is sent to the membership director.
- User pays via PayPal or by sending a check. If PayPal was used, the membership director gets an email from PayPal once payment has been completed.
- Membership director enters the form information into an account creation form manually.
- Membership director emails the new member with a temporary password and user name.
The process for renewing a membership was not too different exception for all the filling out of membership information by both the member and director. It was an effective but extremely manual process. In the new version of the site, I worked on the flow was simplified to:
- User fills out membership form on web site, choosing a user name and password of their choosing. Their account is created immediately, but doesn’t have permission to do much of anything until they pay.
- User pays via PayPal or a check by mail.
- Membership director receives an email from PayPal confirming payment.
- Membership director goes to the website, clicks on the name of the user to approve.
- User automatically receives an email informing them that their account has been approved.
I spent the better part of this afternoon hooking up PayPal Instant Payment Notification (IPN) to cut step 4 out of the process. I got it working and it’s great. In most cases, a user will follow the sign up process and have their account activated automatically as soon as they pay by PayPal. Manual intervention will still be needed for cases where the PayPal email address doesn’t match the one we have on file (this happens more than you’d think). However, it should be a massive improvement in turnaround for new memberships and renewals.
In order to get this all working, I had to dig back into the PHP code for the web site and into the PHP manual for various pieces of functionality. After working in a .NET shop since July, PHP seems incredibly clunky while simultaneously quick and dirty. Adding some dynamic behavior to a page is easy and has a lot less overhead, but once you want to do anything more complex, it starts getting kind of scary. It’s funny because I worked in a PHP shop for about 2 years, but never noticed this until I’d been exposed to other ways of doing web development and had to go back. Not that ASP.NET doesn’t have its own idiosyncrasies.
While trying to figure out how to change the HTTP status code, it suddenly occured to me that PHP is totally the new Visual Basic. Apparently, I’m not the first one to have this thought. The similarities:
- Quick, dirty and easy way of writing simple code to solve a problem
- Easily lends itself to poorly structured code
- Not really designed to cope with more complex projects
- Lots of useful built-in libraries for basic coding (array, string manipulation, resource allocation)
- Not much support in the built-in libraries for large project necessities (logging, instrumentation, error handling)
- A large and growing base of software mainly due #1