This is the second in a mini-series of two posts that I’m calling “Posts in Which I Gripe About Widely Appreciated Work”. These posts are very negative, and for that I apologize, but they are also true (in the sense that they accurately represent my feelings). If I am wrong about any points, it would be more productive to point this out to me than not to point it out. This is because the apparent veracity of these gripes makes me, generally speaking, unhappy — if one or more is false, I will almost certainly be happier and, presumably, having set a fool on the right path, you will, too.
I only occasionally need to come into contact with PHP, and now is one of those occasions. I can’t help but think, with every syntactical weirdness that I need to circumvent, that PHP is the Geo Metro of programming languages. Its unfathomable popularity is one of the great life questions that I hope one day to answer for humankind so that, in the future, such a colossal mistake will not be made again.
- Some functions (print, echo, …) aren’t actually functions but “language constructs” and don’t need parentheses. The rest require them. Oy.
- I can’t treat lists as arrays. Specifically, I can’t do this:
$id = (mysql_fetch_row($qry))[0]. - Everybody says so, but function names and parameters are esoteric and inconsistent. In some ways, there are just too many (without namespaces!).
- Take, for example, the inconsistency in parameter order between regular expression functions and
strpos-related functions. - An example of another symptom of function bloat is PHP 5’s
strriposfunction. That would bestrpos(already vague enough) with two mutations, each signified by a single letter shoved right in the middle of the function name: find-from-right and case-insensitive.
- Take, for example, the inconsistency in parameter order between regular expression functions and
- Entirely aside from the aforementioned lack of namespaces, PHP scoping is absurd. The
globalkeyword is a joke, and it’s not a funny one (no inline assignment, globals aren’t really very global and need to be imported…). Scope has two modes: “global” and function-local (no other blocks). - Arrays are actually hashes! This is infuriating!
- Regular expression replacement functions do not return a useful success value. (I suppose that this might be okay for people who are not used to Perl, but it really seems inefficient.)
I must acknowledge that everything seems to work. As with most high-level, dynamically typed languages, PHP is (for the most part) very forgiving, once you can figure out what you’re doing in any given situation.
This is the first in a mini-series of two posts that I’m calling “Posts in Which I Gripe About Widely Appreciated Work”. These posts are very negative, and for that I apologize, but they are also true (in the sense that they accurately represent my feelings). If I am wrong about any points, it would be more productive to point this out to me than not to point it out. This is because the apparent veracity of these gripes makes me, generally speaking, unhappy — if one or more is false, I will almost certainly be happier and, presumably, having set a fool on the right path, you will, too.
There is perhaps no belief held more universally and more certainly among advanced Mac OS X users than that in the rapid resource access software that they use (a belief that will be widely shaken next week with the advent of Spotlight). I use LaunchBar. However very neat some of its myriad of features are, QuickSilver annoys me in little ways. They follow.
- Web searches are closer at hand (typing a space makes more sense to me and involves moving my hands less than typing tab twice to get to the search field).
- The kinds of items that can be accessed in QuickSilver with the right arrow and the tab key seem inconsistent. For example, one right-arrows iTunes to get to “show playing track” but tabs it to “open” (actions, as opposed to items, can be in both places).
- QuickSilver attempts to categorize too much. LaunchBar is a beautiful mess. For example, all of my iTunes tracks, albums, artists and composers are munged right into LaunchBar’s main configuration. When I used QuickSilver, I had to set up different esoteric key combinations just to avoid having to find the “iTunes Music” item, right-arrow into it, down-arrow to the “Browse Artists” item, move into that, then double-tab to “Search Contents” (and all this with the downloadable, non-default iTunes module). I never really managed to remember which key combination was albums, which was artists, and which contained tracks.
Matthew Russell over at O’Reilly’s MacDevCenter.com published Friday an article called “Protect Your Source Code: Obfuscation 101”. I’m sure that Mr. Russell had wholesome intentions — be they screamingly capitalist intentions — but I must take issue with his message. No, I’m not going to complain about security through obscurity (which is an often abused concept anyway), nor speed, nor his forgivable oversimplification of the compilation process.
I instead ask you to refrain, except in extreme circumstances, from obfuscating your code. No matter how perfect you think you make your project, you won’t have time or resources to respond to every demand from your users. There will be features to add and bugs to fix that you can’t (or won’t) implement yourself. I realize that it’s sometimes implausible to go open source, but leaving comprehensible symbols in your code can open a world of possibilities.
iChat is my AIM client of choice, and I, certainly, could never duplicate the work that has been put into it. It lacks, however, an “away message” functionality that other clients have come to expect: status messages cannot be sent automatically when messages are received. So, I wrote iCAR, the iChat Auto-Reply to make iChat a more complete client. Had it been obfuscated as Mr. Russell suggests, I’d never be able to guess which symbols in iChat needed patching to implement auto-reply functionality. Digging through symbols is bewildering enough already (for some reason, a great number of class names in iChat are prefixed, inexplicably, with “Fez”); code obfuscation would make the exercise impossible. Beyond iCAR, straightforward compilation has made innumerable clever hacks possible and life as a modern computer user just a little more bearable.
So, please, just do me a favor: leave your code comprehensible. On behalf of your end users, I remove my hat.
The following is a news update of the dire significance and utter import that you’ve come to expect from Capra hircus.
If you’ve got Gmail and a big heart, you may already know about the isnoop.net gmail invite spooler. If you don’t, it’s a service that has become just a touch superficial these days, but was once ingenious and necessary. It works thus: when one receives Gmail invites from the benevolent gods above, one sends them to gmail@isnoop.net. The invites are automatically cached for the next poor sap fleeing to Gmail from the clutches of doom.
Sending all 50 invites upon their receipt used to be a quite a chore (command-V, click, wait, repeat). If you’ve got Safari (and perhaps other browsers; I haven’t tested others), however, the pain is over. Enter gmail@isnoop.net into the appropriate text field and hit the return button rapid-fire. Hit it a whole bunch of times. Yes, I’m quite serious about this. Gmail will send a number of invites equal, quite intuitively, to the number of times you pressed return. Yes!
I think we’ve just surpassed sliced bread.
Apple today released Security Update 2005-003 for Mac OS X 10.3.8. Among the usual set of patches to obscure vulnerabilities, the update includes a patch to Safari:
Support for Unicode characters within domain names (International Domain Name support) can allow maliciously registered domain names to visually appear as legitimate sites. Safari has been modified so that it consults a user-customizable list of scripts that are allowed to be displayed natively. Characters based on scripts that are not in the allowed list are displayed in their Punycode equivalent. The default list of allowed scripts does not include Roman look-alike scripts.
So, Safari is safe from the IDN exploit originally publicized by the Shmoo Group, just under a month after Firefox fixed the same problem by disabling Internationalized Domain Name support entirely.
Firefox’s solution, while most prompt, is problematic. Legitimate international domains like tūdaliņ.lv display as Punycode nonsense like (in this case) xn--tdali-d8a8w.lv. Safari, on the other hand, can display Latvian characters like ū and ņ (and, for that matter, most Unicode characters) in URLs as they ought to be in the appropriate places in its UI. It does, however, disable the display of URLs containing the homograph glyphs used to disguise one domain as another. The famed pаypal.com domain displays as xn--pypal-4ve.com.
Before I bestow any precious metal upon Apple, however, I should mention that I can’t for the life of me find the “user-customizable list” of blocked homographs. Mayhaps it’s a hidden preference.
Regardless, congratulations to the Safari people for fixing a really scary problem without abandoning progress and standardization. Let’s see if Mozilla follows suit.
A week or so ago, my 10GB 3G iPod overflowed. I’d been carefully avoiding the issue, but iTunes forced my hands with a forcefully worded error message. I could, technically speaking, buy a new 40GB iPod, but my pessimistic side says that my music collection would just overflow that soon enough. Thus, I needed to find a less convenient but much more affordable solution.
My iPod now only auto-synchronizes individual playlists rather than all of my library. One accomplishes this by clicking on the iPod options button in iTunes once the iPod is selected in the Source column and choosing “Automatically update selected playlists only”. Most of my playlists are really cool mixes that I’d hate to be without, so I left them all checked. I then added four new playlists to fill up the remaining space:
- iPod-Permanent: Music I cannot live without. Music that I get regular cravings for or just simply adore with every fiber of my heart.
- iPod-Recent: A Smart Playlist that selects 2GB of music selected by most recently added — effectively giving me a good chunk of my more recently ripped music, which I am, of course, more likely to be obsessed with at any given time.
- iPod-Random: A Smart Playlist that selects 2GB of music that has a play count of two or more and a rating of two or more stars. (This is my least favorite rule, because it’s the only one that doesn’t tend to select full albums.)
- iPod-Temporary: A bunch of music that I think is pretty cool and actually listen to. This basically takes up all the space that I’m not yet using. This is not my bread-and-water music, but I’ll listen to it at some point. This is kept separate from the Permanent playlist in case it no longer fits at some point and can be sacrificed in one fell swoop.
Thus, while I will never again have all of my music in my pocket, I’ll have a pretty good selection — I’ve found that most albums I’ve had a random and unavoidable need to hear have been on my iPod.
To echo the call of Bryan Bell, I urge you (yes, you) to wake up to the oppression you probably live under, exacted out of malice and greed by the puppeteers of modern society.
An unexamined life is not worth living, and revolution begins with awareness. Internet Explorer is a problem, a scourge upon the face of the Internet. This is a request — nay, a demand, an order — that you demonstrate your individuality and show that you have the power to make this world a better place to live in. The only way that we can progress beyond our precariously balanced, disgustingly lemmingish, underpowered, and inconsistent Web is for each individual user to realize that they have been manipulated, that their ignorance has been exploited in order to fulfill a corporate agenda.
After upgrading to Panther (I performed a clean install but preserved users), I found that I could no longer connect using SMB from that operating system we won’t mention. However, I quickly noticed that a user I created under Panther (to test the ultra-dizzifying Fast User Switching effect) could connect as easily as ever.
After a bit of information-pilfering, I finally beat the server into submission.
- I changed my password using the Unix
passwdutility. I don’t know if this would have worked if I used Panther’s Accounts preference pane. - Using
smbpasswd, I changed my SMB password to the same one (although it probably doesn’t need to be the same at this point). I usedsudoto execute this with root permissions because the utility didn’t seem to accept anything for the old password (and root doesn’t need to give one). - I used
passwdto change my user password back. - I used
sudo smbpasswdagain to change my password to the same, original password.
Mac OS X seems very particular about keeping the SMB password and the user password the same. Tests always seemed to fail when there was a discrepancy.
Some notes regarding the lightness in this world. I’ll update these as I become further enlightened.
- Perl 5.8.1! Hurrah!
- Exposé is cooler than I could possibly have imagined.
- The new PDF stuff is just plain crazy. I sort of stumbled and did minor damage to my ankle when the first OS X used PDF as its native rendering format but this… when did this kind of thing become a basic feature of an operating system?
- Not to hurry you, Mike, but me wants PithHelmet for Panther.
-
TextEdit: Not so remarkable, until you realize you can change the fuzziness of the shadow! Holy McJebus, keep me safe!
- Even Stickies has immeasurable improvements. I think I’m going crazy.



