The origin of the blink tag

June 7, 2010
3 comments
 
⇥ Permalink

From Lou Montulli:

Saturday morning rolled around and I headed into the office only to find what else but, blinking text. It was on the screen blinking in all its glory, and in the browser. How could this be, you might ask? It turns out that one of the engineers liked my idea so much that he left the bar sometime past midnight, returned to the office and implemented the blink tag overnight. He was still there in the morning and quite proud of it.

I can think of at least a dozen examples of features that creep into a product on a whim, only to become monkeys on a project’s collective back that take years to shake off. One such example is the register_globals setting in PHP which finally managed to get deprecated in PHP 5.3 (and, the way things are going, may never disappear altogether) after much fighting and gnawing of teeth.

But the really interesting thing here is that <blink> is perhaps the most egregious example of what’s wrong with HTML. The existence of register_globals is problematic in many ways, but it is consistent: as long as you have a version of PHP that supports it installed, you will have the opportunity to use it1. When it is discarded, it ceases to exist, so that rewriting your code becomes a prerequisite to upgrading to a new version of PHP.

In HTML, when a single vendor adds a non-standard feature, it immediately creates a significant problem for every developer: if you don’t take advantage of it, your application is not as good as it could be2. If you do, you now have to maintain separate versions of your code for each browser.

Of course, standards are what is supposed to prevent situations like these from arising in the first place—except that no vendor seems to be capable of following them properly.

  1. Meaning, of course, any standard version of PHP that supports register_globals according to the spec in the manual. Your admin can turn off register_globals, but the functionality is still there.
  2. Leaving aside the fact that <blink> is useless and should never have been implemented in the first place, of course—I am just making an example

⇥ Running PHP from Flex natively with AIR2

If you follow the Flex world, you know that the ability to execute external applications has probably been one of the most-often requested features since the Apollo days. After all, once you gain the ability to run your Flex application in a desktop environment, it’s only natural to want to stretch out a little and extend your reach into the other goodies that are available to you.

As AIR2—currently in the release candidate stage—becomes finally a reality, this functionality is finally available to developers in two different forms: either invoking the default application associated with a given file type or, much more interestingly, instantiating an external process and communicating with it.

Getting Started

I am assuming here that you use Flash Builder 4—if you’re still an FB3 user, the process is similar, but subtly different, particularly when it comes to the source code; therefore, your mileage may (and probably will) vary.

The first step towards world domination consists of downloading the AIR2 SDK (from the link above) and overlaying it on top of your existing FB installation. The instructions for doing this are a little convoluted, but nothing that any developer should be able to handle. My only recommendation, if you are on a Mac, is to copy the SDK files over from the terminal rather than using Finder—the latter just doesn’t seem to work for me.

Onward and upwards! Next, you can simply create an AIR application the “normal” way. Make sure to select the 2.0 SDK that you have just installed (you can also do so from the project’s settings window if you forget).

Next, you need to make a few changes to your project; open up your application descriptor and change the default namespace:

<application xmlns="http://ns.adobe.com/air/application/2.0">

This will make sure that adl picks up the correct SDK when it compiles the application. The actual native-process instantiation mechanism is also platform-dependent, which means that the only way to take advantage of it is to make your application native as well. This is done by adding an element to the descriptor:

<supportedProfiles>extendedDesktop</supportedProfiles>

It bears mentioning that when you package your application for export, you will no longer be able to distribute it as an AIR package—rather, you will now have to compile it as a native installer (DMG for Macs, EXE for Windows and DEB or RPM for Linux). This process cannot be performed directly from FB4, but must be taken care of from the command line—and you will have to do it on the platform for which you want to distribute (e.g.: you need to package on a Mac to create a DMG, and separately on Windows to create an EXE file).

Invoking external applications

With the preliminaries out of the way, let’s look at how the invocation of external processes actually works. The functionality is provided by a class aptly called NativeProcess, which encapsulates an external process of some kind. You can determine if native processes are supported by checking the isSupported static property of the class:

if (NativeProcess.isSupported) {
  // Invoke external application here
}

In order to invoke a native process, you need to first specify a process descriptor in the form of an instance of NativeProcessInfo, which is simply a collection of three elements: the external application’s path, the command-line parameters you want to pass to it, and the initial working directory in which it will run. For example, suppose you want to run a copy of PHP that can be found in /usr/bin/php:

var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();

info.executable = new File("/usr/bin/php");
info.workingDirectory = new File("/");

As you can see, I am not passing any parameters here—that’s because I want to be able to pass the actual PHP code that must be executed at runtime. In my particular case, this is necessary because I am building a simple interface to the PHP system we use internally at php|architect to render our articles into a format that can be passed to the software our production team uses for layout; however, it also makes a good use-case story for the fact that NativeProcess supports communication to external processes using the standard input, output and error pipes.

Communicating with a native process

An instance of NativeProcess exposes three properties, called standardInput, standardOutput and standardError that encapsulate the three standard streams of the running external process in the form of data streams. However, because Flex is an event-driven environment, you cannot simply read from them at will—instead, you must wait for data to be available or incur the wrath of the system in the form of an exception.

Rather than sticking around and continuing to check whether data is available from any of the streams, we can simply subscribe to one of two appropriate events: ProgressEvent.STANDARD_OUTPUT_DATA and ProgressEvent.STANDARD_ERROR_DATA. Naturally, there is no corresponding event for standardInput, given that STDIN is a write-only stream. However, we still need to wait for any data that we write to it to be successfully sent over to the external process before we can close it:

nativeProcess = new NativeProcess();

nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, receivedData);
nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, receivedError);
nativeProcess.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, dataSent);

We can now start the external process by using the start() method. The entire invocation process looks like this:

protected function invokePHP(phpScript:String):void {
  if (NativeProcess.isSupported) {
    var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();

    info.executable = new File("/usr/bin/php");
    info.workingDirectory = new File("/");

    nativeProcess = new NativeProcess();

    nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, receivedData);
    nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, receivedError);
    nativeProcess.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, dataSent);

    nativeProcess.start(info);
    nativeProcess.standardInput.writeUTFBytes(phpScript);
  }
}

Note that I also take the opportunity here to pass the script that I want to execute directly to the app through STDIN; in order to trigger its execution, I also have to close the input stream to signal PHP that no more data will be more forthcoming—but that needs to be done once the NativeProcess instance signals that it has pushed all the data through the stream:

protected function dataSent(e:Event):void {
  nativeProcess.closeInput();
}

All that remains now is to listen for events and find out when we get data back:

protected function receivedData(e:Event):void {
  trace("App result: " + nativeProcess.standardOutput.readUTFBytes(nativeProcess.standardOutput.bytesAvailable));
}

protected function receivedError(e:Event):void {
  trace("App error: " + nativeProcess.standardError.readUTFBytes(nativeProcess.standardError.bytesAvailable));
}

Tying it all together

Did you know that AIR comes with a fully-functional HTML rendering engine based on Webkit? While you can’t take advantage of it in a regular Flex application (which, after is already supposed to be running in a browser), it’s a perfect companion to the ability to run PHP in an AIR2-based application.

Here’s a super-simple example to entertain you:

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx">
  <fx:Script>
    <![CDATA[

      import flash.desktop.NativeProcess;

      protected var nativeProcess:NativeProcess;

      protected function invokePHP(phpScript:String):void {
        if (NativeProcess.isSupported) {
          var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();

          info.executable = new File("/usr/bin/php");
          info.workingDirectory = new File("/");

          nativeProcess = new NativeProcess();

          nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, receivedData);
          nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, receivedError);
          nativeProcess.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, dataSent);

          output.htmlText = "";

          nativeProcess.start(info);
          nativeProcess.standardInput.writeUTFBytes(phpScript);
        }
      }

      protected function receivedData(e:Event):void {
        output.htmlText += nativeProcess.standardOutput.readUTFBytes(nativeProcess.standardOutput.bytesAvailable);
      }

      protected function receivedError(e:Event):void {
        output.htmlText += nativeProcess.standardError.readUTFBytes(nativeProcess.standardError.bytesAvailable);
      }

      protected function dataSent(e:Event):void {
        nativeProcess.closeInput();
      }

    ]]>
  </fx:Script>
  <fx:Declarations>
  </fx:Declarations>
  <s:VGroup left="0" top="0" bottom="0" right="0">
    <s:TextArea id="source" width="100%" height="50%" />
    <s:HGroup width="100%" horizontalAlign="center">
      <s:Button label="Execute" click="invokePHP(source.text)" />
    </s:HGroup>
    <mx:HTML id="output" width="100%" height="50%"/>
  </s:VGroup>
</s:WindowedApplication>

And the result:

Why would you want to, anyway?

The question that’s probably going through your mind right now is—why on Earth would anyone want to run PHP from an AIR application?

First of all, this is just an example. While this code happens to run PHP, you could be doing one of a million different things—run your own executables, invoke a system utility, or whatever else comes to your mind. When you consider the fact that you can embed any arbitrary executables as resources in your AIR packages, the possibilities are virtually unlimited.

Of course, you do have to consider the price tag of taking advantage of this functionality: you will have to compile your applications as native installers, which, as I mentioned earlier, means that you also have to create individual packages for each platform you intend to target on that platform. When dealing with executables that are available on a number of different platforms, like PHP, this may feel a little absurd, but that, as they say, is the way it is.

But back to PHP. The example in this post is obviously contrived—nobody in their right mind would want to create something this simple (although this could be the beginning of an interactive PHP editor). The problem that sparked the post, however, was very real: the need to execute an application that I had already written in another language from a desktop environment. If you already use PHP for some of your work, native processes create one more opportunity for you to use a common code base throughout all your products.

⇥ HipHop: What you need to know

February 2, 2010
19 comments
 
⇥ Permalink

By now, unless you’re living under several hundred metres of rock,  you’ve probably heard that Facebook has released HipHop for PHP, a tool that compiles PHP into C++ with some interesting claims of speed improvement. The thickness of unawareness-inducing rock may have to be lower to know that php|a and BP have announced our full support for the project with a number of initiatives that we’re going to roll out over the next few months.

I have known about this project for a little while—Facebook was kind enough to invite me, along with a few other community members, to their office for a demo a few weeks ago. They gave me a copy of HipHop to try out, and I have been playing with it for the last few days.

What it is

First, a few random notes on how HipHop works. Haiping has done a great job of providing in-depth coverage in his post on the FB blog, so here are the CliffNotes:

  • HipHop transforms PHP into C++ code, which can then be compiled into a self-contained executable. The tool supports a large percentage of the current PHP 5.2 spec, with some obvious exceptions, like eval().
  • The tool attempts to find the maximum level of optimization possible for a given scenario using its own static analysis tool. For example, if it detects that all operations on a given variable are homogenous in type (e.g.: they are all integers), then it uses the corresponding C++ data type to provide maximum speed and memory enhancement. Where this is not possible, it implements its own variant type, equivalent to a zval.
  • HipHop doesn’t currently have its own PHP runtime—nor is it based on Zend Engine. It compiles everything to C++ and uses its own set of C++ library to provide the necessary support.
  • Once compiled, HipHop provides its own web server (a CLI interface is also available). It does not use (or require) Apache or any other server. Of course, this doesn’t preclude you from running one or more HipHop projects against separate ports on the same machine and then use Apache (or Squid, or any other server) to reverse proxy to them.
  • HipHop doesn’t currently support Windows (though, personally, I’d be surprised if that didn’t eventually change—it just so happens that FB built for the environment they use internally).
  • The entire tool is intended to be a drop-in replacement for the PHP runtime—as long as you do not use any functionality that it doesn’t support, you should be able to compile your existing site and run it.
  • Facebook is using HipHop in production to handle 90% of their traffic.

What it’s going to do

HipHop has the potential to be an incredibly disruptive product in the PHP landscape. If your company runs a PHP application that requires more than two servers (you’ll want two just for redundancy), you have no reason not to explore using HipHop. If Facebook’s claim of a 50% reduction in CPU usage means you could, potentially, get rid of 1/2 of your PHP machines with a minimum of investment. You don’t need to be Facebook to draw a huge advantage from this technology. Perhaps this one-to-one reduction is not apt, but even 40% or 30%—much more realistic—is major, and a truckload and a half more than any other existing PHP-related product can offer at this point.

Clearly, this argument can be flipped around: you have every incentive to make sure that your application runs with HipHop—which could give Facebook a unique opportunity to exert significant control over the way PHP evolves.

You might, at this point, think that this is not the first attempt at a PHP compiler—in fact, there are other compilers commercially available. Heck, even I wrote my own experimental compiler several years ago (in fact, I had a discussion about my experience with some of the Facebook team members about this a while back, presumably while they were researching HipHop)—and that ultimately it won’t make a difference.

But HipHop is neither experimental nor unproven, and it’s free; it is used, in production, by the second-largest site on the Internet—and make no mistake about it, there is no smoke-in-your-eyes (not to mention other body parts) sleight of hand on Facebook’s behalf; their site is written in PHP by PHP developers, without the help of large numbers of custom extensions. In fact, their goal is precisely to allow their developers to continue using PHP—which they consider the nimblest web development environment—without compromising their ability to grow at the current pace in a financially responsible way.

If you think about it, that makes a lot of sense from a business perspective: PHP is simple, flexible and easy; with HipHop as a drop-in compiler, FB can achieve an immense immediate benefit with essentially no disruption to their operations. The question now becomes: shouldn’t everybody else?

Reblog this post [with Zemanta]

⇥ The story behind TEK·X’s Charter Ticket program

December 29, 2009
No comments
 
⇥ Permalink

Unless you’re living under a particularly large rock, you’ve probably heard that we are doing a special promotion, which we call Charter Ticket Program, that makes it possible to purchase a full-experience TEK·X ticket—valid for both the main conference and tutorial day—for $650. The catch (if you want to call it that) is that the special is only valid until we announce the schedule—so, effectively, you need to put a lot of trust in our ability to attract top speaking talent and stitch together the schedule of a conference that you will want to attend.

Given the incredible response that our call for papers has received—over 9 proposals for each speaking slot—I have no doubt that we will be able to create a schedule rich in variety and topics that are very relevant to PHP developers from all walks of life. If anything, we’ve had a really hard time finding room for all the talks that we wanted to be part of TEK·X and, although I believe that my colleague Keith Casey will have some hopefully welcome news on this subject to share in a few days, we’ve run out of room much sooner than we ran out of good talks to approve.

The reasoning behing the Charter Program is very simple: we recognize that there is a core of attendees for whom our conferences have become an opportunity to meet up with their peers and learn what’s happening in the PHP world. In fact, there are some who have been to all of MTA’s conferences, so we felt that they deserve a little some extra special.

The Charter Program is designed specifically for these folks: at $650, the current price of the tickets is almost half the price of a regular ticket at the door—and $350 less than the lowest early-bird price. It is the lowest price you will be able to secure a spot at TEK for—an opportunity for a great deal if you put a little faith in the folks who have brought so many memorable events to the PHP community.

To take advantage of the Charter Ticket Program and save as much as 45% over the price of a full-experience ticket, you must sign up for TEK·X before January 6th, 2010, when our schedule will be officially announced.

⇥ Consulting Services

December 14, 2009
No comments
 
⇥ Permalink

Marco is a co-founder and one of the managing partners of Blue Parabola, LLC., a consulting firm that focuses on high-end development and architecture, with a particular focus on PHP.

Blue Parabola offers consulting in several areas of functional software development, including:

  • Information architecture
  • Web architecture
  • Open-source business strategy
  • Web development
  • PCI/Security auditing
  • Scalability and redundance
  • RIA and mobile development

⇥ Speaking Engagements

Fifteen years in the IT industry and ten years as an entrepreneur have given me a unique perspective on the world of software development: I can speak to developers about the business of programming, and to businesspeople about the technicalities of writing software.

My speaking style is informal, but to the point—usually accompanied by a carefully-crafted presentation that eschews wordy bullet points in favour of visual constructs to engage and interest the audience. I have spoken on both sides of the Atlantic, keynoting such events as the 2008 Dutch PHP Conference in Amsterdam and the 2009 LAMP Camp in Nashville, TN.

Speaking Invitations

If you would like me to speak at your event, feel free to contact me for information on details.

⇥ Microsoft is and Microsoft does

December 9, 2009
4 comments
 
⇥ Permalink
Elephpant does Redmond!

Elephpant does Redmond!

Every year, Microsoft organizes a small event, called Web Development Summit, to which they invite a few members of the PHP community. The WDS is a good opportunity to exchange information with Microsoft, learn about new products they are working on and generally catch up with a number of friends from the community. Several others have already posted their impressions of this year’s meeting, to which I add my own.

Good stuff

Microsoft’s attitude towards open-source has changed considerably over the last few years—a fact that is finally starting to permeate through its historical insistence on vertical integration in favour of more willingness to integrate its products with other platforms. At the end of the day, Microsoft has realized that the key to improving adoption of Windows Server—and, more importantly, stemming the migration away from it—is to play nice with other technologies.

More importantly (at least from my perspective), more people within Microsoft are finally realizing that working within the open-source world requires a shift in the way they establish relationships and position themselves. There are some within the company that have realized this a long time ago and have, as a result, established some strong ties with the PHP community; it’s good to see that this frame of mind is finally permeating through the organization and changing the way it approaches its dealings with us.

The willingness to look beyond its own walls is also making it possible for Microsoft to come up with some truly innovative and useful products. One of the most impressive ones that I saw during the WDS is Expression Web‘s SuperPreview¹, which truly simplifies the process of side-by-side comparison between browsers, including multiple versions of Internet Explorer. I was teaching a seminar of HTML and CSS at a client just yesterday and had an opportunity to show this product to them. It was received with a chorus of wows, followed by significant gnashing of teeth when they realized that their organization’s default Windows install wouldn’t support it.

I also truly appreciated the fact that the evangelists who were at WDS took the time to really drive home the fact that “Microsoft” is not one entity, but, rather, a conglomerate of many different divisions and people—and, therefore, of many different opinions and strategic views that are bound, at times, to be in conflict with one another. To anyone who has had the opportunity to work for (or with) a large organization, this is an obvious fact—but many who are used to smaller work environments don’t fully understand the complexities of interacting with such a large base of coworkers, each with their own priorities and strategies (I always chuckle when I hear someone start a sentence with “You Microsoft guys need to…”).

Finally, I had the pleasure of leading a ten-minute discussion on the status of the PHP community, which, judging from the reactions that it received, was a cathartic experience for some people. I took advantage of the unusual convergence of members from various PHP-related groups, including Drupal, Joomla and WordPress, to point out that it might be opportune for all of these communities to intermingle and work together with the “core” PHP community towards common goals to ensure a good exchange of ideas. After all, what comes down the pipe from core will eventually be of benefit (or not) to anyone whose application lives downstream, so a feedback channel in the form of conversations and participation is going to be essential to the health of the entire PHP ecosystem².

Not so good stuff

The whole point of the WDS was to give Microsoft an opportunity to present their current ideas to a small focus group so that they would have an opportunity to revise and focus their message before presenting it to the world at large; therefore, it would be inappropriate for me to comment specifically on the areas for improvement that we saw.

Suffice it to say that some divisions inside Microsoft are still finding it difficult to let go of the no longer appropriate view of open-source communities are a ragtag group of renegades intent on not-so-subtly subverting the commercial software landscape. By my own guesstimate-based account, the 40 or so people at WDS directly or indirectly represented at least a good $100M of annual sales (the number actually jumped by several hundred millions halfway through, but I’m not counting that), all made possible by the use of open-source software. These people are not trying to make a philosophical point—they are simply trying to achieve specific goals with the best tools at their disposal. Microsoft employees simply need to learn to see us as partners, and not as gifted amateurs with a source-code fetish.

By the same token, if we decide to engage with companies like Microsoft, it’s important to make an effort to understand the unique challenges that they must face, internally and externally, in order to work with us. Obviously, we can’t solve their problems—but if we don’t even bother finding out what they are, we are not being good community citizens, either.

Disclosure: Microsoft is a customer of both MTA and Blue Parabola, and they paid most of my expenses to attend the WDS.


¹ Of course, SuperPreview (which, to me, is the killer feature in Expression Web) is not even listed in the top-three features on the product page. Disconnect, anyone?

² On a personal note, I was happy to see that my ability to drive an entire room full of people up the wall in ten minutes or less has not waned with the years. My intention was to stir emotions—and that’s exactly what I accomplished.

⇥ How to encourage piracy

December 7, 2009
9 comments
 
⇥ Permalink
The copyright industry is somewhere around these parts.
The copyright industry is somewhere around these parts.

As I write this post, I am comfortably slouched on an easy chair in a Seattle area hotel, a guest at Microsoft’s Web Development Summit (about which I shall write more in a future post). Like most visits to the States, this means a stop at Fry’s—a geek’s equivalent of Willy Wonka’s chocolate factory, with wall-to-wall electronic candy, from computers to consoles, from DVDs to floppies (yes, they have some of those, too).

Slave to my own customs, therefore, I joined my friends Eli and Rafael for a trip down to the Electronic Mecca with the idea of finally purchasing an electronic book reader—I’ve wanted one for a while, and now that php|a has an all-new format, we want to focus on supporting these devices, which we think are the way to go looking forward into the future. Translation: I finally had an excuse to get the eReader past my wife (who will probably read this post and promptly strangle me).

I ended up purchasing a Sony eReader Touch Edition. As the name implies, this device combines an ePaper screen and a touch-based interface; I don’t intend to review the device here, other than to say that the screen doesn’t quite have the contrast ratio of decent paper stock (in fact, it’s probably inferior to pulp paper), and the whole user interface seems to always stop one step short of a good UX (plus, the device has no wireless connectivity, which at this point in time is simply inexcusable). Nevertheless, the device does provide a really good reading experience, particularly when you consider that it can go for two weeks between charges and the average fiction book occupies less than half a megabyte.

What I’d like to speak about is the wonderful, wonderful feelings that purchasing content for this device has left me.

The store that almost was… not

I don’t think that you’ll be surprised to hear that the first thing I wanted to do, upon unpacking my new toy, was to get some content for it.

The folks at Sony sure must be falling off their chairs, however, because I simply couldn’t get anything. I had fallen in that DRM Neverland that is purchasing a book from the Canadian store—with a Canadian credit card tied to a Canadian address—while within the United States. In fact, the store told me so—after I had dug my credit card out of my pocket and typed in all my information: “You cannot change your method of payment in a country other than your country of residence.”

There’s a finality, a sort-of “what kind of stupid shenanigans are you trying to pull” attitude to this statement that just drives me up the wall. Why shouldn’t I be able to buy a book from the online store dedicated to my country (which, in itself, is a curious idea to be found on a worldwide network), with a credit card that was issued in the same country and is registered to an address which is, itself, in the same country?

Of course, I understand why this is: rights management. Despite the fact that the US dollar is essentially at par with its Canadian counterpart, we regularly pay much higher prices for books (among other things) than our friends south of the border. Distribution of content in our country is regulated by a government that is intent on ensuring that our cultural heritage is not overrun by Americans—in itself a rather curious attitude, considering that so many Canadians are first-generation immigrants and therefore don’t have a shared heritage to start with. Furthermore, book rights (much like movie rights) are routinely handled by different entities across borders and, obviously, each wants to make sure that it can maximize its ability to take advantage of its captive market.

Of course, I hope that you won’t mind me saying that this line of reasoning has been pulled straight out of the digestive system of a cow by the copyright industry. They are the ones who insist on placing impossible constraints on the management of content rights—and they are the ones who constantly find themselves at odd with simple, plain reality. In other words, they have created a problem—their problem, not my problem—and the only solutions they come up with end up victimizing the law-abiding user—me.

The “to copy is to steal” mantra that the idiots from the copyright lobby continue chanting is so misleading you could put a tail on it and call it a weasel. Here I was, credit card in hand, ready to make a purchase—nay, credit card details already entered on site and purchase already made, as far as I was concerned—and they won’t take my money… why? Because my IP appears to be assigned to another country? It’s the equivalent of walking into a grocery store and being denied the purchase of milk because I look like I might be from out of town. Their legal choice removed, guess what honest people do—and they don’t even feel remotely guilty about it.

I’ll say this: when we removed password protection (which is not a form of DRM, as I have tried to explain multiple times) from our publications, our sales actually went up. I am glad we did. I am glad our customers pushed us to do it and didn’t let us off the hook until we would.

Cost vs. “cost”

As I have said in the past, DRM is an endless battle against an imaginary foe. The content industry is chasing after windmills—and the worst part is that they actually believe they have an enemy.

Not too long ago, I had a brief argument on Twitter with Charles Arthur, the Technology Editor at Britain’s Guardian newspaper. I enjoy reading Mr. Arthur’s work, which, of course, made me all the madder when I saw him reporting this statement:

The Entertainment and Leisure Software Publishers’ Association, ELSPA, which represents the video games industry, says that criminal games copying and other illegal activities cost the industry more than £750m annually.

I challenged this and was frankly disappointed that Mr. Arthur’s answer was that he wasn’t making the claim—rather, the ELSPA was. Technically, that’s clearly correct, but that’s a statement that just begs for some questioning that I would think a journalist should want to undertake.

If you ever happen to be overly bored and decide to look at the financial statements of any public corporation that trades primarily in intellectual property, I challenge you to find a line item that says “costs due to piracy.” Go ahead, try—you won’t find any.

Don’t worry, though; through the magic of common sense, I can tell you exactly how much money piracy costs to the entire industry: zero.

You see, in accounting—which is what companies use to track and report their financial positions—cost is essentially equivalent to expense: the money a company spends to produce or acquire something. Piracy, therefore, is not a cost—because the company cannot spend money that it doesn’t have in the first place. Their claim that piracy costs them hundreds of millions of dollars a year is a bit like me claiming that not getting run over by a truck while crossing the street earlier today cost me hundreds of thousands of dollars in insurance claims.

That’s right—the copyright industry is very cleverly using a concept that is proper in economics—where “cost” is the value of an opportunity that has been discarded in favour of a different alternative—in a context where the subject is accounting. With this clumsy sleight of hand, they have created a financial liability that cannot be reported on their books (not without some serious consequences, at least), but that looks really good in print.

The simple reality is that the industry knows exactly how much piracy costs them: nothing. What they don’t seem to know, however, is what combating it is costing them: it has created a generation of content users that are completely disillusioned with the value of intellectual property because they are constantly presented with a set of facts that have been gracelessly distorted to present a picture that doesn’t stand up to the most basic scrutiny.

Good luck staying relevant.

Photo credit: Jack and Jill Windmills in Sussex by david.nikonvscanon

⇥ Selling software in an open-source world

November 23, 2009
5 comments
 
⇥ Permalink
How do you sell software when it's free?

How do you sell software when it's free?

Last week, Zend’s marketing department saw fit to send me an e-mail—the third in so many weeks—touting the fact that the upcoming Zend Server 5 will support job queueing¹ to offload requests either to another process on the same server or to another server altogether.

Undoubtedly, this is a great feature, not the least because it begs a little bit of simple business analysis of how difficult it is to create a market for products in an open-source world.

First of all, a simple look at the economics of this feature reveals that, in itself, it cannot be a determinant in the purchase of Zend Server². The reasoning is fairly simple: a copy of the lowest-level subscription for Zend Server costs $1,195. You can, however, get queuing support from a variety of other sources—most notably Amazon Web Services, which sells queuing requests for $0.01 per 10,000 requests. In other words, you’d have to need to make more than 1,195,000,000 queuing requests in a year to justify the purchase of Zend Server if all you ever wanted was queuing support.

Therefore, queuing needs to be part of a larger set of features that, taken together, make Zend Server a compelling and unique product. However, none of its features do this—there is practically nothing in ZS that cannot be obtained elsewhere for a lower cost (or for no cost). What’s more, Zend cannot lock any new feature it adds to its products because it can be easily replicated by just about anybody else.

Case in point, on the very same day when I received Zend’s e-mail, Jonathan Wage tweeted about a library he built on top of Doctrine to manage message queues using a variety of different storage media. So here we have, in the same period of twenty-four hours, a company that is trying to sell me a solution that a person claims to have developed and is making available completely free of charge.

Of course, this comparison represents “all kinds of unfair” towards Zend—their solution could be better implemented, more reliable, or scale better.

Or, perhaps, I could point out that they are not, in fact, selling the software at all.

Software is worthless—service is everything

In an open-source world, the capital value of any piece of software tends towards zero—not only because you others get the software for free, but because vendors cannot lock in any feature that makes it impossible for anyone else to recreate the same functionality and give it away at no cost. Microsoft has proprietary control over Windows and can, therefore, decide which features it allows third parties to replicate. Zend has no exclusive control over PHP and, therefore, enjoy no such privilege with its products. Nor is this a problem that is specific to Zend—any other company that works in an open-source space has to deal with this particular issue in one form or another.

The only real product that a company like Zend can sell, therefore, is the peace of mind of knowing that there is someone that your organization can turn to for assistance when things stop working. Not being a Zend customer myself, I can’t say how well they do this, but I do find it interesting that they continue to define themselves as a product company and that they don’t seem to place any emphasis on their services.

I understand that the need to sell products is primarily one of scale—it’s difficult to convince an investor that they should give you their money unless you can show exponential growth, and a service-oriented organization simply cannot achieve that. However, when your product is, essentially, an extended form of support, you need to build an organization that has service at its core—it’s only through services that a company will gain acceptance for its products and achieve the scale its investors demand.

This is nothing new, of course—organizations as large as the largest software vendors in the world have highly developed service organizations that, while not representing a significant revenue centres, act as a springboard for the sale of the company’s products. This is true both in the open- and close-source markets—think about the size of Microsoft’s Consulting Services division or the importance that a company like Red Hat attaches to the creation of a holistic ecosystem for its products, from certification to training and consulting.

Educate, Penetrate, Accelerate

The importance of services can be best illustrated through the mantra educate, penetrate, accelerate.

Education is an essential part of driving the adoption of your products. It involves the cooperation of marketing, which raises awareness about your products, and training and certification, which promotes competence among your clients. The former without the latter leads to discontent, because your customers won’t be able to use your products. The latter without the former leads to poor adoption, because nobody will know about your products in the first place!

Penetration of the market can only be achieved by a well-tuned and aggressive consulting-services strategy. This is particularly true in the PHP market, which is trending towards a higher and higher level of abstraction in programming tasks—when people invest millions of dollars a year in content management systems, the only way that you can make your products relevant is to make them relevant to those systems. To offset the cost of providing services, a company needs to foster a competitive, but also active and rewarding, environment for its consulting partners, demanding high quality while providing excellent opportunities for profit by reducing some of the costs associates with customer acquisition.

A good service division will lead to acceptance of your products, which is where you can accelerate your growth by selling multiple licenses to your paid products to each client.

¹ I realize that I’m just being petty here, but Zend’s marketing need a severe visit from the Cluebat Fairy—if the best reason you can come up with for trying to sell me a queue management system is that I can eliminate “long-running PHP scripts,” you have failed miserably. To a developer (or, at least, to this developer), queuing has three important benefits: parallelization, prioritization and consistency. In other words, I want to know that I can push messages in the queue so that they can be processed by multiple workers, they can be assigned a specific priority if needed, and that they are not going to end up in some sort of black hole. Offline serving of complex tasks is a consequence of these features, rather than the feature itself—but I digress.

² Of course, you can download Zend Server for free, but that only reinforces the difficulty in creating products for the PHP market.

Photo credits: Girotondo by Luca Sartoni

⇥ Win a 52″ HD system with php|a’s new contest

November 18, 2009
7 comments
 
⇥ Permalink
PHP on Windows: give it a try—it might be worth your while
PHP on Windows: give it a try—it might be worth your while

From the blatant self-promotion bin: in case you haven’t heard, php|a has a brand new contest running between now and the end of March.

The contest rules are fairly simple (despite all the legal gobbledygook): write the best PHP-on-Windows application (as judged by our panel of experts and the php|a readers) and you will be the winner of a killer grand prize made up of a 52″ LCD HDTV set, a 5.1 surround system and an XBOX Ultimate, plus your very own, all-expenses-paid ticket to TEK·X.

Currently, we have ten people who are hard at work on contest entries. To me, that seems like a paltry number, consider that we have over $10,000 in prizes available and you don’t even need to be running Windows, since we have partnered with Applied Innovations to provide the first sixty participants with their very own dedicated Windows VPS. You know you’re running out of excuses. Try it. Now. Go!

Why PHP on Windows?

As you can see on the php|a website, Microsoft is providing php|a with promotional consideration for the contest—needlessly to say, they have their reasons, which primarily are to make you try and write software in PHP and make it run on Windows. I, however, have a completely different set of motives for running the contest: to make you try and write software in PHP and make it run on Windows.

Where’s the difference? Microsoft wants you try their products because you will hopefully find them useful and adopt them in a setting in which their use will turn into sales. That’s a perfect valid motivation, particularly considering that they (a) are in the business of selling software and (b) they are providing you with a really strong incentive to give their products a try (and without any strings attached!). I, on the other hand, want as many PHP professionals as possible to be aware of what all their choices are.

Every time we discard a choice on the basis of anything other than it not being the right solution for our particular problem, we are doing ourselves and our clients a disservice. It happens a little too often that I come across a client who is suffering through their personal hell because they have discarded commercial alternatives on the basis that they “cost money” or “are not open-source.” In a professional setting, your first goal should be to find the best solution to a particular problem keeping all the appropriate constraints into consideration. If the cost of making OSS work for your specific problem is higher than acquiring a commercial package (a scenario that is not that far fetched if you’re trying to make the open-source software do something it wasn’t meant to), then you’re better off switching—perhaps with the long-term view of helping to sponsor an improvement in the OSS package to make it eventually meet your needs. By the same token, an ill-adapted open-source solution that doesn’t work well isn’t going to further the OSS cause much, either.

Thus, I hope that our little contest will give you an excuse to try out one of the many technologies and software products that Microsoft puts out. You may just find that one or two of them solve your problems in a way that saves you time, or money, or both—and, who knows, you could get a cool TV set and a free trip to one of the best PHP conferences of 2010 in the process!

Photo credit: Windows by eriwst (with some changes by yours truly).