Click to Rate and Give Feedback
Also by this Author

This column crafts an XML document to hold the mouse environment simulation data and shows how to incorporate an XML file into the program using a DataSet.

Stanley B. Lippman

MSDN Magazine October 2007

...

Read more!

Stanley Lippman begins a look at using C++/CLI as a purely .NET-compliant language.

Stanley B. Lippman

MSDN Magazine June 2007

...

Read more!

A funny thing happened to templates on their way to the common language runtime (CLR)—they lost their {type} identity. This is analogous to what happens with macros under native programs. Just as the C/C++ compilers have no awareness of macro preprocessor expansions, the CLR has no awareness of template instantiations.

Stanley B. Lippman

MSDN Magazine December 2005

...

Read more!

I'm closing out this series of columns on generic programming in the Microsoft® . NET Framework by showing how templates and generics do and do not work together, and pointing out a pitfall with the current implementation of templates under Visual C++® 2005.

Stanley B. Lippman

MSDN Magazine April 2006

...

Read more!

This month Stanley Lippman introduces the support for regular expressions in the .NET Framework.

Stanley B. Lippman

MSDN Magazine November 2006

...

Read more!

Popular Articles

Chris Tavares explains how the ASP.NET MVC Framework's Model View Controller pattern helps you build flexible, easily tested Web applications.

Chris Tavares

MSDN Magazine March 2008

...

Read more!

A Sidebar gadget is a powerful little too that's surprisingly easy to create. Get in on the fun with Donavon West.

Donavon West

MSDN Magazine August 2007

...

Read more!

One-time passwords offer solutions to dictionary attacks, phishing, interception, and lots of other security breaches. Here's how it all works.

Dan Griffin

MSDN Magazine May 2008

...

Read more!

When incorporating the ASP.NET DataGrid control into your Web apps, common operations such as paging, sorting, editing, and deleting data require more effort than you might like to expend. But all that is about to change. The GridView control--the successor to the DataGrid-- extends the DataGrid's functionality it in a number of ways. First, it fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, as long as its bound data source object supports these capabilities. In addition, ...

Read more!

Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

...

Read more!

{ End Bracket }
Is Programming an Art?
Stanley B. Lippman


People who are only users of software frequently fail to appreciate just how very hard it is to write. Oh, the design and initial development are the fun parts. The difficult part is getting it to run correctly (and fast enough). It’s as if for a programmer, a meal begins with a scrumptious double fudge mocha cheesecake and ends with creamed spinach.
The reason we say programming remains an art, not a science or an engineering discipline, is because we haven’t as yet been able to break it down into component steps and mechanize it. Once we succeed in that, a new scale of possibility emerges: programs to write programs from people-oriented design languages (PODL), programs to prove program correctness, and to analyze and support semantic query. Until then, however, programming remains an art, or so conventional wisdom has it.
But as with much conventional wisdom, this analogy does not hold up to closer inspection. Crafting a program (and I’ve done this for over 20 years) is, in fact, nothing at all like art—at least not the art of writing fiction (and I’ve done that for over 20 years as well). Let me illustrate my point with these two fragments of program and prose.
This first piece is part of a lexical analyzer for parsing Visual C++® 7.1. It looks like this:
if ( index >= TokenID::lastKeyword() ) {
    string token = tokenString( index );
    if (( isdigit( token[ 0 ] )) || ( token[0] == ‘-’ )) {
#ifdef TELL_ME
        display( "!! TokenSet::tokenIdentify: ", 
                     "a literal digit: ", token );
#endif
        return TokenID::TK_Literal;
    }
}
This second piece is the opening of a story I wrote some 27 years ago while living in Tucson, Arizona, teaching and writing prose:
We were her pride of 10, Miss Steward named us: the Prodigal, Phoenix,
Benjamin, and perspicacious, pacific Suzanne. Hush, child. Benjamin, be 
still, Miss Steward commanded him gently. People are never just.
Both pieces were extensively designed—that is, I spent a great deal of up-front time designing the architecture of the overall work, and the fragments reflect that design effort. The program has one performance flaw—I retrieve the string entry in the associated string table by value rather than pointer. If the code were to be moved to production, it would require an obvious revision. It has nothing to do with correctness but simply with performance. For a small source code program, the difference in speed is not measurable, and so I chose the cleaner but slower object syntax since I dislike the C/C++ pointer manipulation tokens.
While my prose has not attracted millions of readers, those who do read prose appreciate the craft with its emotional weave under a rigorous symbolic framework. Those who do not appreciate the prose tradition find it mystifying because there is nothing functional about it. The purpose of art is to project feelings and the reality of a subjective private life in the midst of public events into a particular plastic medium—words, in the case of prose. Of course, there is no value in that, not like the value intrinsic to a program.
I like the design process of a program and working out how the different parts of it interact. I like defining abstractions or families of abstractions. I consider them my cast of characters. And I like doing interfaces, because those are the things my characters do to one another. And that’s really how I write programs.
I don’t like writing expressions and statements. I wish we had a symbolic programming language I could think in better and keep in my head. I can’t, frankly, keep arithmetic expressions and parenthetical nestings clear. While I can keep eight separate sections of text in my mind and contrast and echo them, I can’t make sense of a program beyond the classes I design and their interfaces.
In John Markoff’s excellent history of the PC industry, What the Dormouse Said, he states that the goal of the initial visionaries—to put a computer at the disposal of every person—has been realized. But he’s wrong. It has only been half realized. What good is all that computer power for a person, if that person can’t themselves program it? We haven’t realized their dream yet because we haven’t yet figured out how to make programming an art so that everyone can share in it. Until we do that, programming remains neither a discipline of science nor a domain of art. For now, programming is little more than a new-fangled alchemy. Nobody really understands it and nobody as yet has turned a specification into real gold.

Stanley B. Lippman began working on C++ with its inventor, Bjarne Stroustrup, in 1984 at Bell Laboratories. Later, Stan worked in feature animation both at Disney and DreamWorks and served as a Software Technical Director on Fantasia 2000. He has since served as Distinguished Consultant with JPL, and an Architect with the Visual C++ team at Microsoft.

Page view tracker