PHP Reflections

In my (relatively) new job we use PHP for the backend. This is the first time that I’ve used PHP for doing any real work and now that I’m using it for real I have found it to be an interesting language. I am still on the fence about whether I actually like it or not but is does have some nice features. Given that I’ve only been using is seriously for 3 months now I can’t claim to be an expert and I know that I’m just scratching the surface at this point.

One of its best features is that dynamically compiled which really shortens the edit-compile-test cycle. I like being able to make small changes and see the (nearly) immediate result without having to go through a build phase. It’s also nice that there is a large library of functionality available as well as a large community of third-party solutions. I’m just now starting to look at some of the frameworks built on PHP and many look really good. I do really like the associative arrays, especially the ability to easily nest them, however, I don’t like the way that PHP merges them with indexed arrays. I know that other languages do this as well, but I don’t like it.

I think my biggest problem with PHP is just how easy it is to combine the output (view) with the logic (controller) and even mix in some data (model) into one file. This is the same problem that JSP had. This basically necessitates a framework of some kind in any large project. The syntax is also problematic for me. I find it messy and full of unnecessary items like dollar signs ($) which I believe come from the Perl past. Perl had a reason for using a dollar sign for variables: it indicates a “simple” value that is not an array (@) nor a hash (%). Given that PHP merges all of these into one prefix ($) it would be nice to get rid of it entirely.

Basically I think that PHP does a better job of filling the “dynamic, scripting language for generating web pages” than JSP does, but I feel that it could be cleaned up a bit and a little more structure added to make it easier to work with.

By Reflector

I am a Senior Engineer for VMware, a company that produces cloud and virtual machine software. When not working I enjoy board games and woodworking (producing furniture and other items for our house).

Leave a Reply

%d bloggers like this: