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.
Can this please be an enormous joke? The following begins an article from the Sports section of the New York Times today:
There has been the N.C.A.A. tournament’s brand-name face to love: Vermont Coach Tom Brennan looked as if he had swallowed organic moonbeams when his crunchy Catamounts left his state’s citizens leapin’ in their Birkenstocks after mercifully shortening Jim Boeheim’s annual attempt at turning Syracuse U. into Persecute U.
Discussion questions:
- What does the author imply with the convoluted syntax in “there has been the… face to love”?
- Is “face to love” a common expression? If so, what does it mean? If not, what does it mean?
- How is an organic moonbeam different from your typical moonbeam?
- How does one look when one swallows such a moonbeam?
- Can Catamounts be crunchy?
- Do most Vermont citizens wear Birkenstocks? If not, did those who were not in Birkenstocks still leap?
- What particular emotion is expressed by the image of leapin’ in one’s Birkenstocks?
- What would be implied by the transformation of Syracuse U. into “Persecute U.”?
- Isn’t “March Madness” just a cute name for a basketball tournament and not a psychological disorder?
Like approximately 269 other things, this paragraph seemed to ask more questions than it answered.
(Reading on explains a bit, but the passage is much more fun out of context.)
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.
Following are two items from yesterday’s reading (and the Rock review process itself).
Mary Oliver has a message. I have only just discovered her, and I have a kind of certainty that the rest of the human world will enjoy her also. This may be essentially misanthropic, but I have managed to convince myself that you will enjoy reading the following poems, which happen to be strikingly similar:
Poppies by Mary OliverThe poppies send up their orange flares; swaying in the wind, their congregations are a levitation of bright dust, of thin and lacy leaves. There isn't a place in this world that doesn't sooner or later drown in the indigos of darkness, but now, for a while, the roughage shines like a miracle as it floats above everything with its yellow hair. Of course nothing stops the cold, black, curved blade from hooking forward— of course loss is the great lesson. But I also say this: that light is an invitation to happiness, and that happiness, when it's done right, is a kind of holiness, palpable and redemptive. Inside the bright fields, touched by their rough and spongy gold, I am washed and washed in the river of earthly delight— and what are you going to do— what can you do about it— deep, blue night? |
In Blackwater Woods by Mary OliverLook, the trees are turning their own bodies into pillars of light, are giving off the rich fragrance of cinnamon and fulfillment, the long tapers of cattails are bursting and floating away over the blue shoulders of the ponds, and every pond, no matter what its name is, is nameless now. Every year everything I have ever learned in my lifetime leads back to this: the fires and the black river of loss whose other side is salvation, whose meaning none of us will ever know. To live in this world you must be able to do three things: to love what is mortal; to hold it against your bones knowing your own life depends on it; and, when the time comes to let it go, to let it go. |
How can the poems be happy but not sappy? How can she be expository but not tacky? Oliver is a mysterious force. Her themes are more diverse than this pairing would suggest, but her style is just as exquisite.
I did read Reading Lolita in Tehran in Oaxaca, Oax., but that is, unfortunately, irrelevant.
What follows is a pseudo-review of Azar Nafisi’s pseudo-novel — it will most likely end up better described as an incoherent, scatterbrained rant that halfheartedly masquerades as a review than as true review. Please keep in mind that, while it may take on some attributes usually associated with book reviews, it is certainly nothing more than a haphazard amalgamation of hasty and generally irrelevant scribbles in a small, spiral-bound notebook (right). This is fitting, because, while Reading Lolita in Tehran reads and feels at times like a novel, it is certainly a work of non-fiction.
My current favorite anomaly in the English language is the disparity of the words prisoner and jailer. A jailer is not someone who is kept in a jail; nor is a prisoner someone who runs a prison.



