Intentional programming and Dreaming in Code
"It's tempting to view the multitude of monster projects gone bad as anomalies, excrescences of corporate and government bureaucracies run amok. But you will find similar tales of woe emerging from software projects big and small, public and private, old and new. Though the details differ, the pattern is depressingly repetitive. Moving targets. Fluctuating goals. Unrealistic schedules. Missed deadlines. Ballooning costs. Despair. Chaos."
Software development is a fundamentally human endeavor, a Sisyphean task in which the hill seems to get steeper. After spending years conceiving and writing "Dreaming in Code," Scott distilled his experience into what he self-referentially calls Rosenberg's Law:
"Software is easy to make except when you want to make something new. And then, of course, there is the corollary. The only software that's worth making is software that does something new."
Intentional programming is something new aimed at taking complexity and errors out of the software development process. As part of Scott's intentional programming article in the Technology Review, Wade Roush provides an explanation of intentional programming, which so far has been more theory than practical reality. Here is the gist of it:
With the programmers' help, the domain experts list all the concepts and definitions the software will need to encompass. All these definitions go into a database that Simonyi calls the "domain schema."
Like the bench maker turning his knobs, the programmers then incorporate the definitions in the domain schema into "domain code"--a high-level representation of the software's functions, expressed in a "domain-specific language," or DSL, that can be tailored to suit the industry in question. But while DSLs can vary, each action the software must carry out is stored in a uniform format, an "intentional tree." Intentional trees have the advantage of being visually simple but logically comprehensive, which means they can be manipulated, revised, and "projected" or reënvisioned at will.
For example, the computation represented by the simple program statementDoes intentional programming make more sense to you now?
return a = b / (c +1) ;
is represented by the following intentional tree:
Return
(
Assign
(
a,
Div
(
b,
Plus
(
c,
1
)
)
)
)
Once encoded in tree form, the computation can be projected in many other ways that might be more familiar to domain experts, such as
b
return a = ------- ;
c+1