Branching Out

I think that PHP is a great language. It’s useful. It’s quick. It might not be the most namespace-clean, but it does what I want, and it’s capable of some really great enterprise-class stuff if you take advantage of PHP5’s OOP features and know what you’re doing. At work, we’ve done some great things with PHP5, and I’m looking forward to doing more great things.

There’s just one thing. We are starting to do projects for more big clients and less small clients. Small clients love PHP for its ease of deployment, it’s nearly universal ability to play well with others (example: porting our CMS framework from PostgreSQL to MySQL to meet Coachella’s needs took about a day, and installing on their servers worked without a hitch). Big clients, however, tend not to take PHP seriously. There are a few reasons for this; not the least of which is that the reputation PHP as a whole has been ground into the dirt by PHP4 (which is a pretty weak language by today’s standards) and the fact that it is used everywhere by people of a wide variety of talent levels. PHP5 adoption has been slow, and most people think of the nightmarish spaghetti of PHP4 when they hear “PHP” at all.

Anyway, to the point: I feel that I really want to branch out into something else. A nice, mainstream enterprise-class web platform. Maybe even one that I didn’t write myself :-P. I have experience with .NET, but I would not consider myself a guru like I would with PHP5. I know Java like the back of my hand, but I have never really ventured in to J2EE. I tried Rails a few times (I tried to like it. I really did.) but always ended up rolling my eyes at something or other and going back to writing incredibly clever PHP code that trounced Rails in speed and resource usage. But I feel like I’m a pretty damned good programmer, and I can achieve guru status in any language or platform I choose. And I really ought to branch out, if only to keep me on my toes.

I’ve been looking at several different options. I’m going to jot down my thoughts on some languages and their corresponding platform options, in no particular order. I’m not going to touch PHP or Perl because I’m trying to branch out. And perl sucks.

  • Java: Pros:Great language. Strong, familiar C-style syntax. Sophisticated reflection API, generics/template classes, run-time classloading, decent exception handling. A LOT of work has gone into making good implementations of the VM, with good success (in my opinion). Cons: JVM is slow to start up (irrelevant for a web application - JVM is always running). JVM uses a lot of resources. I don’t like the available platforms(see below…)
    • J2EE: This is THE web platform for Java. And I hate it. I’m sorry, but it’s crap. It is so needlessly complicated and polluted with meaningless buzzwords and stupid diagrams for PHBs to admire. A web application platform is not that complicated. You don’t need to list out a hundred different “tiers” so you can throw in as many buzzwords as necessary. Seriously, it’s worse than .NET in this department. Unfortunately, I will probably end up using this one because it’s a de-facto standard.
  • Ruby: Pros: A well thought-out language. I can see the attraction. Very expressive and elegant. Clean namespace. Decent reflection. Cons: I personally prefer C-style syntax (def this and end that kind of turns me off) but I could come to accept the lack of beautiful curly braces if I had to. Implementation is sloooooow, but (hopefully) getting better.

    • Rails: It’s so hot right now! Seriously, there has never been a web-dev fad as pervasive as Rails. Along with pastel gradients and rounded corners, Rails practically defines the “Web 2.0″ movement. Everywhere you look, it’s rails this and rails that. How ‘Rails-like’ can I make this? How can I make this more like Rails? What would Rails do? Yes, everyone wants to be like rails.

      Trouble is, nobody actually wants to use Rails, at least not for anything particularly important. That’s because the current implementation of the ruby interpreter is so mind-bogglingly slow and borderline unstable. Also, in my opinion, Rails does things a bit backwards - rather than creating code basically at run-time from the database structure, I think the code should be in charge of the database. Call me crazy if you must. Code is boss.

  • Python: Pros: Expressive and graceful in much the same way as ruby, only more mature. Very widespread, and very fast interpreters/compilers exist. Easy to read by definition. Good OOP features. Cons: Once again, I prefer C-style syntax. Scoping by indentation is pretty odd.

    • Pylons: Of all the platforms thus far, this is probably my favorite. It’s simple. It’s light. It’s all the things I think a platform ought to be. If I can love Python, this will be my choice. I think. It’s kind of like Rails, but fast. It also has only what I need and leaves me to write my own active record scheme, which I like - because I am pretty picky about how my data modelling works and I’m very dissapointed in Ruby’s ActiveRecord, for example.
    • Django: Another Rails-ish framework for Python; a little more complete at the price of some bloat. I really like how the schema comes from the code, and not the other way ’round (like Rails). They read my mind on this one; it’s precisely how the next iteration of our PHP platform works. I might look into this one a bit more, but I am currently leaning more toward Pylons because it doesn’t try to push any pre-fab AJAX crap on me. I like to do my own AJAX. For that matter, I like to have as much to do with the inner workings as possible (that way the mistakes are mine and mine alone), and it’s very difficult for me to even consider Somebody Else’s Framework. Django is just a bit too much.
  • More to come?

Disclaimer: These are my opinions only and are not necessarily those of my employer. Also, if you have something to say about how much of an idiot I am for dissing your favorite platform, I really don’t care.

Leave a comment

You must be logged in to post a comment.