Weaving the Post Factual Internet

I live in Santa Cruz, CA. When I left home this morning to drive over the hill to San Jose, I was surrounded by fog. Winding along the highway up into the Santa Cruz mountains, I rose above the mist into the sunlight. Green redwoods towered above the road. I looked back over my shoulder at the low lying gray clouds that obscured the California coast. Dazzled by the sunlight, I thought back on the experience of driving through the shifting gray swirls of mist and decided that it was an experience not unlike browsing the Internet.

We live in the age of spin. Most people who write the prose we read on the Internet do not even pretend to be interested in telling the truth. Instead, they pride themselves on their ability to "spin the truth," that is, they are professional liars. These writers don’t like the sunlight. Instead, they prefer the mist, the fog, the places where facts are hard to discern, and nothing is clear.

In his famous essay, "Politics and the English Language," George Orwell, taught us to shun cliches such as "spin the truth." He warned that people who indulge in slovenly language often end up, either consciously or unconsciously, hiding the truth in a swirling bank of fog.

The heart of George Orwell’s essay is a plea for simple, straight forward language. A phrase like "spin the truth" is not only a cliche, but it is also what Orwell calls a "verbal false limb." Orwell writes, " Instead of being a single word, such as break, stop, spoil, mend, kill , a verb becomes a phrase , made up of a noun or adjective tacked on to some general-purpose verb such as prove, serve, form, play, render." In this case, simple verbs such as lie or dissemble are replaced with a verb phrase such as "spin the truth."

We live in a post factual world. When confronted with an inconvenient fact, politicians, marketers and bloggers never acknowledge its truth. Instead, they attempt to "spin" the facts, to distort reality. Such behavior is so common that most of us no longer blink when confronted by even its most blatant expressions. We believe that WMD simultaneously exists and does not exist, we think the definition of the word "is" might be open to interpretation. The sin is not confined to any one party, it is universal. It is the mist in which we walk each day. It is easy enough to climb up out of the fog, but few take the trouble to make the hike.

Hotbeds of Post Factual Writing

The Internet provides a new twist to the problems outlined by Orwell. All over the web one can find specialized web sites designed to push a particular agenda.

One of my favorite web sites is called Slashdot. This is a place where people who like Linux and Open Source, but who oppose Microsoft and proprietary technology, can get together and talk shop. The site consists mostly of links to interesting articles about technology. On the Slashdot site, people can comment on the articles. There is a certain class of people on Slashdot who can be counted on to exercise all of the sins outline in Orwell’s article. In their attacks on Microsoft and proprietary software, they are often angry or even personal.

In email, in blogs, in the comments found on places like Slashdot, the Internet is rife with hostility masquerading as opinion. The art of writing clear prose that states facts without hostility is rare. People prefer to bludgeon one another with words rather than attempt to communicate. If no facts are handy, an insult will do just as well. It’s not enough that someone disagrees with an opinion, the opposition won’t rest until they have claimed the contrarian is stupid, immoral and sexually inadequate.

As I say, I enjoy Slashdot. Nevertheless, I often find it impossible to read the comments on the articles linked to from the site. The articles themselves are often interesting, but the community often seems to exist in a post literate world where being considerate is a form of weakness.

SlashDot, however, is only one of many sites that pander to particular world views. These sites are the frontline in the post factual Internet.

Even neutral sites such as Amazon are hotbeds of anger and deception. Go read the reviews of nearly any controversial political book found on Amazon, and one will find plenty of "reviews" written by people who clearly have never read the work in question. After all, if the book is written by Bill Clinton or Newt Gingrich, there is no need for many people to actually read the text in question. Instead, they pretend to have read it and offer up a series of insults and groundless abstractions that they believe add up to a meaningful review.

The Deceptive Power of Abstractions

George Orwell’s essay focuses on political speech. In today’s world, however, the political and the social have blended in a way that was hard to image in 1946, when Orwell wrote his essay. This blending of politics and social interaction is nowhere more evident than on the Internet.

Orwell writes: "Statements like Marshal Petain was a true patriot, The Soviet press is the freest in the world, The Catholic Church is opposed to persecution, are almost always made with intent to deceive. Other words used in variable meanings, in most cases more or less dishonestly, are: class, totalitarian, science, progressive, reactionary, bourgeois, equality."

Since 1946, when Orwell wrote his essay, most of us have forgotten Marshal Petain, the French war hero from World War I who helped the Nazi’s when they occupied France during World War II. But we know instinctively what Orwell means. We have all read phrases such as "Oliver North was a true Patriot," or "Daniel Ellsburg was a true patriot." In each of these cases, the word patriot has been redefined to represent a post factual interpretation of the word "patriot." It doesn’t matter what the dictionary says, the word now has a new meaning that only the author fully understands. The list of words that Orwell specifies has morphed over the years, but we can replace them with modern tag lines such as paradigm, patriot, free market, relevant, free election, terrorist, freedom fighter, conservative or liberal.

Bringing this subject back down to technical matters, we often hear abstract words used to describe an OS or a computer language. By now, many of us have been trained to instinctively ignore phrases such as "Delphi is the best language," "Java is the best language," or ".NET is the greatest thing since sliced bread." Phrases or words that we have learned to distrust include paradigm, next generation, productive, user experience, user friendly, bottom line, critical mass, market momentum, exit strategy, investment climate, and so on.

Post Factual Marketing

If we all deplore the low standards found in email, blogs and some newsgroups, it can be more interesting to explore carefully thought out prose written be obviously intelligent people. Let’s go to a particular pages on the web to see how it works. First we’ll look at marketing from Sun, and then from Microsoft.

I’ll quote first from a paragraph grabbed at random from the lead article on Sun’s web site. The topic in question is OpenSolaris, Sun’s open source version of their Solaris operating system. Here is the quote:

"’It’s easy to focus on the source, the tools, and all the other tangibles involved in open source. But at the end of the day, the true measure of success for the OpenSolaris project is the community,’ says Sun senior marketing manager, OpenSolaris, Claire Giordano. ‘It’s not about the source code–it’s about the conversation.’"

I think it is wonderful that Sun is releasing an open source version of their operating system. However, I don’t think they do it to foster a conversation. Instead, they are interested in promoting their product. If people are talking about their OS, then they are likely to use it. But we are so used to people "spinning" their point of view, that it almost seems impolite, or unfair, to point this out. I also distrust pat phrases such as "at the end of the day," and "the true measure of success." I also find it instructive to consider what the referent of the article "it" might be in the phase "It’s not about the source code — it’s about the conversation." In my opinion, the likely referent is "Our marketing plan," but most readers would never understand that from a simple reading of Claire’s words. Though in this case, the quote may be real, I know from my years in the corporate world that it is not at all uncommon for a marketing person to write out a quote, and then attribute it to someone higher up in their company. In today’s world, it is hard to know if these are really quotes from Claire, or just the output from a brainstorming session.

I will stop picking on Sun now, and turn my attention instead to Microsoft. Here is paragraph chosen completely at random from the first page I came to on Microsoft’s web site. When selecting the quote, I picked one of the two first full paragraphs I could find describing the company’s push for Window’s Vista:

"The Aero philosophy is not only to deliver a user experience that feels great but also to fundamentally change the way usability is measured. In the past, Windows focused heavily on usability as defined by such metrics as discoverability, time to task, and task completion. Aero continues to deliver on these metrics, but it will also enable Windows Vista and WinFX applications to generate a positive connection with users on first sight, on first use, and over the long term."

Forget the made up words such as "discoverability," and mangled verb forms such as "deliver on." And don’t bother wondering whether or not a product called Aero can have a philosophy. These issues are merely the tip of a dangerous hidden world that lies hidden beneath a seemingly benign cloud layer.

The claim of this paragraph is that the heart of the "Aero philosophy" is to "deliver a user experience that feels great." What is really going on here, however, is that the marketing people who promote this product want us to "feel great" about Windows Vista. No one really expects us to feel great when we click a button in the Windows UI. But such distinctions are lost in a swirling fog spun by the marketers.

The latter half of this paragraph is even more meaningless. It claims that the "Aero philosophy" is also to "fundamentally change the way usability is measured." This will be done by "creating a positive connection with users." That’s a funny way to measure usability. How in the world can you measure something as abstract and meaningless as "creating a positive connection?" Again, the desire to "create a positive connection with users" is not a goal of the product, but a goal of the marketers. Furthermore, this another example of what Orwell called "a verbal false limb." And lord knows no one in the Aero development team even once considered changing the way "usability is measured." The whole riff on measuring usability is simply a verbal mist designed to disorient the reader. Changing the way usability is measured is simply not one of the goals of the product. Or at least I hope it was not their goal. Such an intent would imply an all too conscious and sinister Orwellian manipulation of the public.

The paragraph we have found on Microsoft’s web site is the written equivalent of a fog bank. It surrounds the reader in a swirling mist through which nothing can be clearly seen. A single screen shot would tell us much more.

The ultimate irony, however, is that the underlying message that the paragraph wants to convey is in fact entirely benign. Translated into simple English of the type Orwell advocates, the paragraph would read as follows; "We want to create an attractive interface that is easy to use." Reading that simple sentence is a bit like watching the fog burn off the California coast. The fog might have looked sinister, but it was covering a very pretty landscape.

Both Microsoft and Sun have a strong simple message, which is easy to convey. Why don’t they simple say it? Are they trying to deceive customers, their boss, themselves? Who knows? We can’t see through the fog to find out what they are actually thinking. And yet, though I personally prefer OpenSolaris to Microsoft Vista, when I compare these two prose samples, I would rather be exposed to Microsoft’s benign floundering than to Sun’s false altruism. But it is a fool’s choice.

Summary

Words are seductive. I’ve written a lot of them, and there is no sin described in this article that I have not committed. I’m writing from experience to remind myself and others of the dangers that lurk as close at hand as the nearest mail client.

Most of us know what it means to be good, and to be honest. Many of the same people who insult others on Slashdot probably go home at night and kiss their spouses and hug their children. The prose on Microsoft’s or Sun’s web sites may well be written by people who attend a church, synagogue, temple or mosque. We are so lost in the fog of our words that we can no longer see the clash of values between what we tell our spouse, minister or children, and how we act on the Internet.

When we start writing words many of us get lost in a fog of abstractions. We use words not to communicate, but to bludgeon one another. We all do it, whether we are politicians making a national address, marketers trying to sell a product, or just ordinary citizens commenting on a blog. It is a disease indigenous to the modern world. We wander each day through a verbal mist designed to deceive. We are so used to it that we often distrust or disparage the simple truth when we chance to encounter it. It seems at times starkly impolite, and at other times naive.

We forget the damage created when we enter the post factual world of aggressive hostility and meaningless abstractions. The idea of stating a simple truth is foreign to us, and attempts to be helpful or polite now seem quaint and out moded.

The solution is fairly simple. The first step is to read Orwell’s essay and to make a resolution to always use the simplest, most direct verbs and nouns that we can find. The second step is to place others first in our hearts. Is what we are writing going to hurt someone else unnecessarily? Are we being so selfish as to attempt to deceive others for personal gain? Are we trying to communicate, or are we just trying to win some imaginary competition? Do we really believe that the insults that we utter on a newsgroup are necessary, or are we just trying to cover up own insecurities in a blustering fog of abstractions? If we have a talent for prose, are we using it to deceive or to inform?

The War of the Virtual Bills

As programmers, it is our karma to witness constant change. The wheel of life keeps turning, and we  turn with it. Each creaky, joyful, revolution represents a new phase, a new song to sing.

This revolution of the wheel is called the War of the Virtual Worlds. One spoke points toward Bill the Great, and his .NET virtual world, and another points to Bill the Joyful, and his cross platform Java virtual world.

As programmers we sweat over minute details in computer syntax, while these two behemoths face off, Goliath vs Goliath, one the mirror image of the other. Choose Java, or choose .NET: it hardly matters. In either case, you are living in a virtual world. It’s one virtual machine against the other, and the devil take the hindmost.

Despite the hype of their respective supporters, it is hard to believe that either will triumph decisively in the end. Here in America, many believe Microsoft rules the roost. But cross the sea to either the east or west, or travel south or north, and the further one gets from home, the more dully shines the Microsoft coin, and the more golden and glittering shine opposing technologies such as Java or Linux. The two opposing camps are both too huge, too set in their ways, too committed to their respective technologies, to ever give in. This is the age of the virtual Bills, and they will clash over and over until the wheel turns and each is taken by their aging, withered hands and marched off into the sunset.

Pick One from Column A, One from Column B

Some people have very strong opinions about which virtual machine is better: The one from Sun, or the one from Microsoft. But personally, I’m having an increasingly hard time telling the two apart. And so, I surmise, is the rest of the world.

This year Microsoft’s Tech Ed had 14 thousand attendees, while Java One had 15 thousand: a virtual dead heat. In a lead article from the June 27 edition of InfoWorld, we learn that: "Java is the de facto platform for enterprise-scale applications, owing to its proven scalability and the extraordinary range of services it provides."

In the eyes of your average Microsoft marketing victim, however, Java is little more than the cybernetic equivalent of Latin: A dead language used by a few bald-headed, pot bellied professors laboring away in virtual anonymity at small two year colleges lost on the plains of the American midwest. In the words of the Microsoft marketing wizards: "The Microsoft [.NET] strategy helps businesses realize the promise of information anytime, anywhere, on any device." With a promise like that, who needs anything else but a copy of Windows with the .NET virtual machine?

The Gospel According to Bills I and II

Driven by the desire to compete with Microsoft Windows, both Sun and IBM bit the bullet and worked together to champion Java and the cause of platform independence. The same Java code runs smoothly on Windows, Linux, Solaris, HP Unix, and a host of other platforms and small devices. The primary message of Java is that it fosters independence: Java applications run smoothly anytime, anywhere. Or at least that is how the song goes.

In the Windows world, the .NET CLR sometimes appears to have the opposite goal. It aims not at platform independence, but at Microsoft world dominanation: "One VM to rule them all, and in the darkness bind them!" In the Brave New World envisioned by Microsoft, one need never think again. Microsoft has the answers and the marketing team that can explain the details to you if you are dull enough to need them. The future is planned out for you: one shining steel rail reaching from Singapore to Washington, one seamless platform, based on the law of Redmond. In this land, there is plenty of choice, one can choose between Visual Basic, C++ or C# — so long as you don’t mind finding that all the different languages use nearly identical API’s and end up compiling down to more or less identical byte code.

NOTE: Of course, Microsoft has standardized parts of the .NET platform, just as parts of the Java platform are open sourced. The question we have to wrestle with is whether we are writing to the open parts of these platforms, or whether we are locked in to an individual company’s plan for  "world dominance." The Mono project represents the bridge from the Microsoft world to the larger world of cross platform programming, and hence it is always worth careful study if you are interested in .NET technology.

The More they Stay the Same

With two such opposite strategies, one would think that there must be a huge difference between the Java and .NET platforms. But of course, there is no significant difference between them. The average first year programmer with a semester or two of programming behind her would be hard pressed to guess whether a randomly selected swatch of code was written in C# or Java. Syntactically, the two languages are all but identical, and their API’s frequently vary only in the most minor details.

As I explained in a previous article, the Java VM and the Microsoft VM (aka as the CLR), are so nearly identical as to be virtually indistinguishable. They both have the same type of byte code scheme, the same type of JITcompilation engine, the same memory management scheme, the same syntax, the same interface based compositional architecture, and the same simple types.

NOTE: Occasionally we hear rumors that the .NET VM will become part of the Windows OS, but Microsoft has no plans to do this in the next revision of their operating system. As a result, any such development is likely to occur many years in the future. By then, the whole computing landscape will no doubt have evolved into something very different from what we see today.

Listening to the opposing marketing teams trying to claim technical superiority makes me feel like I’m back at college trying to parse a passage from Kant’s Critique of Pure Reason. Get beneath the bombastic hyperbole, and the VM marketer’s logic is sliced so thinly, the wheels are grinding so finely, that the whispy differences between the two positions will blow out of your hands in a five knot breeze.

Coping with the Virtual Twins

One way to deal with the twin virtual juggernauts is to stick to open API’s and cross platform strategies. Some technologies, such as unit testing and Ant build files, look virtually the same on either platform. Other technologies, such as HTML and Web Services, are designed to free you from having to choose a particular platform. It takes little work to make a .NET web service talk to a Java web service. Web Services are designed to work across platforms, and across API’s.

Anyone who has worked in the industry for awhile knows that technologies come and go. Seeing this panoply of change, I try not to become the victim of a marketing machine. When possible, I design my code to work with other technologies. Choosing accepted standards and open API’s is not a commitment to a particular platform, it is a commitment to the future of programming and to your own career. Every time you buy into an API controlled by a single company you are sucking the life blood from your own body. To choose a closed API is to help a chuckling bean counter create a world where there are victors and victims, and to work against a more spiritual, decent and fair world where there is security and stability.

In the Belly of the Virtual Snake

Ten years ago hardly anyone would have guessed that our future as programmers would be built on top of virtual machines. But now, morning noon and night, the talk is of virtual machines, and little else. It always .NET this and Java that. In some social circles, it is less risky to sing the praises of George Bush or Bill Clinton than it is to praise the wrong virtual machine.

I’ve always been a dreamer, and these days, my favorite dream is of a huge, virtual snake coming along and swallowing up both of these behemoths. I can picture it’s huge belly bulging with the meal on which it has gorged.

Like Java and .NET, Python is built on top of a virtual machine. But the Python virtual machine has no billion dollar marketing machine singing its praises. As a result, it is a lot less well known, but the air it breaths is clean and the rivers and lakes from which it drinks are clear and unpolluted.

While Java and C# are simply opposite sides of the same coin, Python has its own unique syntax. Created after Java and after Perl, it absorbed the best features of both languages, and then learned many new tricks. And it is constantly under revision, as you can learn from studying the new decorator syntax available in version 2.4. It’s creator, Guido von Rossum, is both more handsome and more creative than either of the Bills. And besides, he has a better name.

Of course, in today’s world, programmers and managers alike follow the pied piper of marketing, which leads them off to lemming land where the cliffs are high and the sky is always gray and cold. Humming his tune as they march toward the cliff, few look to the right or left and see that there is more than one virtual machine from which to choose.

Summary

Here at Falafel, land of good food, where the Egyptians dance, and the Nile flows blue between the sands, there are those who worship at the altar of Bill the Great, God of Microsoft. His virtual machine floats like a giant blue sun on the horizon of our consciousness. But there are others who look above them and see a different sky.

And certainly the behemoth virtual machines have done much for programmers. They each provide freedom from the cold metallic hardware that lies beneath us. In these virtual worlds we can work with logical machines that operate at least a bit more like a human brain and bit less like a cold, rigid mechanism made of silicon and metal.

The flexibility found in a virtual machine has proved to be a boon to everyone. Unfortunately, a marketing team can help mold these virtual machines into whatever shape they like. For my part, I try to write not to a virtual machine, but instead to write to accepted standards and open API’s.

If you want freedom, and a breath of fresh air, you might also try to set aside a little time each month in which to play with a virtual machine that is not powered by a billion dollar marketing team. I suggest Python, but some prefer Perl, and others prefer Ruby. In any case, you owe it to yourself to see what life is like in the free world. The war of the virtual Bills rages unabated, but there are other worlds where the grass is still green, the air fresh, and the land peaceful.

Whatever we do, the wheel will keep turning. Listen to the creaking and groaning, hear the rhythms the wheel makes as it turns. This is the song we dance to each day as we write code.

Start Your DirectX Engines

The DirectX 9 SDK now ships with the DirectX Sample Application Framework. With the sample framework, optimized DirectX initialization and management code are delivered free at the click of a button. I’m enthusiastic about the sample framework because developers will be able to begin work on DirectX games and simulations without re-engineering support code. But before we tour the sample framework, let’s take a look at the pain we can expect to avoid.

The Bad Old Days

In the past, many of the available example programs set up only the most basic DirectX 3D graphics requirements. Using Delphi and the wrapper units available from project Jedi for example, the following unmanaged code executes basic DirectX setup functions:

// wrapper unit from project Jedi, available from Borland code central
   uses D3D9; 
var
   Direct3D9: IDirect3D9;
   Direct3DDevice8: IDirect3DDevice9;
procedure TfrmMain.FormCreate(Sender: TObject);
   var
   DisplayMode: TD3DDisplayMode;
   D3DPresent_Parameters: TD3DPresent_Parameters;
   begin
   Direct3D9 := Direct3DCreate9(D3D_SDK_VERSION);
   Direct3D9.GetAdapterDisplayMode(D3DADAPTER_DEFAULT, DisplayMode);
 FillChar(D3DPresent_Parameters, SizeOf(TD3DPresent_Parameters), 0);
   with D3DPresent_Parameters do
   begin
   Windowed := True;
   hDeviceWindow := Handle;
   SwapEffect := D3DSWAPEFFECT_DISCARD;
   BackBufferFormat := DisplayMode.Format;
   end;
 Direct3D9.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
   Handle, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DPresent_Parameters,
   Direct3DDevice8);
   end;
procedure TfrmMain.FormPaint(Sender: TObject);
   begin
   Direct3DDevice8.Clear(0, nil, D3DCLEAR_TARGET,
   D3DCOLOR_XRGB(0, 0, 255), 0, 0);
 Direct3DDevice8.BeginScene;
   // assemble your scene here on the back buffer
   Direct3DDevice8.EndScene;
 // swap your back buffer to the visible screen
   Direct3DDevice8.Present(nil, nil, 0, nil);
   end;
procedure TfrmMain.FormResize(Sender: TObject);
   begin
   FormPaint(Self);
   end;

What do you get with this example? A blue screen, which of course Microsoft used to supply automatically at nominal cost. What doesn’t this do? Besides the fact the example has no other visual content, the example does not:

  • Handle device changes.
  • Have an optimal message loop.
  • Support text controls, edit boxes, or drop downs or any other basic UI that work in DirectX.
  • Support switching between full and windowed screens
  • Contain exception handling.

Fortunately you get all of the above for free using the DirectX Sample Application Framework that ships with the DirectX 9 SDK.

The Direct X Sample Application Framework

Your first step will be to install the latest DirectX 9 SDK from the msdn.microsoft.com DirectX download area. The download is about 220 Meg. After installing the SDK, run the DirectX Sample Browser from the SDK menu. Once you open the Sample Browser,  you will probably spend the next couple hours exploring the very cool examples. When you get back, we can finish the article.


The DirectX Sample Browser

To create a new C# sample application, first find the entry labeled “EmptyProject”. To locate the entry quickly, select the “Managed” and “Samples” checkboxes on the left. Then click the “Install Project” link to bring up the Install dialog. Note: You may have a Visual Studio plug-in for DirectX projects but this only works for some versions.

 

Installing the Empty Project

In the Install dialog give your project a name and change the location if you’re not happy with the default Visual Studio Projects location. When you click “Install”, the project is created for you. Note that your prebuilt project includes a hefty amount of infrastructure code. Also notice that references for DirectX assemblies are added automatically to support 3D graphics and other graphic utility functions.

 

Checking out the new DirectX project

In the “Common” folder, you’ll find a number of support classes:

  • The Framework class is defined in dxmut.cs. This class welds familiar Windows mechanics to the DirectX display details, including an implementation of a custom message loop. Graphics applications are typically organized around a “rendering loop”, the section of code that continually repaints the screen. A custom message loop avoids the use of less optimal paint or idle events for DirectX rendering.
  • Your application automatically implements IFrameworkCallback and IDeviceCreation interfaces. IFrameworkCallback defines OnFrameRender to animate the scene and OnFrameMove for pre-rendering calculations. Both interfaces are called by the Framework class and are defined in dxmutdata.cs.
  • Central to DirectX is the notion of direct access to the best capabilities of your hardware. The Enumerate class defined in Dxmutenum.cs discovers what graphics cards are available and the capabilities of each.
  • Before the advent of the Sample Framework, if you wanted user input controls that worked in a DirectX environment, you had to write your own. DxmutGui.cs defines a working set of edit boxes, radio buttons, standard buttons, drop down, sliders and dialogs that are structured similar to the familiar Windows controls, but are actually rendered along with your 3D scene.

 

 

New Sample Application Running

Summary

All told, the DirectX Sample Application Framework delivers more than 16,000 lines of robust support code. This free functionality translates to code you don’t need to re-engineer and write just to get started game and simulation programming.