PHP: Things that Annoy Me

It seems that nearly everyone who has dabbled to one extreme or another in PHP has a few gripes related to the language’s ad hoc design. It isn’t a very elegant language, nor is it well-suited to much outside the world of web applications. What it does do it does reasonably well, and its bar of entry is low enough that even novices can have a working site up and running with some dynamic components here and there within a few days of playing with sample code. Unlike more complicated frameworks of the Java, Python, or Ruby worlds, PHP requires little–if any–knowledge of common design patterns and practices. For better or for worse it’s a language that grew out of a set of utilities and still retains much of this feel–and design.

The volume of “PHP annoys me” articles have blossomed tremendously over the years. I think this is partially the result that those of us who essentially “grew up” with the language are now discovering with increasing frustration that the very things which made the language easy to use are what cause it (or more appropriately us) so much grief.

I’d like to contribute a little to beating this particular dead horse. Maybe it’s not quite dead yet.

Ahh, how I could make a Monty Python reference out of that!

Update, June 21, 2009 If you like this article, you might be interested in this site. Read more…

No comments.
***

Windows 7 Disk Thrashing Quickie

When I left my computer on for a while before I went to grab lunch today, I came back and–expectedly–the monitor was powered off. So, I moved the mouse and…

Nothing.

Instead, the disk was thrashing like crazy. I figured it was possible something had gotten swapped out to disk. Unlikely, sure, but stranger things have happened. Long story short, it took nearly a minute after pressing ctrl+alt+delete before anything appeared. I’ve never had this happen under XP, and it turns out that nothing had been swapped to disk. Most applications were responsive but that disk thrashing had to stop.

I poked around with the process and service list for some time before I finally settled on the culprit. In Windows Vista, it is fairly well known that the Windows Search service will actively index accessible files. Windows Search appears to be more well-behaved in Win 7 and disabling it didn’t have any effect. It turns out that the misbehaving process (which had read more than 2GiB of data by the time I got to the system) was a surprisingly well hidden one. It’s launched from the Task Scheduler and is called “WinSAT.” It’s purpose is to “[m]easure a system’s performance and capabilities.” Here’s what it looks like from the scheduler (click for a slightly bigger version):

Honestly, I don’t like it when a service runs, eats process time, and more importantly hampers my ability to do useful work. This is especially true for a service that simply measures a system’s performance. Why is this needed? In particular, why is this enabled by default to run automatically, without user input, and why is this a redundant feature to the system performance index accessible from the system information dialog (winkey+pause/break)? If I wanted it to run, I’d do it myself.

I’m assuming it’s only run once even though the scheduler is set to “whenever the computer is idle.” In either case, I don’t trust it. It stays off.

Update:

Be sure to go through the task scheduler. I found a few additional tasks that were set to run automatically which could affect performance, including automatic defragmentation. Now I understand why there were so many complaints about Vista!

2 comments.
***