Archive for the 'PHP' Category

Ditching PHP: Alternatives to PHP

Wednesday, November 26th, 2008

You have worked around the quirks and you have lived with the inconsistencies. You have stood by and watched your code fail spectacularly between minor point releases. You scrambled to fix your code’s dependence on register_globals set to on when they got turned off by default in version 4.2.0. You have lived with the disappointment when version 5 failed to deliver on better object orientation. There have been a lot of warning signs telling you to look for better alternatives, but still you persevered. Then came the recent changes that really make you shake your head in disbelief. Face it, PHP’s direction as of late has really taken a downturn. You’re thinking it’s time to look for alternatives.

If you are one of those folks who have been using PHP and nothing but PHP for a long time you will be hard pressed to find an alternative. PHP is, after all, one of those things that are “easy to get into, but difficult to get out of”. PHP lures you in with its forgiving nature, vast library of pre-built extensions, ease of deployment and just plain “instant gratification”. It’s easy to forget that there are other languages for server-side programming/scripting.

(more…)

Definitely Time To Ditch PHP

Monday, October 27th, 2008

Good bye PHP. You have been a good bread and butter language for me. Sorry to say the dumbosity of the design decisions being made about you are too much to live with. It’s time I moved on to bigger and better things with a better sense of direction.

(more…)

Is It Time to Ditch PHP?

Sunday, October 26th, 2008

PHP has long been a bread and butter language for me when it came to web-based projects. It’s what got me started in the whole web development business and essentially kick-started my whole career as a systems developer. But alas, recent developments in PHP land come as an unwelcome surprise. I’m talking about the much anticipated (for me anyway) namespace support. I have documented my basic gripes about PHP elsewhere. So I won’t go rambling about them again. I was excited to hear about namespaces finally getting implemented in PHP6 and backported to PHP5. But then when you read about bullshit like this you can’t help but wonder if the language’s direction has been taken over by a pack of neurotic, crack-smoking monkeys. Namespaces are a very important feature if one were to write large amounts of code without having to worry about symbol name clashes.

(more…)

When is a Closure not a Closure?

Tuesday, July 22nd, 2008

Answer: When it’s a PHP closure. It appears that PHP will have closures in 5.3. But as per usual, it does not work in ways that you would expect it to work. See the comment by “sapphirecat” on this . There still appears to be a problem when you “rope” off a global:

So they seem to have taken the usual half-broken approach: you can have read-only closures which are immune to changes to a global variable, or you can have read-write closures which remember changes, but those changes leak back into the global variable.

Oops! Closures are not supposed to do that! It sort of defeats the purpose of having closures in the first place. There is a workaround to the problem but that is one more quirk that you have to remember when working with PHP. Two steps forward, one step back.