<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Bertrand Meyer's technology blog</title>
	
	<link>http://bertrandmeyer.com</link>
	<description>Software and Technology</description>
	<lastBuildDate>Mon, 08 Feb 2010 18:34:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<feedburner:info uri="bertrandmeyer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://bertrandmeyer.com/feed/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://bertrandmeyer.com/feed/" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Fbertrandmeyer.com%2Ffeed%2F" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>Reflexivity, and other pillars of civilization</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/PQOEIRFi18E/</link>
		<comments>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 03:23:36 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Language design]]></category>
		<category><![CDATA[Numerics]]></category>
		<category><![CDATA[Programming techniques]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Feldman]]></category>
		<category><![CDATA[Kahan]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Snyder]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054</guid>
		<description><![CDATA[Compatibility with an existing computer standard is great, but what about compatibility with a few hundred years of mathematics? ]]></description>
			<content:encoded><![CDATA[<p>Let me start, dear reader of this blog, by probing your view of equality, and also of assignment. Two questions:  </p>
<ul>
<li>Is a value <span style="color: #0000ff;"><em>x</em></span> always equal to itself? (For the seasoned programmers in the audience: I am talking about a value, as in mathematics, not an expression, as in programming, which could have a side effect. </li>
<li>In programming, if we consider an assignment</li>
</ul>
<p style="padding-left: 60px;"><span style="color: #0000ff;"><em>       x</em> := <em>y</em></span></p>
<p style="padding-left: 30px;">and <span style="color: #0000ff;"><em>v</em></span> is the value of <span style="color: #0000ff;"><em>y</em></span> before that assignment (again, this little detour is to avoid bothering with side effects), is the value of <span style="color: #0000ff;"><em>x</em></span> always equal to <span style="color: #0000ff;"><em>v</em></span> after the assignment?  </p>
<p>Maybe I should include here one of these Web polls that one finds on newspaper sites, so that you can vote and compare your answer to the Wisdom of Crowds. My own vote is clear: yes to both. Equality is reflexive (every value is equal to itself, at any longitude and temperature, no excuses and no exceptions); and the purpose of assignment is to make the value of the target equal to the value of the source. Such properties are some of the last ramparts of civilization. If they go away, what else is left?  </p>
<h4>754 enters the picture</h4>
<p>Now come floating-point numbers and the famous IEEE “754” floating-point standard [1]. Because not all floating point operations yield a result usable as a floating-point number, the standard introduces a notion of “NaN”, Not a Number; certain operations involving floating-point numbers may yield a NaN. The term NaN does not denote a single value but a set of values, distinguished by their “payloads”.  </p>
<p>Now assume that the value of <span style="color: #0000ff;"><em>x</em></span> is a NaN. If you use a programming language that supports IEEE 754 (as they all do, I think, today) the test in  </p>
<p style="padding-left: 30px;"><span style="color: #0000ff;"><strong>        if</strong> <em>x</em> = <em>x</em> <strong>then</strong> &#8230; </span> </p>
<p>is supposed to yield False. Yes, that is specified in the standard: NaN is never equal to NaN (even with the same payload); nor is it equal to anything else; the result of an equality comparison involving NaN will always be False.  </p>
<p>Assignment behavior is consistent with this: if <span style="color: #0000ff;"><em>y</em></span> (a variable, or an expression with no side effect) has a NaN value, then after  </p>
<p style="padding-left: 30px;"><span style="color: #0000ff;"><em>        x</em> := <em>y</em></span>  </p>
<p>the test <span style="color: #0000ff;"><em>x</em> = <em>y </em></span>will yield False. </p>
<p>Before commenting further let me note the obvious: I am by no means a numerics expert; I know that IEEE 754 was a tremendous advance, and that it was designed by some of the best minds in the field, headed by Velvel Kahan who received a Turing Award in part for that success. So it is quite possible that I am about to bury myself in piles of ridicule. On the other hand I have also learned that (1) ridicule does not kill, so I am game; and more importantly (2) experts are often right but not always, and it is always proper to question their reasoning. So without fear let me not stop at the arguments that “<em>the committee must have voted on this point and they obviously knew what they were doing</em>” and “<em>it is the standard and implemented on zillions of machines, you cannot change it now</em>”. Both are true enough, but not an excuse to censor questions.  </p>
<h4>What are the criteria?</h4>
<p>The question is: compatibility with an existing computer standard is great, but what about compatibility with a few hundred years of mathematics? Reflexivity of equality  is something that we expect for any data type, and it seems hard to justify that a value is not equal to itself. As to assignment, what good can it be if it does not make the target equal to the source value?  </p>
<p>The question of assignment is particularly vivid in Eiffel because we express the expected abstract properties of programs in the form of contracts. For example, the following “setter” procedure may have a postcondition (expressed by the <span style="color: #0000ff;"><strong>ensure</strong></span> clause):  </p>
<p style="padding-left: 30px;"><span style="color: #0000ff;"><em>        set_x</em> (<em>v</em>: <em>REAL</em>)<br />
                        &#8212; Set the value of <em>x</em> (an attribute, also of type <em>REAL</em>) the value of <em>v</em>.<br />
                <strong>do</strong><br />
                        &#8230;<br />
                        <em>x</em> := <em>v</em>  <br />
                <strong>ensure</strong><br />
                        <em>x</em> = <em>v</em><br />
                <strong>end</strong>  </span></p>
<p>   <br />
If you call this procedure with a NaN argument for a compiler that applies IEEE 754 semantics, and monitor contracts at run time for testing and debugging, the execution will report a contract violation. This is very difficult for a programmer to accept.  </p>
<p>A typical example arises when you have an assignment to an item of an array of <em>REAL</em> values. Assume you are executing <span style="color: #0000ff;"><em>a</em> [<em>i</em>] := <em>x</em></span>. In an object-oriented view of the world (as in Eiffel), this is considered simplified syntax  for the routine call <span style="color: #0000ff;"><em>a</em>.<em>put</em> (<em>x</em>, <em>i</em>)</span>. The postcondition is that <span style="color: #0000ff;"><em>a</em> [<em>i</em>] = <em>x</em></span>. It will be violated!  </p>
<h4>The experts&#8217; view</h4>
<p>I queried a number of experts on the topic. (This is the opportunity to express my gratitude to members of the IFIP working group 2.5 on numerical software [2], some of the world&#8217;s top experts in the field, for their willingness to respond quickly and with many insights.) A representative answer, from <a href="http://en.wikipedia.org/wiki/Stuart_Feldman" target="blog_illustrations">Stuart Feldman</a>, was:  </p>
<blockquote><p><em>If I remember the debate correctly (many moons ago), NaN represents an indefinite value, so there is no reason to believe that the result of one calculation with unclear value should match that of another calculation with unclear value. (Different orders of infinity, different asymptotic approaches toward 0/0, etc.)  </em></p></blockquote>
<p>Absolutely correct! Only one little detail, though: this is an argument against using the value True as a result of the test; but it is not an argument for using the value False! The exact same argument can be used to assert that the result should not be False:  </p>
<blockquote><p>&#8230; there is no reason to believe that the result of one calculation with unclear value should <span style="color: #a00000;"><strong><em>not</em> </strong></span>match that of another calculation with unclear value.  </p></blockquote>
<p>Just as convincing! Both arguments complement each other: there is no compelling reason for demanding that the values be equal; and there is no compelling argument either to demand that they be different. If you ignore one of the two sides, you are biased.  </p>
<h4>What do we do then?</h4>
<p>The conclusion is not that the result should be False. The rational conclusion is that True and False are both unsatisfactory solutions. The reason is very simple: in a proper theory (I will sketch it below) the result of such a comparison should be some special undefined below; the same way that IEEE 754 extends the set of floating-point numbers with NaN, a satisfactory solution would extend the set of booleans with some NaB (Not a Boolean). But there is no NaB, probably because no one (understandably) wanted to bother, and also because being able to represent a value of type <span style="color: #0000ff;"><em>BOOLEAN</em></span> on a single bit is, if not itself a pillar of civilization, one of the secrets of a happy life.  </p>
<p>If both True and False are unsatisfactory solutions, we should use the one that is the “least” bad, according to some convincing criterion . That is not the attitude that 754 takes; it seems to consider (as illustrated by the justification cited above) that False is somehow less committing than True. But it is not! Stating that something is false is just as much of a commitment as stating that it is true. False is no closer to NaB than True is. A better criterion is: which of the two possibilities is going to be least damaging to time-honored assumptions embedded in mathematics? One of these assumptions is the reflexivity of equality:  come rain or shine, <span style="color: #0000ff;"><em>x</em></span> is equal to itself. Its counterpart for programming is that after an assignment the target will be equal to the original value of the source. This applies to numbers, and it applies to a NaN as well. </p>
<p>Note that this argument does not address equality between different NaNs. The standard as it is states that a specific NaN, with a specific payload, is not equal to <em>itself</em>.  </p>
<h4>What do you think?</h4>
<p>A few of us who had to examine the issue recently think that — whatever the standard says at the machine level — a programming language should support the venerable properties that equality is reflexive and that assignment yields equality.</p>
<p>Every programming language should decide this on its own; for Eiffel we think this should be the specification. Do you agree?  </p>
<h4>Some theory</h4>
<p>For readers who like theory, here is a mathematical restatement of the observations above. There is nothing fundamentally new in this section, so if you do not like strange symbols you can stop here.  </p>
<p>The math helps explain the earlier observation that neither True nor False is more“<em>committing</em>” than the other. A standard technique (coming from denotational semantics) for dealing with undefinedness in basic data types, is to extend every data type into a lattice, with a partial order relation meaning “less defined than”. The lattice includes a bottom element, traditionally written “<span style="color: #a00000;">⊥</span>” (pronounced “<em>Bottom</em>”) and a top element written <span style="color: #a00000;">⊤</span> (“T<em>op</em>”). <span style="color: #a00000;">⊥</span> represents an unknown value (not enough information) and <span style="color: #a00000;">⊤</span> an error value (too much information). Pictorially, the lattice for natural numbers would look like this:  </p>
<div id="attachment_1068" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-1068" title="Integer lattice" src="http://bertrandmeyer.com/wp-content/upLoads/integer_lattice3-500x311.jpg" alt="Integer lattice" width="500" height="311" /><p class="wp-caption-text">The lattice of integers</p></div>
<p>On basic types, we always use very simple lattices of this form, with three kinds of element: <span style="color: #a00000;">⊥</span>, less than every other element; <span style="color: #a00000;">⊤</span>, larger than all other elements; and in-between all the normal values of the type, which for the partial order of interest are all equal. (No, this is not a new math in which all integers are equal. The order in question simply means “<em>is less defined than</em>”. Every integer is as defined as all other integers, more defined than <span style="color: #a00000;">⊥</span>, and less defined than <span style="color: #a00000;">⊤</span>.) Such lattices are not very exciting, but they serve as a starting point; lattices with more interesting structures are those applying to functions on such spaces — including functions of functions —, which represent programs.  </p>
<p>The modeling of floating-point numbers with NaN involves such a lattice; introducing NaN means introducing a <span style="color: #a00000;">⊥</span> value. (Actually, one might prefer to interpret NaN as <span style="color: #a00000;">⊤</span>, but the reasoning transposes immediately.)  More accurately, since there are many NaN values, the lattice will look more like this:</p>
<div id="attachment_1133" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-1133" title="Float lattice" src="http://bertrandmeyer.com/wp-content/upLoads/float_lattice-500x392.jpg" alt="Float lattice" width="500" height="392" /><p class="wp-caption-text">The lattice of floats in IEEE 754</p></div>
<p>For simplicity we can ignore the variety of NaNs and consider a single <span style="color: #a00000;">⊤</span>.</p>
<p>Functions on lattices — as implemented by programs — should satisfy a fundamental property: monotonicity. A function <span style="color: #0000ff;"><em>f</em></span>  is monotone (as in ordinary analysis) if, whenever <span style="color: #0000ff;"><em>x</em> ≤ <em>y</em></span>, then <span style="color: #0000ff;"><em>f</em> (<em>x</em>) ≤ <em>f</em> (<em>y</em>)</span>. Monotonicity is a common-sense requirement: we cannot get more information from less information. If we know less about <span style="color: #0000ff;"><em>x</em></span> than about <span style="color: #0000ff;"><em>y</em></span>, we cannot expect that any function (with a computer, any program) <span style="color: #0000ff;"><em>f</em></span> will, out of nowhere, restore the missing information.  </p>
<p>Demanding monotonicity of all floating-point operations reflects this exigency of monotonicity: indeed, in IEEE 754, any arithmetic operation — addition, multiplication &#8230; — that has a NaN as one of its arguments must yield a Nan as its result. Great. Now for soundness we should also have such a property for boolean-valued operations, such as equality. If we had a NaB as the <span style="color: #a00000;">⊥</span> of booleans, just like NaN is the <span style="color: #a00000;">⊥</span> of floating-point numbers,  then the result of NaN = NaN would be NaB. But the world is not perfect and the IEEE 754 standard does not govern booleans. Somehow (I think) the designers thought of False as somehow less defined than True. But it is not! False is just as defined as True in the very simple lattice of booleans; according to the partial order, True and False are equal for the relevant partial order:</p>
<div id="attachment_1074" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-1074" title="Boolean lattice" src="http://bertrandmeyer.com/wp-content/upLoads/boolean_lattice3-500x444.jpg" alt="Boolean lattice" width="500" height="444" /><p class="wp-caption-text">The lattice of booleans</p></div>
<p>Because any solution that cannot use a NaB will violate monotonicity and hence will be imperfect, we must resort to heuristic criteria. A very strong criterion in favor of choosing True is reflexivity — remaining compatible with a fundamental property of equality. I do not know of any argument for choosing False. </p>
<h4>The Spartan approach</h4>
<p>There is, by the way, a technique that accepts booleans as we love them (with two values and no NaB) and achieves mathematical rigor. If operations involving NaNs  truly give us pimples, we can make any such operation trigger an exception. In the absence of <span style="color: #a00000;">⊥</span> values,  this is an acceptable programming technique for representing undefinedness. The downside, of course, is that just about everywhere the program must be ready to handle the exception in some way. </p>
<p>It is unlikely that in practice many people would be comfortable with such a solution. </p>
<h4>Final observations</h4>
<p>Let me point out two objections that I have seen. <a class="blog_illustrations" href="http://science.jpl.nasa.gov/people/Snyder/" target="_blank">Van Snyder </a>wrote: </p>
<blockquote><p>NaN is not part of the set of floating-point numbers, so it doesn&#8217;t behave as if &#8220;bottom&#8221; were added to the set. </p></blockquote>
<p>Interesting point, but, in my opinion not applicable: <span style="color: #a00000;">⊥</span> is indeed not part of the mathematical set of floating point numbers, but in the form of NaN it is part of the corresponding type (<span style="color: #0000ff;">float</span> in C, <span style="color: #0000ff;"><em>REAL</em></span> in Eiffel); and the operations of the type are applicable to all values, including NaN if, as noted, we have not taken the extreme step of triggering an exception every time an operation uses a NaN as one of its operands. So we cannot free ourselves from the monotonicity concern by just a sleight of hands. </p>
<p>Another comment, also by Van Snyder (slightly abridged): </p>
<blockquote><p>Think of [the status of NaN] as a variety of dynamic run-time typing. With static typing, if  <span style="color: #0000ff;"><em>x</em></span> is an integer variable and <span style="color: #0000ff;"><em>y</em> </span></p>
<p><span style="color: #0000ff;"><em>        x</em> := <em>y</em></span> </p>
<p>does not inevitably lead to </p>
<p><span style="color: #0000ff;"><em>        x</em> = <em>y</em></span></p></blockquote>
<p> True; and a compelling argument to <em>require</em> that conversions satisfy equality as a postcondition! Such  reasoning — reflexivity again — was essential in the design of the Eiffel conversion mechanism [3], which makes it possible to define conversions between various data types (not just integers and reals and the other classical examples, but also any other user types as long as the conversion does not conflict with inheritance). The same conversion rules apply to assignment and equality, so that yes, whenever the assignment <span style="color: #0000ff;"><em>x</em> := <em>y</em></span> is permitted, including when it involves a conversion, the property <span style="color: #0000ff;"><em>x</em> = <em>y </em></span> is afterwards always guaranteed to hold.</p>
<p>It is rather dangerous indeed to depart from the fundamental laws of mathematics. </p>
<h4>References</h4>
<p>[1] IEEE floating-point standard, 754-2008; see summary and references in the <a title="IEEE Floating-Point Standard" href="http://en.wikipedia.org/wiki/IEEE_floating-point_standard">Wikipedia entry</a>.  </p>
<p>[2] IFIP Working Group 2.5 on numerical software: <a href="http://go.to/wg2.5">home page</a>. </p>
<p>[3] Eiffel standard (ECMA and ISO), available <a href="http://www.ecma-international.org/publications/standards/Ecma-367.htm" target="blog_illustrations">on the ECMA site</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/PQOEIRFi18E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/</feedburner:origLink></item>
		<item>
		<title>A couple of loop examples</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/-WGvs7HXDrI/</link>
		<comments>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 02:44:50 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Language design]]></category>
		<category><![CDATA[Loop]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1025</guid>
		<description><![CDATA[(This entry originated as a post on the EiffelStudio user group mailing list.) 
Here are a couple of actual examples of the new loop variants discussed in the blog entry immediately preceding this one. They came out of my current work; I started updating a program to take advantage of the new facility.
As a typical example, I replaced
        [...]]]></description>
			<content:encoded><![CDATA[<p>(This entry originated as a post on the EiffelStudio user group mailing list.) </p>
<p>Here are a couple of actual examples of the new loop variants discussed in the blog entry immediately preceding this one. They came out of my current work; I started updating a program to take advantage of the new facility.</p>
<p>As a typical example, I replaced</p>
<p><span style="color: #0000ff;"><strong>        local</strong><br />
<strong>        <strong>        </strong></strong><em>eht</em>: <em>HASH_TABLE</em> [<em>EXPRESSION</em>, <em>EXPRESSION</em>]<br />
<strong><strong>        </strong>do</strong><br />
<strong>        <strong>        </strong></strong>&#8230;<br />
<strong><strong>        </strong>from</strong><br />
<strong>        <strong>        </strong></strong><em>eht</em> := <em>item</em> (<em>e</em>)<br />
<strong>        <strong>        </strong></strong><em>eht</em>.<em>start</em><br />
<strong><strong>        <strong> </strong></strong>until</strong><br />
<strong>        <strong>        </strong></strong><em>eht</em>.<em>off</em><br />
<strong><strong>        </strong>loop</strong><br />
<strong>                Result</strong>.<em>extend</em> (<em>eht</em>.<em>key_for_iteration</em>)<br />
<strong>        <strong>        </strong></strong><em>eht</em>.<em>forth</em><br />
<strong><strong>        </strong>end</strong> </span></p>
<p> by</p>
<p><span style="color: #a00000;"><strong><strong>        </strong>across</strong> <em>item</em> (<em>e</em>) <strong>as</strong> <em>eht</em> <strong>loop</strong> <strong>Result</strong>.<em>extend</em> (<em>eht</em>.<em>key</em>) <strong>end</strong></span></p>
<p> which also gets rid of the local variable declaration. The second form is syntactic sugar for the first, but I find it justified. </p>
<p> Another case, involving nested loops: </p>
<p><span style="color: #0000ff;">&#8211; Previously:<br />
</span><span style="color: #0000ff;"><br />
<strong>        from</strong><br />
<em><strong> <strong>        </strong>       </strong>other.start<br />
</em><strong><strong>        </strong>until</strong><br />
<em><strong>  <strong>        </strong>      </strong>other.off<br />
</em><strong><strong>        </strong>loop</strong><br />
<strong>        <strong>        </strong></strong><em>oht</em> :=<em> other.item_for_iteration</em><br />
<strong>      <strong>        </strong>  </strong><em>e</em> := <em>other.key_for_iteration</em><br />
<strong><strong>  <strong>        </strong>      </strong>from</strong><br />
<strong> <strong>        </strong>       <strong>        </strong></strong><em>oht.start<br />
</em><strong><strong> <strong>        </strong>       </strong>until</strong><br />
<strong> <strong>        </strong>       <strong>      <em>  </em></strong></strong><em>oht.off<br />
</em><strong><strong><strong>  <strong>        </strong>      </strong></strong>loop</strong><br />
<strong>  <strong>        </strong>      <strong>        </strong></strong><em>put (e, oht.item_for_iteration)<br />
<strong> <strong>        </strong>       <strong>        </strong></strong>oht.forth<br />
</em><strong><strong><strong>        </strong>       <strong> </strong></strong>end</strong><br />
<strong>      <strong>       <em> </em></strong><em>  </em></strong><em>other.forth<br />
</em><strong><strong>        </strong>end<br />
</strong></span><span style="color: #0000ff;"><br />
&#8211; Now:</p>
<p></span><span style="color: #a00000;"><strong><strong>        </strong>across</strong> <em>other</em> <strong>as</strong> <em>o</em> <strong>loop</strong><br />
<strong>                across</strong> <em>o.item</em> <strong>as</strong> <em>oht</em> <strong>loop</strong> <em>put</em> (<em>o.key</em>, <em>oht.item</em>) <strong>end</strong><br />
<strong>        end</strong></span></p>
<p>here getting rid of <em>two</em> local variable declarations (although I might for efficiency reintroduce the variable <span style="color: #0000ff;"><em>e</em></span>  to compute <span style="color: #0000ff;"><em>o.key</em></span> just once). </p>
<p>It is important to note that these are not your grandmother&#8217;s typical loops: they iterate on complex data structures, specifically hash tables where the keys are lists and the items are themselves hash tables, with lists as both items and keys. </p>
<p>The mechanism is applicable to all the relevant data structures in EiffelBase (in other words, no need for the programmer to modify anything, just apply the <span style="color: #0000ff;"><strong>across</strong></span>  loop to any such structure), and can easily extended to any new structure that one wishes to define. In the short term at least, I still plan in my introductory teaching to show the explicit variants first, as it is important for beginners to understand how a loop works. (My hunch based on previous cases is that after a while we will feel comfortable introducing the abstract variants from the start, but it takes some time to learn how to do it right.)</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/-WGvs7HXDrI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/</feedburner:origLink></item>
		<item>
		<title>More expressive loops for Eiffel</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/4m3Cib3PImE/</link>
		<comments>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 05:16:04 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Programming techniques]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Design by Contract]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990</guid>
		<description><![CDATA[New variants of the loop construct have been introduced into Eiffel, allowing a safer, more concise and more abstract style of programming. The challenge was to remain compatible with the basic loop concept, in particular correctness concerns (loop invariant and loop variant), to provide a flexible mechanism that would cover many different cases of iteration, [...]]]></description>
			<content:encoded><![CDATA[<p>New variants of the loop construct have been introduced into Eiffel, allowing a safer, more concise and more abstract style of programming. The challenge was to remain compatible with the basic loop concept, in particular correctness concerns (loop invariant and loop variant), to provide a flexible mechanism that would cover many different cases of iteration, and to keep things simple. </p>
<p>Here are some examples of the new forms. Consider a structure <span style="color: #0000ff;"><em>s</em></span>, such as a list, which can be traversed in sequence. The following loop prints all elements of the list: </p>
<p>        <span style="color: #0000ff;"><strong>across</strong> <em>s</em> <strong>as</strong> <em>c </em><strong>loop</strong> <em>print</em> (<em>c</em>.<em>item</em>) <strong>end</strong> </span> </p>
<p>(The procedure <span style="color: #0000ff;"><em>print</em></span> is available on all types, and can be adapted to any of them by redefining the <span style="color: #0000ff;"><em>out</em></span> feature; <span style="color: #0000ff;">item</span> gives access to individual values of the list.) More about <span style="color: #0000ff;"><em>c</em></span> in just a moment; in the meantime you can just consider consider that using “<span style="color: #0000ff;"><strong>as</strong> <em>c</em></span>” and manipulating the structure through <span style="color: #0000ff;"><em>c</em></span> rather than directly through <span style="color: #0000ff;"><em>s</em></span>  is a simple idiom to be learned and applied systematically for such <span style="color: #0000ff;"><strong>across</strong></span> loops. </p>
<p>The above example is an instruction. The <span style="color: #0000ff;"><strong>all</strong></span> and <span style="color: #0000ff;"><strong>some</strong></span> variants yield boolean expressions, as in </p>
<p>        <span style="color: #0000ff;"><strong>across </strong><em>s</em> <strong>as</strong> <em>c</em> <strong>all</strong> <em>c</em>.<em>item</em> &gt; 0<em> </em><strong>end</strong></span> </p>
<p>which denotes a boolean value, true if and only if all elements of the list are positive. To find out if at least one is positive, use </p>
<p>        <span style="color: #0000ff;"><strong>across </strong><em>s</em> <strong>as</strong> <em>c</em> <strong>some </strong><em>c</em>.<em>item</em> &gt; 0<em> </em><strong>end</strong></span> </p>
<p>Such expressions could appear, for example, in a class invariant, but they may be useful in many different contexts. </p>
<p>In some cases, a <span style="color: #0000ff;"><strong>from</strong></span> clause is useful, as in </p>
<p><span style="color: #0000ff;"><strong>        across </strong><em>s</em> <strong>as</strong> <em>c</em> <strong>from</strong> <em>sum</em> := 0  <strong>loop </strong><em>sum </em>:=<em> sum</em> +<em> c.index </em>∗<em> c.item</em> <strong>end</strong><br />
                &#8212; Computes Σ <em>i </em>*<em> s </em>[<em>i</em>]</span> </p>
<p>The original form of loop in Eiffel is more explicit, and remains available; you can achieve the equivalent of the last example, on a suitable structure, as </p>
<div id="attachment_1002" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-1002" title="list2" src="http://bertrandmeyer.com/wp-content/upLoads/list2-300x169.jpg" alt="A list and a cursor" width="300" height="169" /><p class="wp-caption-text">A list and a cursor</p></div>
<p>       <span style="color: #0000ff;"><strong>from</strong><br />
                <em>sum</em> := 0 ; <em>s</em>.<em>start</em><br />
        <strong>until</strong><br />
                <em>s</em>.<em>after</em><br />
        <strong>loop</strong><br />
                <em>sum </em>:=<em> sum</em> +<em> s.index </em>∗<em> s.item<br />
                s.forth</em><em><br />
</em>        <strong>end</strong></span> </p>
<p>which directly manipulates a cursor through <span style="color: #0000ff;"><em>s</em></span>, using <span style="color: #0000ff;"><em>start</em></span> to move it to the beginning, <span style="color: #0000ff;"><em>forth</em></span> to advance it, and <span style="color: #0000ff;"><em>after</em></span> to test if it is past the last element. The forms with <span style="color: #0000ff;"><strong>across</strong></span> achieve the same purpose in a more concise manner. More important than concision is abstraction: you do not need to worry about manipulating the cursor through <span style="color: #0000ff;"><em>start</em></span>, <span style="color: #0000ff;"><em>forth</em></span> and <span style="color: #0000ff;"><em>after</em></span>. Under the hood, however, the effect is the same. More precisely, it is the same as in a loop of the form </p>
<p>       <span style="color: #0000ff;"><strong>from</strong><br />
                <em>sum</em> := 0 ; <em>c</em>.<em>start</em><br />
        <strong>until</strong><br />
                <em>c</em>.<em>after</em><br />
        <strong>loop</strong><br />
                <em>sum </em>:=<em> sum</em> +<em> c.index </em>∗<em> c.item<br />
                c.forth</em><em><br />
</em>        <strong>end</strong></span> </p>
<p>where<em> <span style="color: #0000ff;">c</span></em> is a cursor object associated with the loop. The advantage of using a cursor is clear: rather than keeping the state of the iteration in the object itself, you make it external, part of a cursor object that, so to speak, looks at the list. This means in particular that many traversals can be active on the same structure at the same time; with an internal cursor, they would mess up with each other, unless you manually took the trouble to save and restore cursor positions. With an external cursor, each traversal has its own cursor object, and so does not interfere with other traversals — at least as long as they don&#8217;t change the structure (I&#8217;ll come back to that point). </p>
<p>With the <span style="color: #0000ff;"><strong>across</strong></span> variant, you automatically use a cursor; you do not have to declare or create it: it simply comes as a result of the “<span style="color: #0000ff;"><strong>as</strong> <em>c</em></span>” part of the construct, which introduces <span style="color: #0000ff;"><em>c</em></span> as the cursor. </p>
<p>On what structures can you perform such iterations? There is no limitation; you simply need a type based on a class that inherits, directly or indirectly, from the library class <span style="color: #0000ff;"><em>ITERABLE</em></span>. All relevant classes from the EiffelBase library have been updated to provide this inheritance, so that you can apply the <span style="color: #0000ff;"><strong>across</strong></span> scheme to lists of all kinds, hash tables, arrays, intervals etc. </p>
<p>One of these structures is the integer interval. The notation  <span style="color: #0000ff;"><em>m</em> |..| <em>n</em></span>, for integers <span style="color: #0000ff;"><em>m</em></span> and <span style="color: #0000ff;"><em>n</em></span>, denotes the corresponding integer interval. (This is not a special language notation, simply an operator, <span style="color: #0000ff;">|..|</span>, defined with the general operator mechanism as an alias for the feature <span style="color: #0000ff;"><em>interval</em></span> of <span style="color: #0000ff;"><em>INTEGER</em></span> classes.) To iterate on such an interval, use the same form as in the examples above: </p>
<p><span style="color: #0000ff;"><strong>        across</strong> <em>m</em> |..| <em>n<strong> </strong></em> <strong>as</strong> <em>c</em> <strong>from</strong> <em>sum</em> := 0  <strong>loop </strong><em>sum </em>:=<em> sum</em> +<em> a </em>[<em>c.item</em>] <strong>end</strong><br />
                &#8212; Computes Σ <em>a </em>[<em>i</em>], for<em> i</em> ranging from <em>m</em> to <em>n</em>, for an array (or other structure) <em>a</em>. </span></p>
<p>The key feature in <span style="color: #0000ff;"><em>ITERABLE</em></span> is <span style="color: #0000ff;"><em>new_cursor</em></span>, which returns a freshly created cursor object associated with the current structure. By default it is an <span style="color: #0000ff;"><em>ITERATION_CURSOR</em></span>, the most general cursor type, but every descendant of <span style="color: #0000ff;"><em>ITERABLE </em></span>can redefine the result type to something more specific to the current structure. Using a cursor — <span style="color: #0000ff;"><em>c</em></span> in the above examples —, rather than manipulating the structure<em> s</em> directly, provides considerable flexibility thanks to the property that <span style="color: #0000ff;"><em>ITERATION_CURSOR </em></span>itself inherits from <span style="color: #0000ff;"><em>ITERABLE </em></span>  and hence has all the iteration mechanisms. For example you may write </p>
<p>        <span style="color: #0000ff;"><strong>across </strong><em>s.new_cursor.reversed</em> <strong>as</strong> <em>c</em> <strong>loop </strong><em>print </em>(<em>item</em>) <strong>end</strong></span> </p>
<p>to print elements in reverse order. (Using Eiffel&#8217;s operator  mechanism, you may write <span style="color: #0000ff;"><em>–</em></span><span style="color: #0000ff;"> <em>s</em>.<em>new_cursor</em></span>, with a minus operator, as a synonym for<span style="color: #0000ff;"> <em>new_cursor.reversed</em></span>.) The function <span style="color: #0000ff;"><em>reversed</em></span> gives you a new cursor on the same target structure, enabling you to iterate backwards. Or you can use </p>
<p><span style="color: #0000ff;"><strong>        across </strong><em>s.new_cursor</em> + 3 <strong>as</strong> <em>c</em> <strong>loop </strong><em>print </em>(<em>item</em>) <strong>end</strong></span> </p>
<p>(using <span style="color: #0000ff;"><em>s.new_cursor.incremented </em>(3)</span> rather than <span style="color: #0000ff;"><em>s.new_cursor</em> + 3</span> if you are not too keen on operator syntax) to iterate over every third item. A number of other possibilities are available in the cursor classes. </p>
<p>A high-level iteration mechanism is only safe if you have the guarantee that the structure remains intact throughout the iteration. Assume you are iterating through a structure </p>
<p>        <span style="color: #0000ff;"><strong>across</strong> <em>s </em>  <strong>as</strong> <em>c</em> <strong>loop </strong><em>some_routine</em> <strong>end</strong></span> </p>
<p>and <span style="color: #0000ff;"><em>some_routine</em></span> changes the structure <span style="color: #0000ff;"><em>s</em></span>: the whole process could be messed up. Thanks to Design by Contract mechanisms, the library protects you against such mistakes. Features such as <span style="color: #0000ff;"><em>item</em></span> and <span style="color: #0000ff;"><em>index</em></span>, accessing properties of the structure during the iteration, are equipped with a precondition clause </p>
<p>        <span style="color: #0000ff;"><strong>require</strong><br />
               <em> is_valid</em></span> </p>
<p>and every operation that changes the structure sets <span style="color: #0000ff;"><em>is_valid </em></span>to false. So as soon as any change happens, you cannot continue the iteration; all you can do is restart a new one; the command <span style="color: #0000ff;"><em>start</em></span>, used internally to start the operation, does not have the above precondition. </p>
<p>Sometimes, of course, you do want to change a structure while traversing it; for example you may want to add an element just to the right of the iteration position. If you know what you are doing that&#8217;s fine. (Let me correct this: if you know what you are doing, express it through precise contracts, and you&#8217;ll be fine.) But then you should not use the abstract forms of the loop, <span style="color: #0000ff;"><strong>across</strong>&#8230;</span>; you should control the iteration itself through the basic form <span style="color: #0000ff;"><strong>from</strong> &#8230; <strong>until</strong> &#8230;</span> with explicit cursor manipulation, protected by appropriate contracts. </p>
<p>The two styles, by the way, are not distinct constructs. Eiffel has always had only one form of loop and this continues the case. The <span style="color: #0000ff;"><strong>across</strong></span> forms are simply new possibilities added to the classical loop construct, with obvious constraints stating for example that you may not have both a <span style="color: #0000ff;"><strong>some</strong></span> or <span style="color: #0000ff;"><strong>all</strong></span> form and an explicit  <span style="color: #0000ff;"><strong>loop</strong></span> body.  In particular, an <span style="color: #0000ff;"><strong>across</strong></span> loop can still have an invariant clause , specifying the correctness properties of the loop, as in </p>
<p><span style="color: #0000ff;"><strong>        across </strong><em>s</em> <strong>as</strong> <em>c</em> <strong>from</strong> <em>sum</em> := 0  <strong>invariant </strong><em>sum = sigma </em>(<em>s, index</em>) <em> </em><strong>loop </strong><em>sum </em>:=<em> sum</em> +<em> c.index </em>∗<em> c.item</em> <strong>end</strong></span> </p>
<p>EiffelStudio 6.5 already included the language update; the library update (not yet including the <span style="color: #0000ff;"><em>is_valid</em></span> preconditions for data structure classes) will be made available this week. </p>
<p>These new mechanisms should increase the level of abstraction and the reliability of loops, a fundamental element of  almost all programs.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/4m3Cib3PImE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/</feedburner:origLink></item>
		<item>
		<title>The theory and calculus of aliasing</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/BuHA5QXPFVM/</link>
		<comments>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:38:51 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Software verification]]></category>
		<category><![CDATA[Aliasing]]></category>
		<category><![CDATA[Frame problem]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Proofs]]></category>
		<category><![CDATA[Verification]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=935</guid>
		<description><![CDATA[Thus we are permitted to prove that the unqualified call creates certain aliasings, on the assumption that it starts in its own alias environment but has access to the caller’s environment through the inverted variable, and then to assert categorically that the qualified call has the same aliasings transposed back to the original environment. This change of environment to prove the unqualified property, followed by a change back to the original environment to prove the qualified property, explains well the aura of magic which attends a programmer's first introduction to object-oriented programming.]]></description>
			<content:encoded><![CDATA[<p>In a previous post I briefly mentioned some work that I am doing on aliasing. There is a draft paper [1], describing the theory, calculus, graphical notation (alias diagrams) and implementation. Here I will try to give an idea of what it&#8217;s about, with the hope that you will be intrigued enough to read the article. Even before you read it you might try out the implementation[2], a simple interactive interface with all the examples of the article .</p>
<p>What the article does not describe in detail — that will be for a companion paper— is how the calculus will be used as part of a general framework for developing object-oriented software proved correct from the start, the focus of our overall  “<strong>Trusted Components</strong>” project&#8217; [3]. Let me simply state that the computation of aliases is the key missing step in the effort to make correctness proofs a standard part of software development. This is a strong claim which requires some elaboration, but not here.</p>
<p>The alias calculus asks a simple question: given two expressions representing references (pointers),  can their values, at a given point in the program, ever reference the same object during execution?</p>
<p>As an example  application, consider two linked lists <span style="color: #0000ff;"><em>x</em></span> and <span style="color: #0000ff;"><em>y</em></span>, which can be manipulated with operations such as <span style="color: #0000ff;"><em>extend</em></span>, which creates a new cell and adds it at the end of the list:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/lists.jpg"><img class="aligncenter size-medium wp-image-985" title="lists" src="http://bertrandmeyer.com/wp-content/upLoads/lists-300x148.jpg" alt="lists" width="400" /></a></p>
<p> The calculus makes it possible to prove that if  <span style="color: #0000ff;"><em>x</em></span> and <span style="color: #0000ff;"><em>y </em></span>are not aliased to each other, then none of the pointers in any of the cells in either of the lists can point to  (be aliased to) any cell of  the other. If  <span style="color: #0000ff;"><em>x</em></span> is initially aliased to <span style="color: #0000ff;"><em>y</em></span>, the property no longer holds. You can run the proof (examples 18 and 19) in the downloadable implementation.</p>
<p>The calculus gives a set of rules, each applying to a particular construct of the language, and listed below.</p>
<p>The rule for a construct <span style="color: #0000ff;"><em>p</em></span> is of the form<br />
<span style="color: #0000ff;"><span style="color: #0000ff;"><br />
<em>          a </em>|=<em> </em><em>p</em><strong>      </strong>=   <em>a’</em></span></span> </p>
<p>where <span style="color: #0000ff;"><em>a</em></span> and <span style="color: #0000ff;"><em>a’</em></span> are alias relations; this states that executing <span style="color: #0000ff;"><em>p</em></span>  in a state where the alias relation is <span style="color: #0000ff;"><em>a </em></span>will yield the alias relation <span style="color: #0000ff;"><em>a&#8217;</em></span> in the resulting state. An alias relation is a symmetric, irreflexive relation; it indicates which expressions and variables can be aliased to each other in a given state.</p>
<p>The constructs <span style="color: #0000ff;"><em>p</em></span> considered in the discussion are those of a simplified programming language; a modern object-oriented language such as Eiffel can easily be translated into that language. Some precision will be lost in the process, meaning that the alias calculus (itself precise) can find aliases that would not exist in the original program; if this prevents proofs of desired properties, the <span style="color: #0000ff;"><strong>cut</strong><em> </em></span>instruction discussed below serves to correct the problem.</p>
<p>The first rule is for the forget instruction (Eiffel: <span style="color: #0000ff;"><em>x</em> := <strong>Void</strong></span>):<br />
<span style="color: #0000ff;"><br />
<em>          a </em>|=<em> </em><strong>forget</strong> <em>x</em><strong>       </strong>=   <em>a \- </em>{<em>x</em>}</span></p>
<p>where the <span style="color: #0000ff;">\-</span> operator removes from a relation all the elements belonging to a given set <span style="color: #0000ff;"><em>A</em></span>. In the case of object-oriented programming, with multidot expressions <span style="color: #0000ff;"><em>x.y.z</em></span>, the application of this rule must remove all elements whose <em>first component</em>, here <span style="color: #0000ff;"><em>x</em></span>, belongs to <span style="color: #0000ff;"><em>A</em></span>.</p>
<p>The rule for creation is the same as for <span style="color: #0000ff;"><strong>forget</strong></span>:</p>
<p>         <span style="color: #0000ff;">a |=<em> </em><strong>create</strong> <em>x</em><strong>          </strong>=   <em>a \- </em>{<em>x</em>}</span></p>
<p>The two instructions have different semantics, but the same effect on aliasing.</p>
<p>The calculus has a rule for the <span style="color: #0000ff;"><strong>cut</strong></span> instruction, which removes the connection between two expressions:</p>
<p><span style="color: #0000ff;">        a |=<em> </em><strong>cut </strong><em>x, y</em><strong>       </strong>=   <em>a — &lt;</em><em>x, y&gt;</em></span></p>
<p>where <span style="color: #0000ff;">—</span> is set difference and <span style="color: #0000ff;">&lt;<em>x</em>, <em>y</em>&gt;</span> includes the pairs <span style="color: #0000ff;">[<em>x</em>, <em>y</em>]</span> and <span style="color: #0000ff;">[<em>y</em>, <em>x</em>]</span> (this is a special case of a general notation defined in the article, using the overline symbol). The <span style="color: #0000ff;"><strong>cut </strong><em>  </em></span>instruction corresponds, in Eiffel, to <span style="color: #0000ff;"><strong>cut </strong><em>  x </em>/=<em> y </em><strong>end</strong></span>:  a hint given to the alias calculus (and proved through some other means, such as standard axiomatic semantics) that some references will not be aliased.</p>
<p>The rule for assignment is</p>
<p>      <span style="color: #0000ff;"><em>a</em> |= (<em>x</em> := <em>y</em>)      =   <strong>given</strong>  <em>b</em> = <em>a</em> \- {x}   <strong>then </strong>  &lt;<em>b</em> <span style="font-family: Symbol;">È </span>{<em>x</em>} x (<em>b</em> / <em>y</em>)}&gt;<strong> end</strong></span></p>
<p>where<em> </em><span style="color: #0000ff;"><em>b</em> /<em>y</em></span> (“quotient”), similar to an equivalence class in an equivalence relation, is the set of elements aliased to <span style="color: #0000ff;"><em>y</em></span> in <span style="color: #0000ff;"><em>b</em></span>, plus <span style="color: #0000ff;"><em>y</em></span> itself (remember that the relation is irreflexive). This rule works well for object-oriented programming thanks to the definition of the <span style="color: #0000ff;">\-</span> operator: in <span style="color: #0000ff;"><em>x</em> := <em>x.y</em></span>, we must not alias <span style="color: #0000ff;"><em>x</em></span> to <span style="color: #0000ff;"><em>x.y</em></span>, although we must alias it to any <span style="color: #0000ff;"><em>z</em></span> that was aliased to <span style="color: #0000ff;"><em>x.y</em></span>.</p>
<p>The paper introduces a graphical notation, <strong>alias diagrams</strong>, which makes it possible to reason effectively about such situations. Here for example is a diagram illustrating the last comment:</p>
<div id="attachment_945" class="wp-caption aligncenter" style="width: 310px"><a href="http://bertrandmeyer.com/wp-content/upLoads/multidot.jpg"><img class="size-medium wp-image-945" title="multidot" src="http://bertrandmeyer.com/wp-content/upLoads/multidot-300x126.jpg" alt="Alias diagram for a multidot assignment" width="300" height="126" /></a><p class="wp-caption-text">Alias diagram for a multidot assignment</p></div>
<p>(The grayed elements are for explanation and not part of the final alias relation.)</p>
<p>For the compound instruction, the rule is:</p>
<p>           <span style="color: #0000ff;"><em>a</em> |= (<em>p</em> ;  <em>q</em>)      =   (<em>a </em>|=<em> p) |= q</em>)</span></p>
<p>For the conditional instruction, we get:</p>
<p>           <span style="color: #0000ff;"><em>a</em> |= (<strong>then</strong> <em>p</em> <strong>else</strong>  <em>q </em><strong>end</strong>)      =   (<em>a </em>|=<em> p) </em><span style="font-family: Symbol;">È </span><em> (a |= q</em>)</span></p>
<p>Note the form of the instruction: the alias calculus ignores information from the <span style="color: #0000ff;"><strong>then </strong></span>clause present in the source language. The union operator is the reason why  alias relations,  irreflexive and symmetric, are not  necessarily transitive.</p>
<p>The loop instruction, which also ignores the test (exit or continuation condition), is governed by the following rule:</p>
<p>           <span style="color: #0000ff;"><em>a</em> |= (<strong>loop </strong><em>p</em> <strong>end</strong>)       =   </span><em><span style="color: #0000ff;"><span style="color: #0000ff;">t<sub>N</sub></span></span></em></p>
<p>where span style=&#8221;color: #0000ff;&#8221;&gt;<em>N</em> is the first value such that <span style="color: #0000ff; "><span style="color: #0000ff; "><em>t<sub>N </sub></em></span></span><span style="color: #0000ff;">=<em> t<span><sub>N+1</sub></span></em></span> (in other words, <span style="color: #0000ff;"><span style="color: #0000ff; "><em>t<sub>N </sub></em></span></span>is the fixpoint) in the following sequence:</p>
<p>           <span style="color: #0000ff; "> <span style="color: #0000ff; "><span style="color: #0000ff; "><em>t</em><sub>0</sub></span></span>          =    </span><em><span style="color: #0000ff; "><span style="color: #0000ff;">a<br />
</span></span></em>           <span style="color: #0000ff; "><span style="color: #0000ff; "><em>t</em><sub><em>n</em>+1<em>       </em></sub></span></span><span style="color: #0000ff;">=   (<em><span style="color: #0000ff; "><span style="color: #0000ff;">t<sub>n </sub></span></span></em><span style="font-family: Symbol;">È (</span><em><span style="color: #0000ff; "><span style="color: #0000ff; ">t<sub>n</sub></span></span></em> |= <em>p</em>))     </span></p>
<p>The existence of a fixpoint and the correctness of this formula to compute it are the result of a theorem in the paper, the “<strong>loop aliasing theorem</strong>”; the proof is surprisingly elaborate (maybe I missed a simpler one).</p>
<p>For procedures, the rule is</p>
<p><span style="color: #0000ff;"><em>         a</em> |= <strong>call </strong><em>p</em>        =   <em>a </em>|= <em>p.body</em></span></p>
<p>where <span style="color: #0000ff;"><em>p.body</em></span> is the body of the procedure. In the presence of recursion, this gives rise to a set of equations, whose solution is the fixpoint; again a theorem is needed to demonstrate that the fixpoint exists. The implementation directly applies fixpoint computation (see examples 11 to 13 in the paper and implementation).</p>
<p>The calculus does not directly consider routine arguments but treats them as attributes of the corresponding class; so a call is considered to start with assignments of the form <span style="color: #0000ff;"><em>f</em> : = <em>a</em></span> for every pair of formal and actual arguments <span style="color: #0000ff;"><em>f</em></span> and <span style="color: #0000ff;"><em>a</em></span>. Like the omission of conditions in loops and conditionals, this is a source of possible imprecision in translating from an actual programming language into the calculus, since values passed to recursive activations of the same routine will be conflated.</p>
<p>Particularly interesting is the last rule, which generalizes the previous one to qualified calls of the form <span style="color: #0000ff;"><em>x</em>. <em>f</em> (&#8230;)</span>  as they exist in object-oriented programming. The rule involves the new notion of<strong> inverse variable</strong>, written <span style="color: #0000ff;"><em>x&#8217;</em></span> where <span style="color: #0000ff;"><em>x</em></span> is a variable. Laws of the calculus (with <span style="color: #0000ff;"><strong>Current</strong></span> denoting the current object, one of the fundamental notions of object-oriented programming) are</p>
<p>        <span style="color: #0000ff;"><strong>Current</strong>.<em>x</em>            = <em>x</em>   <br />
        x.<strong>Current</strong>            = <em>x<br />
</em>        <em>x</em>.<em>x&#8217;</em>                      = <strong>Current</strong><br />
        <em>x&#8217;</em>.<em>x</em>                      = <strong>Current</strong></span></p>
<p>In other words, <span style="color: #0000ff;"><strong>Current</strong></span> plays the role of zero element for the dot operator, and variable inversion is the inverse operation. In a call <span style="color: #0000ff;"><em>x.f</em></span>, where <span style="color: #0000ff;"><em>x</em></span> denotes the supplier object (the target of the call), the inverse variable provides a back reference to the client object (the caller), indispensable to interpret references in the original context. This property is reflected by the qualified client rule, which uses  the auxiliary operator <span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;"><span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;"><span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;">n </span></span></span>(where <span style="color: #0000ff;">x <span style="color: #0000ff;"><span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;"><span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;"><span style="font-family: Wingdings; color: #0000ff; font-size: xx-small;">n </span></span></span><em>a</em></span></span>, for a relation <span style="color: #0000ff;"><em>a </em></span>and a variable<span style="color: #0000ff;"><em> x</em></span>, is the set of pairs <span style="color: #0000ff;">[<em>x.u</em>, <em>y.v</em>]</span> such that the pair <span style="color: #0000ff;">[<em>u</em>, <em>v</em>]</span> is in <span style="color: #0000ff;"><em>a</em></span>). The rule is:</p>
<p><span style="color: #0000ff;">         <em>a</em> |= <strong>call</strong> <em>x</em>.<em>r       </em>=   <em>x </em><span style="font-family: Wingdings; font-size: xx-small;">n </span>((<em>x&#8217;</em> <span style="font-family: Wingdings; font-size: xx-small;">n </span><em>a</em> ) |= <strong>call</strong> <em>r</em>)</span></p>
<p>You need to read the article for the full explanation, but let me offer the following quote from the corresponding section (maybe you will note a familiar turn of phrase):</p>
<blockquote><p><em>Thus we are permitted to prove that the unqualified call creates certain aliasings, on the assumption that it starts in its own alias environment but has access to the caller’s environment through the inverted variable, and then to assert categorically that the qualified call has the same aliasings transposed back to the original environment. This change of environment to prove the unqualified property, followed by a change back to the original environment to prove the qualified property, explains well the aura of magic which attends a programmer&#8217;s first introduction to object-oriented programming.</em></p></blockquote>
<p>I hope you will enjoy the calculus and try the examples in the implementation. It is fun to apply, and there seems to be no end to the potential applications.</p>
<h4>Reference</h4>
<p>[1] Bertrand Meyer: <em>The Theory and Calculus of Aliasing</em>, draft paper, first published 12 January 2009 (revised 21 January 2010), available <a href="http://se.ethz.ch/~meyer/publications/aliasing/alias.pdf" target="blog_illustrations">here</a> and also at <a target="blog_illustrations" href="http://arxiv.org/ftp/arxiv/papers/1001/1001.1610.pdf">arxiv.org</a>.<br />
[2] Implementation (interactive version to try all the examples of the paper): downloadable Windows executable <a href="http://se.ethz.ch/~meyer/down/alias.zip" target="blog_illustrations">here</a>.<br />
[3] Bertrand Meyer: The Grand Challenge of Trusted Components, in 2003 International Conference on Software Engineering, available <a target="blog_illustrations" href="http://se.ethz.ch/~meyer/publications/ieee/trusted-icse.pdf">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/BuHA5QXPFVM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/</feedburner:origLink></item>
		<item>
		<title>Just another day at the office</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/KlNGDgWE804/</link>
		<comments>http://bertrandmeyer.com/2010/01/15/just-another-day-at-the-office/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 01:02:11 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[EiffelStudio]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Postcondition]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=899</guid>
		<description><![CDATA[In the past few weeks I wrote a program to compute the aliases of variables and expressions in an object-oriented program (based on a new theory [1]).
For one of the data structures, I needed a specific notion of equality, so I did the standard thing in Eiffel: redefine the is_equal function inherited from the top [...]]]></description>
			<content:encoded><![CDATA[<p>In the past few weeks I wrote a program to compute the aliases of variables and expressions in an object-oriented program (based on a new theory [1]).</p>
<p>For one of the data structures, I needed a specific notion of equality, so I did the standard thing in Eiffel: redefine the <span style="color: #0000ff;"><em>is_equal</em></span> function inherited from the top class <span style="color: #0000ff;"><em>ANY</em></span>, to implement the desired variant.</p>
<p style="color: #000000;">The first time I ran the result, I got a postcondition violation. The violated postcondition clauses was not even any that I wrote: it was an original postcondition of <span style="color: #0000ff;"><em>is_equal </em>(<em>other</em>:<em> </em><strong>like</strong><em> </em><strong>Current</strong>)<em> </em></span> in <span style="color: #0000ff;"><em>ANY</em></span>, which my redefinition inherited as per the rules of Design by Contract; it reads</p>
<blockquote>
<p style="color: #0000ff;">symmetric: <strong>Result</strong> <strong>implies</strong> <em>other</em> ~ <strong>Current</strong></p>
</blockquote>
<p>meaning: equality is symmetric, so if <strong>Result</strong> is true, i.e. the Current object is equal to other, then other must also be equal to Current. (<strong>~</strong> is object equality, which applies the local version is <em>is_equal</em>).  What was I doing wrong? The structure is a list, so the code iterates on both the current list and the other list:</p>
<blockquote style="color: #0000ff;"><p><strong>from</strong><br />
    <em>start</em> ; <em>other</em>.<em>start</em> ; <strong>Result</strong> := <strong>True</strong><br />
<strong>until</strong> (<strong>not</strong> <strong>Result</strong>) <strong>or</strong> <em>after</em> <strong>loop</strong><br />
        <strong>if</strong> <em>other</em>.<em>after</em> <strong>then</strong> <strong>Result</strong> := <strong>False</strong> <strong>else</strong><br />
              <strong>Result</strong> := (<em>item</em> ~ <em>other</em>.<em>item</em>)<br />
              <em>forth</em> ; <em>other</em>.<em>forth</em><br />
        <strong>end<br />
</strong><strong>end</strong></p></blockquote>
<p>Simple enough: at each position check whether the <span style="color: #0000ff;"><em>item</em></span> in the current list is equal to the <span style="color: #0000ff;"><em>item</em></span> in the <span style="color: #0000ff;"><em>other</em></span> list, and if so move <span style="color: #0000ff;"><em>forth</em></span> in both the current list and the <span style="color: #0000ff;"><em>other</em></span> one; stop whenever we find two unequal elements, or we exhaust either list as told by <span style="color: #0000ff;"><em>after</em></span> list. (Since<span style="color: #0000ff;"><em> is_equal</em></span> is a function and not produce any side effect, the actual code saves the cursors before the iteration and restores them afterwards. Thanks to Ian Warrington for asking about this point in a comment to this post. The new <span style="color: #0000ff;"><strong>across</strong></span> loop variant described in  two <a href="http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/">later</a> <a href="http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/" target="_blank">postings </a>uses external cursors and manages them automatically, so this business of maintaining the cursor manually goes away.)</p>
<p>The problem is that with this algorithm it is possible to return True if the first list was exhausted but not the second, so that the first list is a subset of the other rather than identical. The correction is immediate: add</p>
<blockquote><p><span style="color: #0000ff;"><strong>Result and </strong><em>other_list</em><strong>.</strong><em>after</em></span></p></blockquote>
<p>after the loop; alternatively, enclose the loop in a conditional so that it is only executed if <span style="color: #0000ff;"><em>count</em> = <em>other.count</em></span> (this solution is  better since it saves much computation in cases of lists of different sizes, which cannot be equal).</p>
<p>The lesson (other than that I need to be more careful) is that the error was caught immediately, thanks to a postcondition violation — and one that I did not even have to write. Just another day at the office; and let us shed a tear for the poor folks who still program without this kind of capability in their language and development environment.</p>
<h4>Reference</h4>
<p>[1] Bertrand Meyer: <em>The Theory and Calculus of Aliasing</em>, draft paper, available <a href="http://se.ethz.ch/~meyer/publications/aliasing/alias.pdf" target="blog_illustrations">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/KlNGDgWE804" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2010/01/15/just-another-day-at-the-office/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2010/01/15/just-another-day-at-the-office/</feedburner:origLink></item>
		<item>
		<title>Touch of Class book page available</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/b8giB0zDZlk/</link>
		<comments>http://bertrandmeyer.com/2009/12/19/touch-of-class-book-page-available/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 16:04:31 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Touch of Class]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=895</guid>
		<description><![CDATA[The book page for Touch of Class (my introductory programming textbook), announced in the book, is finally available, courtesy Vladimir Tochilin:
touch.ethz.ch
It includes some book extracts (prefaces, table of contents, an entire sample chapter, for which I chose the Recursion chapter), a list of known errata and a wiki page to report new errata, a discussion [...]]]></description>
			<content:encoded><![CDATA[<p>The book page for Touch of Class (my introductory programming textbook), announced in the book, is finally available, courtesy Vladimir Tochilin:</p>
<blockquote><p><a href="http://touch.ethz.ch">touch.ethz.ch</a></p></blockquote>
<p>It includes some book extracts (prefaces, table of contents, an entire sample chapter, for which I chose the Recursion chapter), a list of known errata and a wiki page to report new errata, a discussion forum, links to the full set of slides (PowerPoint, PDF) for the associated course, video recordings of that course at ETH, and a special &#8220;instructor&#8217;s corner&#8221; for those having adopted the textbook for their courses.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/b8giB0zDZlk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/12/19/touch-of-class-book-page-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/12/19/touch-of-class-book-page-available/</feedburner:origLink></item>
		<item>
		<title>Dwelling on the point</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/DH0rzwL8g-c/</link>
		<comments>http://bertrandmeyer.com/2009/11/29/dwelling-on-the-point/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 12:14:23 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[General technology]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Software process]]></category>
		<category><![CDATA[Software verification]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=869</guid>
		<description><![CDATA[Once again, and we are not learning!
La Repubblica of last Thursday [1] and other Italian newspapers have reported on a &#8220;computer&#8221; error that temporarily brought thousands of accounts at the national postal service bank into the red. It is a software error, due to a misplacement of the decimal points in some transactions.
As usual the technical [...]]]></description>
			<content:encoded><![CDATA[<p>Once again, and we are not learning!</p>
<p><em>La Repubblica</em> of last Thursday [1] and other Italian newspapers have reported on a &ldquo;computer&rdquo; error that temporarily brought thousands of accounts at the national postal service bank into the red. It is a software error, due to a misplacement of the decimal points in some transactions.</p>
<p>As usual the technical details are hazy; La Repubblica writes that:</p>
<blockquote><p>&ldquo;<em>Because of a software change that did not succeed, the computer system did not always read the decimal point during transactions</em>&rdquo;.</p></blockquote>
<p>As a result, it could for example happen that a 15.00-euro withdrawal was understood as 1500 euros.<br />
I have no idea what &ldquo;<em>reading the decimal point</em> &rdquo; means. (There is no mention of OCR, and the affected transactions seem purely electronic.) Only some of the 12 million checking or &ldquo;Postamat&rdquo; accounts were affected; the article cites a number of customers who could not withdraw money from ATMs because the system wrongly treated their accounts as over-drawn. It says that this was the only damage and that the postal service will send a letter of apology. The account leaves many questions unanswered, for example whether the error could actually have <em>favored </em>some customers, by allowing them to withdraw money they did not have, and if so what will happen.</p>
<p>The most important unanswered question is the usual one: <em>what </em>was the software error? As usual, we will probably never know. The news items will soon be forgotten, the postal service will somehow fix its code,  life will go on. Nothing will be learned; the next time around similar causes will produce similar effects.</p>
<p>I criticized this lackadaisical attitude in an earlier column [2] and have to hammer its conclusion again:<strong> any organization using public money should be required, when it encounters a significant software malfunction, to let experts investigate the incident in depth and report the results publicly</strong>. As long as we keep forgetting our errors we will keep repeating them. Where would airline safety be in the absence of thorough post-accident reports? That a software error did not kill anyone is not a reason to ignore it. Whether it is the Italian post messing up, a US agency&#8217;s space vehicle crashing on the moon or any other software fault causing systems to fail, it is not enough to fix the symptoms: we must have a professional report and draw the lessons for the future.</p>
<h4>Reference</h4>
<p>[1] Luisa Grion: <em>Poste in tilt per una virgola — conti gonfiati, stop ai prelievi</em>. In <em>La Repubblica</em>, 26 November 2009, page 18 of the print version. (At the time of writing it does not appear at <a href="http://www.repubblica.it" target="blog_illustrations">repubblica.it</a>,  but see  the TV segment also titled “Poste in tilt per una virgola” on Primocanale Web TV <a href="http://www.primocanale.it/viewvideo.php?id=28549">here</a>, and other press articles e.g. in Il Tempo <a href="http://iltempo.ilsole24ore.com/interni_esteri/2009/11/25/1097433-poste_salta_virgola.shtml" target="blog_illustrations">here</a>.)</p>
<p>[2] On this blog: <a href="http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/"><em>The one sure way to advance software engineering</em></a> (post of 21 August 2009).</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/DH0rzwL8g-c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/11/29/dwelling-on-the-point/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/11/29/dwelling-on-the-point/</feedburner:origLink></item>
		<item>
		<title>The Case of the Handsome Couple: answer</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/nOJcqEisTFU/</link>
		<comments>http://bertrandmeyer.com/2009/10/25/the-case-of-the-handsome-couple-answer/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 12:46:33 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Puzzle]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=825</guid>
		<description><![CDATA[As you walk up to the Hradčany and in the evening/Listen to Czech songs sung in taverns]]></description>
			<content:encoded><![CDATA[<p>Alina was, as noted, on Pařížská (Paris avenue). Heeding the unknown voice, she started walking clockwise; she did not hesitate as to what this means since, conveniently, she was standing right next to a clock:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/clock-p.JPG"><img class="aligncenter size-large wp-image-828" title="Public clock on Pařížská" src="http://bertrandmeyer.com/wp-content/upLoads/clock-p-1024x768.jpg" alt="Public clock on Pařížská" width="549" height="411" /></a></p>
<p>Luca was standing on the other side of the block. He too saw a clock:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/hebrew_clock.jpg"><img class="aligncenter size-large wp-image-830" title="Hebrew clock" src="http://bertrandmeyer.com/wp-content/upLoads/hebrew_clock-1024x673.jpg" alt="Hebrew clock" width="549" /></a></p>
<p>Pařížská was built in the late nineteenth century, as Prague&#8217;s answer to the Paris Champs-Élysées; it cut through Josefov, the old Prague ghetto. Most of the old Josefov was destroyed at the time; among the buildings that survived were six synagogues, the famous cemetery, and the “Jewish Town Hall”. This last building had been reconstructed in the 18th century with a fancy clock using Hebrew letters and, as an homage to the right-to-left reading of Hebrew script, running in the opposite of the direction of ordinary clocks. The clock figures in Guillaume Apollinaire&#8217;s <em>Alcools</em>:</p>
<ul>
<font size="2.5em"><em>Tu ressembles au Lazare affolé par le jour<br />
Les aiguilles de l&#8217;horloge du quartier juif vont à rebours<br />
Et tu recules aussi dans ta vie lentement<br />
En montant au Hradchin et le soir en écoutant<br />
Dans les tavernes chanter des chansons tchèques</em>
</ul>
<ul>
<ul>
<ul>(You look like Lazarus scared by daylight<br />
The hands of the Jewish quarter clock go backwards<br />
And you too step back slowly through your life<br />
As you walk up to the Hradčany and in the evening<br />
Listen to Czech songs sung in taverns)</font>
</ul>
</ul>
</ul>
<p>Luca started walking clockwise, according to the clock next to him; you know the rest.</p>
<p>Normal clocks all go the same way; the backwards clock is no more than a wink and a whim. Had Luca raised his eyes more:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/townhall_clocks.JPG"><img src="http://bertrandmeyer.com/wp-content/upLoads/townhall_clocks-768x1024.jpg" alt="Three clocks on the Jewish Town Hall" title="Three clocks on the Jewish Town Hall" width="549" class="aligncenter size-large wp-image-837" /></a></p>
<p>he would have gone by one of the other, ordinary clocks, going in the same direction as Alina; and we would not have a story.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/nOJcqEisTFU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/10/25/the-case-of-the-handsome-couple-answer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/10/25/the-case-of-the-handsome-couple-answer/</feedburner:origLink></item>
		<item>
		<title>The Case of the Handsome Couple: hints</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/6sVp26YeRp4/</link>
		<comments>http://bertrandmeyer.com/2009/10/24/the-case-of-the-handsome-couple-hints/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 08:53:27 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Puzzle]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=823</guid>
		<description><![CDATA[For the text of the puzzle see this earlier post.
Hints (by popular demand):
(1) Prague
(2) Guillaume Apollinaire
]]></description>
			<content:encoded><![CDATA[<p>For the text of the puzzle see <a href="http://bertrandmeyer.com/2009/10/20/the-handsome-couple/">this earlier post</a>.</p>
<p>Hints (by popular demand):</p>
<p>(1) Prague<br />
(2) Guillaume Apollinaire</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/6sVp26YeRp4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/10/24/the-case-of-the-handsome-couple-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/10/24/the-case-of-the-handsome-couple-hints/</feedburner:origLink></item>
		<item>
		<title>The Case of the Handsome Couple</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/zxzzfndZ24k/</link>
		<comments>http://bertrandmeyer.com/2009/10/20/the-handsome-couple/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 13:09:04 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Puzzle]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=813</guid>
		<description><![CDATA[Yesterday&#8217;s New York Times carries an article by John Tierney about the 95th anniversary of the king of mathematical puzzles, Martin Gardner. The article is so well done that I will not even try a summary, referring you instead directly to it [1]. Just one detail worthy of note:  when he undertook to write a [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday&#8217;s <em>New York Times</em> carries an article by John Tierney about the 95th anniversary of the king of mathematical puzzles, Martin Gardner. The article is so well done that I will not even try a summary, referring you instead directly to it [1]. Just one detail worthy of note:  when he undertook to write a monthly puzzle column for <em>Scientific American</em> at the age of 37, Gardner “<em>had never taken a math course beyond high school. He had struggled with calculus and considered himself poor at solving basic mathematical puzzles, let alone creating them</em>.”</p>
<p>Logical and mathematical puzzles are a great way to keep the mind alert; one of the attractions of going to meetings of IFIP Working Group 2.3 on Programming Methodology[2]  is that members constantly tease each other with puzzles of diverse nature and difficulty; Rustan Leino, the group&#8217;s current secretary, keeps a fascinating collection on one of his Web pages [3].</p>
<p>It would be imprudent to promise anything like a “<em> </em>monthly puzzle” here, but let me at least announce an “occasional series”, which is not too harsh a commitment, and propose the first installment today. This little teaser is definitely original: The Case of the Handsome Couple.</p>
<p>At a dinner, one couple stands out as particularly hansome; both the wife and the husband (Alina and Luca). Conversation turns to the inevitable question: “<em>How did you two meet</em>?”.</p>
<p>“<em><em> </em>Interesting indeed</em>”, says the wife. “<em>It was love at first sight: I was walking and came face to face with Luca;  on the spot, I knew he was the one.</em>”</p>
<p>“<em>Tell us more! Where and how?</em>”</p>
<p>“<em>It was in Prague. I was walking along the </em><em>Pařížská avenue, this kind of Champs-Élysées of Prague, window-shopping at the luxury shops. Then my Blackberry rang; I picked it up. I heard an unknown voice, telling me to start walking clockwise around the block. For some reason I felt compelled to obey it; soon after I came face to face with him. You know the rest.</em>”</p>
<p>The host turns to Luca: “<em><em>How was it for you?</em></em>”</p>
<p>“<em><em>Will you believe me: exactly the same! I was actually, as we later reconstructed, on the other side of that same city block. Suddenly my iPhone rang and I heard that strange voice ordering me to keep walking clockwise around the block. And suddenly I find myself face to face with her! You see the result.</em></em>”</p>
<p>It&#8217;s a normal city block, and they were both faithfully obeying the injunction to walk clockwise, yet met face to face. How was that possible?</p>
<h4>References</h4>
<p>[1] John Tierney: <em>For Decades, Puzzling People With Mathematics</em>, in <em>New York Times</em>, 19 October 2009, available <a href="http://www.nytimes.com/2009/10/20/science/20tier.html?_r=1" target="blog_illustrations">here</a>.</p>
<p>[2] IFIP WG 2.3, Programming Methodology: see the group&#8217;s <a href="http://research.microsoft.com/en-us/um/people/leino/ifip-wg2.3/" target="blog_illustrations">Web page</a>.</p>
<p>[3] Rustan Leino&#8217;s puzzle collection at <a href="https://research.microsoft.com/en-us/um/people/leino/puzzles.html" target="blog_illustrations">research.microsoft.com/en-us/um/people/leino/puzzles.html</a>. (Disclaimer: Rustan says he obtained two puzzles — originally from other sources —through me.)</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/zxzzfndZ24k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/10/20/the-handsome-couple/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/10/20/the-handsome-couple/</feedburner:origLink></item>
		<item>
		<title>Knuth &amp; company</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/JhEOvMvbrrI/</link>
		<comments>http://bertrandmeyer.com/2009/10/19/knuth-companys/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 17:04:53 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Bookstore]]></category>
		<category><![CDATA[Paris]]></category>
		<category><![CDATA[Touch of Class]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=785</guid>
		<description><![CDATA[Remember Stacey&#8217;s in Palo Alto and San Francisco? Only a decade ago these and other technical bookstores were the mecca of the tech industry, where developers would swarm at any time of day to catch up on the latest releases. One well-known Valley entrepreneur even told me she did her hiring there, spotting customers who [...]]]></description>
			<content:encoded><![CDATA[<p>Remember Stacey&#8217;s in Palo Alto and San Francisco? Only a decade ago these and other technical bookstores were the mecca of the tech industry, where developers would swarm at any time of day to catch up on the latest releases. One well-known Valley entrepreneur even told me she did her hiring there, spotting customers who looked like developers and picked the right books.</p>
<p>Times have changed. After all the other branches, Stacey&#8217;s venerable San Francisco&#8217;s store finally closed earlier this year [1], the victim of the bubble&#8217;s burst, of Amazon, and of the crisis. Many others in the US and elsewhere met the same fate.</p>
<p>But wait&#8230; In Gaul, a little village is resisting the onslaught. A couple of streets away from the <em>Shakespeare and company </em>bookstore immortalized by Hemingway, Scott Fitzgerald and so many others, the Paris technical bookstore <em>Le Monde en Tique</em> [3] is a true legend of its own. Le Monde en Tique has, for the past twenty years, carried the best selection of computer and other technology books within a good thousand kilometers. I was there on Oct. 10, after the European Computer Science Summit (more on ECSS soon) for a book signing of <em>Touch of Class</em>:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/books1-1.jpg"><img class="aligncenter size-full wp-image-793" title="Holding books" src="http://bertrandmeyer.com/wp-content/upLoads/books1-1.jpg" alt="Holding books" width="589" height="440" /></a></p>
<p>The store&#8217;s name, &#8220;the World in Tics&#8221;, is a wink to the many &#8220;tics&#8221; served by its books, from informatics (computer science and information technology) to &#8220;telematics&#8221; (computer  communication). Housed in a beautiful stone edifice in the heart of medieval Paris, on a little winding street close to the river, Le Monde en Tique is more than a bookstore: it is a haven for the local developer community, a place to stop by on a Saturday afternoon for a passionate discussion on agility, Ajax or Agitar. There is even a small garden:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/outside1.jpg"><img class="aligncenter size-full wp-image-800" title="The garden" src="http://bertrandmeyer.com/wp-content/upLoads/outside1.jpg" alt="The garden" width="602" height="450" /></a></p>
<p>There is a secret to Le Monde en Tique&#8217;s continued success: the quality of its offerings. The unique skill of  Jean Demétreau and his team is their availability to locate hot new books, including those from the US and elsewhere, before anyone else does; the large Paris bookstores like FNAC, and the Web sites such as fnac.fr and amazon.fr are often several weeks behind. Not just the French sites, as a matter of fact: in the case of <em>Touch of Class</em>, Le Monde en Tique had the book about a month ahead of amazon.com USA. This is why people come from very far away to get both the latest offerings and the classics.</p>
<p>So here&#8217;s my plug: whether you have just heard about a great new book, or haven&#8217;t heard anything and want to find out what is the latest great new book, this is the place to go. It might already be late when you finally take yourself away from browsing the shelves; but as you go out of the store and walk a few steps, the sight will not be too bad:</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/notre_dame1.JPG"><img class="aligncenter size-full wp-image-795" title="Notre Dame on an October evening" src="http://bertrandmeyer.com/wp-content/upLoads/notre_dame1.JPG" alt="Notre Dame on an October evening" width="609" height="455" /></a></p>
<h4>References</h4>
<p>[1] Matthai Kuruvila, <em>Stacey&#8217;s Bookstore closing down in S.F.</em>, in SFGate (San Francisco Chronicle), 5 January 2009, available <a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2009/01/07/BAFN154UV2.DTL" target="blog_illustrations">here</a>.</p>
<p>[2] <em>Shakespeare and company</em> bookstore in Paris: see <a href="http://www.shakespeareandcompany.com/" target="blog_illustrations">here</a>.</p>
<p>[3] <em>Le Monde en Tique</em> bookstore, 6 rue Maître Albert, Paris: see <a href="http://www.lmet.fr" target="blog_illustrations">www.lmet.fr</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/JhEOvMvbrrI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/10/19/knuth-companys/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/10/19/knuth-companys/</feedburner:origLink></item>
		<item>
		<title>The CPU Clock principle of software releases</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/rFGS4Qj-h2c/</link>
		<comments>http://bertrandmeyer.com/2009/10/03/the-cpu-clock-principle-of-software-releases/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 16:29:03 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=747</guid>
		<description><![CDATA[On how to build software, there is still much we do not know for sure; but we have also learned a few principles that can be considered firm.  By definition these are not new ideas; today&#8217;s principle, for example, is related to what agile developers know as “timeboxing”. But even if they have been published [...]]]></description>
			<content:encoded><![CDATA[<p>On how to build software, there is still much we do not know for sure; but we have also learned a few principles that can be considered firm.  By definition these are not new ideas; today&#8217;s principle, for example, is related to what agile developers know as “timeboxing”. But even if they have been published and discussed they are not universally applied or understood.</p>
<p>An  example is the <em>CPU Clock principle</em>: release at fixed frequency.</p>
<p>When planning for a new release of a system you can play with three parameters: functionality; quality; release time. The CPU Clock principle states that once a release time has been set you should never budge. If something has to go, it will be functionality.</p>
<p>At Eiffel Software we have been applying this principle systematically since shortly after we released EiffelStudio into open source in 2006. There are two releases a year, the  “Northern Spring release” on May 15 and the “Southern Spring release” on November 15 [2]. The content of each release is finalized six weeks before (April 1st, October 1st) and no delay is tolerated [3].</p>
<p>This scheme is a radical departure from the previous mode of operation. Of course every release had a planned delivery date, but it also had planned functionality; often, the functionality was not all ready at the appointed time, so the delivery date would shift, often by many months. No doubt the release plan was thought realistic at the time the team devised it, but it is a natural human tendency to promise too much and hope for the best. Delays came not so much from major obstacles, as features <em>would </em>get dropped if found too hard to include, but from functionality which the team believed to be “<em>almost there</em>” as the release date approached; a week passed, then a month, then maybe a half-year or more.</p>
<p>The better technique, as we have learned (no doubt many others have too) is to make release time the non-negotiable target. As with the clock cycle of a CPU in a modern computer, the sequence of release deadlines is the heartbeat to which everything else in the process must synchronize. The scale is different from that of a computer by a few orders of magnitude (months rather than pico- or nanoseconds), but the principle is the same.</p>
<p>The scheme requires a strict rule that whatever is not ready in time will not make it into the release. Indeed it has occurred a few times that some scheduled functionality had to be dropped, or at least moved to the next release. But now — with two and a half years of experience — comes the remarkable lesson: <em>this case, dropping a planned feature because it is not ready at the appointed time, happens only exceptionally</em>. It is not hard to analyze the reasons:</p>
<ul>
<li>Developers work better. It is not pleasant, for a developer who has devoted considerable effort to a new mechanism, to see that it does not make it to the product. Knowing that the deadline is coming, and that it is for real, is a powerful incentive to finish the work.</li>
<li>Everyone, managers and developers, learns to be realistic. Managers will not set impossible goals; developers will not commit to impossible implementations.</li>
</ul>
<p>Traditionally, some software projects have always had to treat delivery time as the number one goal. If you had to adapt an automatic teller machine network to the introduction of the euro, there was not much other choice than to be ready on January 1, 2002, and preferably a little before that. But many projects have a more lackadaisical attitude. They would fare better by adhering to the CPU Clock principle.</p>
<p>In describing it I have left a question open. Functionality should yield to  release punctuality, but we saw that there is a third parameter:  quality. What about it? Should we be ready to sacrifice it as well? I will not address the question furtherfor the moment, if only because this may be a good topic for reader comments before I come back to it in a future post.</p>
<p>The CPU clock principle addresses <em>release </em>times: the times when new versions of the product are made available to its users. It does not necessarily apply to internal milestones of the development team. Timeboxing, a related idea made popular by agile methods, is about such internal, intermediate steps; the typical iteration period of timeboxing is a f ew weeks. While fixed deadlines and a fixed frequency may be useful for such short internal iterations, the case for timeboxing is less compelling, especially for a large project where the various components may evolve along different timelines.</p>
<p>Because the CPU Clock principle governs the global scheduling of a product development, the scale is different. I cited above the 6-month periodicity of EiffelStudio development; although each project will define its own period, it makes no sense to go below one month for any significant software effort.</p>
<p>How universal is the principle? Only two exceptions come to mind: very small projects, and the initial phase of a project, when the development is taking shape and it is too early to define the ideal release scheme. Outside of these two cases, I see the CPU Clock principle, on the basis of our experience and of discussions with many developers and project leaders, as the only sustainable model for healthy software projects.</p>
<h4>Notes</h4>
<p>[1] EiffelStudio open-source development page, see <a href="http://dev.eiffel.com/Main_Page" target="blog_illustrations">here</a>.</p>
<p>[2] Formerly known as the “Spring release” and “Fall release” until someone complained of hemisphere bias.</p>
<p>[3] Actually some last-minute technical problems have occasionally caused short delays in the actual delivery, without affecting the overall cycle. We have taken measures to ensure that these do not occur again.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/rFGS4Qj-h2c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/10/03/the-cpu-clock-principle-of-software-releases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/10/03/the-cpu-clock-principle-of-software-releases/</feedburner:origLink></item>
		<item>
		<title>Do you know Java?</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/yRtWHkmzotQ/</link>
		<comments>http://bertrandmeyer.com/2009/09/20/do-you-know-java/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 15:13:24 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=751</guid>
		<description><![CDATA[I am jealous of Emmanuel (Manu) Stapf who blogged about this before I had the time to; but I can at least refer you to his entry [1].
The idea actually comes from Martin Nordio, who as part of his thesis work formalized the exception semantics of both Eiffel and Java. In the process he came [...]]]></description>
			<content:encoded><![CDATA[<p>I am jealous of Emmanuel (Manu) Stapf who blogged about this before I had the time to; but I can at least refer you to his entry [1].</p>
<p>The idea actually comes from Martin Nordio, who as part of his thesis work formalized the exception semantics of both Eiffel and Java. In the process he came across some (shall we say) interesting properties of Java, and got into the habit of asking people first if they know Java well, and then if they can predict the results of some simple programs.</p>
<p>So, do you think you know Java? If so, please take the test, and wait for the answer next week in Manu&#8217;s blog.</p>
<h4>Reference</h4>
<p></p>
<p>
[1] Emmanuel Stapf: <a href="http://www.eiffelroom.org/blog/manus_eiffel/and_people_are_still_using_java" target="blog_illustrations"><i>“And people are still using Java?”</i> blog entry</a>.</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/yRtWHkmzotQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/09/20/do-you-know-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/09/20/do-you-know-java/</feedburner:origLink></item>
		<item>
		<title>SEAFOOD 2010</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/0dxIJFLwc9g/</link>
		<comments>http://bertrandmeyer.com/2009/08/23/seafood-2010/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 00:04:12 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA["Distributed development"]]></category>
		<category><![CDATA[Offshoring]]></category>
		<category><![CDATA[Outsourcing]]></category>
		<category><![CDATA[SEAFOOD]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=734</guid>
		<description><![CDATA[The next SEAFOOD (Software Engineering Advances For Offshore and Outsourced Development) conference will take place in Saint Petersburg, Russia, on 17 and 18 June 2010. The conference co-chairs are Andrey Terekhov from Saint Petersburg State University and Lanit-Tercom, and Martin Nordio from ETH are conference co-chairs. Mathai Joseph from Tata Consulting Services and I will [...]]]></description>
			<content:encoded><![CDATA[<p>The next SEAFOOD (Software Engineering Advances For Offshore and Outsourced Development) conference will take place in Saint Petersburg, Russia, on 17 and 18 June 2010. The conference co-chairs are Andrey Terekhov from Saint Petersburg State University and Lanit-Tercom, and Martin Nordio from ETH are conference co-chairs. Mathai Joseph from Tata Consulting Services and I will be co-chairing the PC. The Call for Papers will be issued soon; information about this year&#8217;s conference at <a href="http://seafood.ethz.ch">seafood.ethz.ch</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/0dxIJFLwc9g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/23/seafood-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/23/seafood-2010/</feedburner:origLink></item>
		<item>
		<title>The one sure way to advance software engineering</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/5kjD1a6wVe0/</link>
		<comments>http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 05:39:49 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Policy]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Software verification]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=706</guid>
		<description><![CDATA[Airplanes today are incomparably safer than 20, 30, 50 years ago: 0.05 deaths per billion kilometers. That&#8217;s not by accident.
Rather, it&#8217;s by accidents. What has turned air travel from a game of chance into one of the safest modes of traveling is the relentless study of crashes and other mishaps. In the US the National [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Airplanes today are incomparably safer than 20, 30, 50 years ago: 0.05 deaths per billion kilometers. That&#8217;s not by accident.</p>
<p>Rather, it&#8217;s by accidents. What has turned air travel from a game of chance into one of the safest modes of traveling is the relentless study of crashes and other mishaps. In the US the National Transportation Safety Board has investigated more than 110,000 accidents since it began its operations in 1967. Any accident must, by law, be investigated thoroughly; airplanes themselves carry the famous “black boxes” whose only purpose is to provide evidence in the case of a catastrophe. It is through this systematic and obligatory process of dissecting unsafe flights that the industry has made almost all flights safe.</p>
<p>Now consider software. No week passes without the announcement of some debacle due to “computers” — meaning, in most cases, bad software. The indispensable Risks forum [1] and many pages around the Web collect software errors; several books have been devoted to the topic.</p>
<p>A few accidents have been investigated thoroughly; two examples are Nancy Leveson&#8217;s milestone study of the Therac-25 patient-killing medical device [2], and Gilles Kahn&#8217;s analysis of the Ariane 5 crash (which Jean-Marc Jézéquel and I used as a basis for our 1997 article [3]). Both studies improved our understanding of software engineering. But these are exceptions. Most of what we have elsewhere is made of hearsay and partial information, and plain urban legends (like the endlessly repeated story about the Venus probe that supposedly failed because a period was typed instead of a comma — most likely a canard).</p>
<p>Software disasters continue; they attract attention when they arise, and inevitably some kind of announcement is made that the problem is being corrected, or that a committee will study the causes; almost as inevitably, that is the last we hear of it. In the latest issue of Risks alone, you can find several examples (such as [4]). In the past months, breakdowns at Skype, Google and Twitter made headlines; we all learned about the failures, but have you seen precise analyses of what actually happened?</p>
<p>As another typical example, we heard a few months ago from the French press that an “IT error” (<em>une erreur informatique</em>) led to overestimating the pensions of about a million people; since (strangely!)  no one was suggesting that they would be asked to pay the money back, the cost to taxpayers will be over 300 million euros. I looked in vain for any follow-up story: what happened? What was the actual error? Were the tools at fault? The quality assurance procedures? The programmers&#8217; qualifications? Or was it a matter of bad deployment? Of erroneous data, and if so, what was the process for validating inputs? And so on. Most likely we will never know.</p>
<p>But we should know. Especially with public money, any such incident should have a post-mortem, with experts called in (surely at a fraction of the cost of the failure) to analyze what happened and produce a public report.</p>
<p>At least this was a public project, for which <em>some</em> disclosure was inevitable. The software engineering community buzzes with unconfirmed reports of huge software-induced errors, that go unreported because they happen in private companies eager to avoid bad publicity. It&#8217;s as if we had allowed aircraft manufacturers, decade after decade, to keep mum about accidents. Where then would air travel safety be today?</p>
<p>Progress in software engineering will come from many sources. Research is critical, including on topics which today appear exotic. But if anyone is looking for one practical, low-tech idea that has an iron-clad guarantee of improving software engineering, here it is: pass a law that requires extensive professional analysis of any large software failure.</p>
<p>The details are not so hard to refine. The initiative would probably have to start at the national level; any industrialized country could be the pioneer. (Or what about Europe as whole?) The law would have to define what constitutes a “large” failure; for example it could be any failure that may be software-related and has resulted in loss either of human life or of property beyond a certain threshold, say $50 million. In the latter case, to avoid accusations of government meddling in private matters, the law could initially be limited to cases involving public money; when it has shown its value, it could then be extended to private failures as well. Even with some limitations, such a law would have a tremendous effect. Only with a thorough investigation of software projects gone wrong can we help the majority of projects to go right.</p>
<p>We can no longer afford to let the IT industry get away with covering up its failures. Lobbying for a Software Incident Full Disclosure Law is the single most important step we can take today to make the world&#8217;s software better.</p>
<h4>References</h4>
<p>[1] Peter G. Neumann, moderator: <em>The Risks Digest Forum on Risks to the Public in Computers and Related Systems</em>, available <a href="http://www.risks.org">online </a>(going back to 1985!).</p>
<p>[2] Nancy Leveson: <em>Medical Devices: The Therac-25</em>, extract from her book <em>Safeware: System Safety and Computers</em>, Addison-Wesley, 1995, available <a href=" http://sunnyday.mit.edu/papers/therac.pdf">online</a>.</p>
<p>[3] Jean-Marc Jézéquel and Bertrand Meyer: <em>Design by Contract: The Lessons of Ariane</em>, in <em>Computer</em> (IEEE), vol. 30, no. 1, January 1997, pages 129-130, also available <a href="http://se.ethz.ch/~meyer/publications/computer/ariane.pdf">here</a>.</p>
<p>[4] Monty Solomon: <em>Computer Error Caused Rent Troubles for Public Housing Tenants</em>, in Risks 25.76, 15 August 2009, see <a href="http://catless.ncl.ac.uk/Risks/latest.html#subj6.1">here</a>.</p>
<p>[5] <em>Une erreur informatique à 300 millions d&#8217;euros</em>, in <em>Le Point</em>, 12 May 2009, available <a href="http://www.lepoint.fr/actualites-societe/2009-05-12/calcul-des-retraites-une-erreur-informatique-a-300-millions-d-euros/920/0/342633">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/5kjD1a6wVe0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/</feedburner:origLink></item>
		<item>
		<title>Programming limerick of the month, September 2009</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/MXqWe4GrzHU/</link>
		<comments>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-october-2009/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 04:49:32 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Limerick]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=691</guid>
		<description><![CDATA[A more trivial pursuit


There was a young guy full of lust
Who could not understand C++.
He decided instead
To woo his co-ed:
It&#8217;s more fun (he found out), and less fuss.


]]></description>
			<content:encoded><![CDATA[<blockquote><p><span style="font-size: 1.2em; line-height: 200%"><em>A more trivial pursuit</em></span><br />
<strong><br />
<span style="color: #005000; font-size: 1.2em; line-height: 200%"><br />
There was a young guy full of lust<br />
Who could not understand C++.<br />
He decided instead<br />
To woo his co-ed:<br />
It&#8217;s more fun (he found out), and less fuss.<br />
</span><br />
</strong></p></blockquote>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/MXqWe4GrzHU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-october-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-october-2009/</feedburner:origLink></item>
		<item>
		<title>Programming limerick of the month, August 2009</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/0KLRLG1Tom4/</link>
		<comments>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-august-2009/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 03:47:24 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Limerick]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=577</guid>
		<description><![CDATA[&#160;

Bail-out


A large bank (now in need of a shore-up)
Had converted its code to C-Sharp.
It soon led to such drama
That they called up Obama
And demanded admission to TARP.


&#160;
&#160;
In September: UML.
]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<blockquote><p>
<span style="font-size: 1.2em; line-height: 200%"><em>Bail-out</em></span><br />
<strong><br />
<span style="color: #005000; font-size: 1.2em; line-height: 200%"><br />
A large bank (now in need of a shore-up)<br />
Had converted its code to C-Sharp.<br />
It soon led to such drama<br />
That they called up Obama<br />
And demanded admission to TARP.<br />
</span><br />
</strong></p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;<br />
In September: UML.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/0KLRLG1Tom4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-august-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/17/programming-limerick-of-the-month-august-2009/</feedburner:origLink></item>
		<item>
		<title>Specifying user interfaces</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/FBGDpri6rrs/</link>
		<comments>http://bertrandmeyer.com/2009/08/17/specifying-user-interfaces/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 00:34:09 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Formal methods and proofs]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Software process]]></category>
		<category><![CDATA[Software verification]]></category>
		<category><![CDATA[User interface design]]></category>
		<category><![CDATA[Dahl]]></category>
		<category><![CDATA[Dijkstra]]></category>
		<category><![CDATA[Guttag]]></category>
		<category><![CDATA[Hoare]]></category>
		<category><![CDATA[Horning]]></category>
		<category><![CDATA[Hype]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=612</guid>
		<description><![CDATA[Many blogs including this one rely on the WordPress software. In previous states of the present page you may have noticed a small WordPress bug, which I find interesting.
&#8220;Tags&#8221; are a nifty WordPress feature. When you post a message, you can specify one or more informative &#8220;tags&#8221;. The tags of all messages appear in the right sidebar, each [...]]]></description>
			<content:encoded><![CDATA[<p>Many blogs including this one rely on the WordPress software. In previous states of the present page you may have noticed a small WordPress bug, which I find interesting.</p>
<p>&#8220;Tags&#8221; are a nifty WordPress feature. When you post a message, you can specify one or more informative &#8220;tags&#8221;. The tags of all messages appear in the right sidebar, each with a smaller or bigger font size depending on the number of messages that specified it. You can click such a tag in the sidebar and get, on the left, a page containing all the associated messages.</p>
<p>Now assume that many posts use a particular tag; in our example it is “<em>Design by Contract</em>”, not unexpected for this blog. Assume further that the tag name is long. It is indeed in this case: 18 characters. As a side note, no problem would arise if I used normal spaces in the name, which would then appear on two or three lines; precisely to avoid this  I use HTML “non-breaking spaces”. This is probably not in the WordPress spirit, but any other long tag without spaces would create the same problem. That problem is a garbled display:</p>
<p> </p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/dbc_overflows.jpg"><img class="aligncenter size-full wp-image-624" title="dbc_overflows" src="http://bertrandmeyer.com/wp-content/upLoads/dbc_overflows.jpg" alt="dbc_overflows" width="359" height="316" /></a></p>
<p>The long tag overflows the bluish browser area assigned to tags, producing an ugly effect. This behavior is hard to defend: either the tag should have been rejected as too long when the poster specified it or it should fit in its zone, whether by truncation or by applying a smaller font.</p>
<p>I quickly found a workaround, not nice but good enough: make sure that some short tag  (such as “<em>Hoare</em>”) appears much more often than the trouble-making tag. Since font size indicates the <em>relative</em> frequency of tags, the long one will be scaled down to a smaller font which fits.  </p>
<p>Minor as it is, this WordPress glitch raises some general questions. First, is it really a bug? Assume, by a wild stretch of imagination, that a jury had to resolve this question; it could easily find an expert to answer positively, by stating that the behavior does not satisfy reasonable user expectations, and another who notes that it is not buggy behavior since it does not appear to violate any expressly stated property of the specification. (At least I did not find in the WordPress documentation any mention of either the display size of tags or a limit on tag length; if I missed it please indicate the reference.)</p>
<p>Is it a serious matter? Not in this particular example; uncomely Web display does not kill.   But the distinction between “small matter of esthetics&#8221; and software fault can be tenuous. We may note in particular that the possibility for large data to overflow its assigned area is a fundamental source of security risks; and even pure user interface issues can become life-threatening in the case of critical applications such as air-traffic control.</p>
<p>Our second putative expert is right, however: no behavior is buggy unless it contradicts a specification. Where will the spec be in such an example? There are three possibilities, each with its limitations.</p>
<p>The first solution is to expect that in a carefully developed system every such property will have to be specified. This is conceivable, but hard, and the question arises of how to make sure nothing has been forgotten. Past  some threshold of criticality and effort, the only specifications that count are formal; there is not that much literature on specifying user interfaces formally, since much of the work on formal specifications has understandably concentrated on issues thought to be more critical.</p>
<p>Because of the tediousness of specifying such general properties again and again for each case, it might be better  — this is the second solution — to specify them globally, for an entire system, or for the user interfaces of an entire class of systems. Like any serious effort at specification, if it is worth doing, it is worth doing formally.</p>
<p>In either of these approaches the question remains of how we know we have specified everything of interest. This question, specification completeness, is not as hopeless as most people think; I plan to write an entry about it sometime (<em>hint</em>:  bing for “<em>guttag horning</em>”). Still, it is hard to be sure you did not miss anything relevant. Remember this the next time formal methods advocates — who should know better — tell you that with their techniques there “<em>no longer is a need to test</em>”, or when you read about the latest OS kernel that is “<em>guaranteed correct and secure</em>”. However important formal methods and proofs are, they can only guarantee satisfaction of the properties that the specifier has considered and stated. To paraphrase someone [1], I would venture that</p>
<blockquote><p><em>Proofs can only show the absence of envisaged bugs, never rule out the presence of unimagined ones.</em></p></blockquote>
<p>This is one of the reasons why tests will always, regardless of the progress of proofs, remain an indispensable part of the software development landscape [2]. Whatever you have specified and proved, you will still want to run the system (or, for certain classes of embedded software, some simulation of it) and see the results for yourself.</p>
<p>What then if we do not explicitly specify the desired property (as we did in the two approaches considered so far) but testing or actual operation still reveals some behavior that is clearly unsatisfactory? On what basis do we complain to the software&#8217;s producer? A solution here, the third in our list, might be to rely on generally accepted standards of professional development. This is common in other kinds of engineering: if you commission someone to build you a house, the contract may not explicitly state that the roof should not fall on your head while you are asleep; when this happens, you will still sue and accuse the builder of malpractice. Such remedies can work for software too, but the rules are murkier because we have not accepted, or even just codified, a set of general professional practices that would cover such details as “<em>no display of information should overflow its assigned area</em>”.</p>
<p>Until then I will remember to use one short tag a lot.</p>
<h4>References</h4>
<p> [1] Edsger W. Dijksra, <em>Notes on Structured Programming</em>, in Dahl, Dijkstra, Hoare, <em>Structured Programming</em>, Academic Press, 1972.</p>
<p>[2]  See <a href="http://tap.ethz.ch/2009/index.html"><em>Tests And Proofs</em> (TAP) conference series</a>, since 2007. The next conference, program-chaired by Angelo Gargantini and Gordon Fraser, will take place in the week of the TOOLS Federated Conferences in Málaga, Spain, in the week of June 28, 2010.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/FBGDpri6rrs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/17/specifying-user-interfaces/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/17/specifying-user-interfaces/</feedburner:origLink></item>
		<item>
		<title>The great programming haiku competition</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/wyLE7lg26lw/</link>
		<comments>http://bertrandmeyer.com/2009/08/16/the-great-programming-haiku-competition/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 22:40:10 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Writing and style]]></category>
		<category><![CDATA[Haiku]]></category>
		<category><![CDATA[Touch of Class]]></category>
		<category><![CDATA[Turing]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=535</guid>
		<description><![CDATA[In a few weeks I will be teaching again my Introductory Programming course at ETH, based for the first time on the published &#8220;Touch of Class&#8221; textbook [1]. For fun (mine if no one else&#8217;s) every lecture will conclude with a haiku summarizing the topic.
I made up a few, given below, and am opening a [...]]]></description>
			<content:encoded><![CDATA[<p>In a few weeks I will be teaching again my Introductory Programming course at ETH, based for the first time on the published &#8220;Touch of Class&#8221; textbook [1]. For fun (mine if no one else&#8217;s) every lecture will conclude with a haiku summarizing the topic.</p>
<p>I made up a few, given below, and am opening a competition for more. Every proposal should be submitted in the form of a comment to this post. Every winner&#8217;s haiku and name will appear in the course slides, and in the special Programming Haiku page which will be added to the book&#8217;s site. There are four rules:</p>
<ul>
<li>The contribution has to be a proper haiku: “three unrhymed lines of five, seven, and five syllables”.</li>
<li>It must summarize the principal concept of a chapter or main section of the textbook or, better yet, of one of the course&#8217;s lectures; see [2] for the lecture plan.</li>
<li>It must give the book reference (chapter or section) or lecture number or both.</li>
<li>The prize committee&#8217;s members are secret and its judgments final.</li>
</ul>
<p>Here, for a start, are my own examples.</p>
<h4>Proof of the undecidability of the halting problem</h4>
<p>Section 7.5 of the book; lecture 5.2.</p>
<p style="text-align: center;"><font color="#005000"><strong>If it stops, it loops,<br />
Yet if it looped, it would stop.<br />
Sad contradiction.</strong></font></p>
<h4>Recursion</h4>
<p>Chapter 14, especially section 14.3; lecture 9.1.</p>
<p style="text-align: center;"><font color="#005000"><strong><br />
Often, I call you.<br />
But when the going gets tough,<br />
I will call myself.<br />
</strong></font></p>
<h4>Topological sort</h4>
<p>Chapter 15; lectures 11.1 and 11.2.</p>
<p style="text-align: center;"><font color="#005000"><strong><br />
Partial to total?<br />
With the right data structures,<br />
O of m plus n.<br />
</strong></font></p>
<h4>Dynamic binding</h4>
<p>Section 16.3; lecture 8.1.</p>
<p style="text-align: center;"><font color="#005000"><strong><br />
O-O programmers:<br />
How many to screw a bulb?<br />
None whatsoever.<br />
</strong></font></p>
<h4>Deferred classes</h4>
<p>Section 16.5; lecture 8.1.</p>
<p style="text-align: center;"><font color="#005000"><strong><br />
Do not implement!<br />
Though for a truly Zen spec<br />
You need a contract.<br />
</strong></font></p>
<h4>References</h4>
<p>[1] <em>Touch of Class: An Introduction to Programming Well Using Objects</em> <em>and Contracts</em>, Springer Verlag, 2009. See <a href="http://www.amazon.com/Touch-Class-Learning-Program-Contracts/dp/3540921443">Amazon page</a> (still wrongly says the book is not yet published).</p>
<p>[2] “Introduction to Programming” course at ETH Zurich, Fall 2009: <a href="http://se.ethz.ch/teaching/2009-H/eprog-0001/english_index.html">course page</a>. This does not have the slides yet, but you can see last year&#8217;s slides in <a href="http://se.ethz.ch/teaching/2008-H/eprog-0001/english_index.html">last year&#8217;s page</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/wyLE7lg26lw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/16/the-great-programming-haiku-competition/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/16/the-great-programming-haiku-competition/</feedburner:origLink></item>
		<item>
		<title>Rejection letter classic</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/jRLp7V5M0mw/</link>
		<comments>http://bertrandmeyer.com/2009/08/14/rejection-letter-classic/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 03:07:35 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Research evaluation]]></category>
		<category><![CDATA[Codd]]></category>
		<category><![CDATA[Dijkstra]]></category>
		<category><![CDATA[Hoare]]></category>
		<category><![CDATA[Turing]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=527</guid>
		<description><![CDATA[Part of the experience of being a scientist, in the industrial age of publication, is the rejection letter; especially the damning review whose author, anonymous of course, does not appear particularly competent. I have my own treasured collection, which I will publish one day. For a fiction so artfully designed as to be almost as good as the real thing, [...]]]></description>
			<content:encoded><![CDATA[<p>Part of the experience of being a scientist, in the industrial age of publication, is the rejection letter; especially the damning review whose author, anonymous of course, does not appear particularly competent. I have my own treasured collection, which I will publish one day. For a fiction so artfully designed as to be almost as good as the real thing, you can check  Simone Santini&#8217;s hilarious parody [1], a true classic.</p>
<p>Although there are a few references to it around the Web, I do not think it is as well known as it deserves to be. What Santini did was to imagine rejection letters for famous papers. He stated [2] that:</p>
<blockquote><p><em>The reviews are a collage of reviews that I have seen of some papers (mine and of other people) that have been rejected because, I thought, the reviewer had completely misunderstood the paper. After a rejection at a database conference for what I thought were completely preposterous reasons, I had the idle thought that today even Codd&#8217;s paper on relational data bases (the foundation of the whole field) would never make it into a major data base conference&#8230;Many of the sentences that I use in the article are from actual reviews.</em></p></blockquote>
<p>A sample from the imaginary Codd rejection letter:</p>
<blockquote><p>E.F. CODD “A Relational Model of Data for Large Shared Data Banks.”  &#8230; <em>The formalism is needlessly complex and mathematical, using concepts and notation with which the average data bank practitioner is unfamiliar. The paper doesn&#8217;t tell us how to translate its arcane operations into executable block access. </em></p>
<p><em>Adding together the lack of any real-world example, performance experiment, and implementation indication or detail, we are left with an obscure exercise using unfamiliar mathematics and of little or no practical consequence. It can be safely rejected. </em></p></blockquote>
<p>All the others are gems too: Turing&#8217;s Entscheidungsproblem paper (“<em>If the article is accepted, Turing should remember that the language of this journal is English and change the title accordingly</em>”); Dijstra&#8217;s <em>Goto considered harmful;</em> Hoare&#8217;s 1969 axiomatic semantics paper (the author “<em>should also extend the method to be applicable to a standard programming language such as COBOL or PL/I and provide the details of his implementation, possibly with a few graphics to show how the system works in practice</em>”) etc.</p>
<p>To avoid a spoiler I will  cite no more;  you should read the paper if you do not know it yet. It rings so true.</p>
<h4>References</h4>
<p>[1] Simone Santini: <em>We Are Sorry to Inform You &#8230;,</em> in IEEE <em>Computer</em>, vol. 38, no. 12, pp. 128, 126-127, December 2005,  online on the <a href="http://www2.computer.org/portal/web/csdl/abs/mags/co/2005/12/rz128abs.htm">IEEE site</a>. There is also a copy <a href="http://th.informatik.uni-mannheim.de/People/Lucks/reject.pdf">here</a>.</p>
<p> [2] <a href="http://www.omlettesoft.com/newjournal.php3?who=Lord+Omlette&amp;id=1134629858">http://www.omlettesoft.com/newjournal.php3?who=Lord+Omlette&amp;id=1134629858</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/jRLp7V5M0mw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/14/rejection-letter-classic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/14/rejection-letter-classic/</feedburner:origLink></item>
		<item>
		<title>Talking about testing…</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/vvwB4nb_u5Q/</link>
		<comments>http://bertrandmeyer.com/2009/08/13/talking-about-testing/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:52:42 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Italy]]></category>
		<category><![CDATA[Napoleon]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=510</guid>
		<description><![CDATA[... Let me mention the LASER summer school [1], coming up in early September, and devoted this year to “Software Testing: The Science and the Practice”. It's in an idyllic setting on the island of Elba and has some of the world's top testing experts as speakers.]]></description>
			<content:encoded><![CDATA[<p>&#8230; Let me mention the LASER summer school [1], coming up in early September, and devoted this year to “Software Testing: The Science and the Practice”. It&#8217;s in a breathtaking setting, in the wonderful Hotel del Golfo in Procchio on the island of Elba (yes, the place where Napoleon spent a little less than a year, off the coast of Tuscany)</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/elbahotel.jpg"><img class="aligncenter size-full wp-image-512" title="elbahotel" src="http://bertrandmeyer.com/wp-content/upLoads/elbahotel.jpg" alt="elbahotel" width="640" height="480" /></a></p>
<p>and has some of the world&#8217;s top testing experts as speakers. Late registrations are still possible.</p>
<p>I will report here in September about some of what I learn.</p>
<h4>Reference</h4>
<p> </p>
<p>[1] Laser summer school: the link is <a href="http://se.ethz.ch/laser">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/vvwB4nb_u5Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/13/talking-about-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/13/talking-about-testing/</feedburner:origLink></item>
		<item>
		<title>What is the purpose of testing?</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/zheDuGqsunw/</link>
		<comments>http://bertrandmeyer.com/2009/08/12/what-is-the-purpose-of-testing/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 07:48:24 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Software verification]]></category>
		<category><![CDATA[Dijkstra]]></category>
		<category><![CDATA[Software testing]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=491</guid>
		<description><![CDATA[Last year I published in IEEE Computer a short paper entitled “Seven Principles of Software Testing” [1]. Although technical, it was an opinion piece and the points were provocative enough to cause a reader, Gerald Everett, to express strong disagreement. Robert Glass, editor of the “Point/Counterpoint” rubric of the sister publication, IEEE Software, invited both [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I published in IEEE <em>Computer</em> a short paper entitled “<em>Seven Principles of Software Testing</em>” [1]. Although technical, it was an opinion piece and the points were provocative enough to cause a reader, Gerald Everett, to express strong disagreement. Robert Glass, editor of the “<em>Point/Counterpoint</em>” rubric of the sister publication, IEEE <em>Software</em>, invited both of us to a debate in the form of a critique by Mr. Everett, my answer to the critique, his rejoinder to the answer, and my rejoinder to his rejoinder. The result appeared recently [2].</p>
<p>Other than a matter of terminology (Mr. Everett wants “testing” to cover static as well as dynamic techniques of quality assurance), the main point of disagreement was my very first principle: <strong><em>to test a program is to make it fail</em>.</strong> Indeed this flies in the face of some established wisdom, which holds that testing serves to increase one&#8217;s confidence in the software; see for example the Wikipedia entry [3]. My article explains that this is a delusion and that it is more productive to limit the purpose of the testing process to what it does well, finding faults,  rather than leting it claim goals of quality assurance that are beyond its scope. Finding faults is no minor feat already. In this view — the practical view, for example as seen by a software project manager  — Dijkstra&#8217;s famous dismissal of testing (it can prove the presence of bugs, never their absence) is the greatest compliment to testing, and the most powerful advertisement one can think of for taking testing seriously.</p>
<p>What do you think? What is testing good for?</p>
<p>I should add that in terms of research this debate is a bit of a sideline.  The real goal of our work is to build completely automatic testing tools. An article on this topic will appear in the next issue of <em>Computer</em> (September); I will post a link to it when the issue is out.</p>
<h4>References</h4>
<p>[1] Bertrand Meyer: <em>Seven Principles of Software Testing</em>, in IEEE Computer, vol. 41, no. 8, pages 99-101, Aug. 2008; available on the <a href="http://www2.computer.org/portal/web/csdl/doi/10.1109/MC.2008.306">IEEE site</a>, and also in draft form <a href="http://se.ethz.ch/~meyer/publications/testing/principles.pdf">here</a>. (An earlier version, without the beautiful picture of bees and flies in the bottle drawn by <em>Computer</em>&#8217;s artist, appeared as an <a href="http://www.eiffel.com/general/column/2008/02.html">EiffelWorld column</a>.)</p>
<p>[2] Gerald D. Everett and Bertrand Meyer: <em>Point/Counterpoint</em>, in IEEE Software, Vol. 26, No. 4, pages 62-64, July/August 2009.  Available <a href="http://www2.computer.org/portal/web/csdl/doi?doc=doi/10.1109/MS.2009.98">on the IEEE site</a> and also <a href="http://www.astqb.org/why-istqb/IEEEPointCounterpointEverettMeyer.pdf">here</a>.</p>
<p>[3] Wikipedia <a href="http://en.wikipedia.org/wiki/Software_testing">entry </a>on Software Testing.</p>
<p>[4] Bertrand Meyer, Ilinca Ciupa, Andreas Leitner, Arno Fiva, Emmanuel Stapf and Yi Wei: <em>Programs that test themselves</em>, to appear in IEEE <em>Computer</em>, September 2009.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/zheDuGqsunw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/12/what-is-the-purpose-of-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/12/what-is-the-purpose-of-testing/</feedburner:origLink></item>
		<item>
		<title>“Touch of Class” published</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/shFZBJBauNM/</link>
		<comments>http://bertrandmeyer.com/2009/08/11/touch-of-class-published/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 05:26:40 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Hoare]]></category>
		<category><![CDATA[Introduction to programming]]></category>
		<category><![CDATA[Touch of Class]]></category>
		<category><![CDATA[Wirth]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=460</guid>
		<description><![CDATA[My textbook Touch of Class: An Introduction to Programming Well Using Objects and Contracts [1] is now available from Springer Verlag [2]. I have been told of many bookstores in Europe that have it by now; for example Amazon Germany [3] offers immediate delivery. Amazon US still lists the book as not yet published [4], but [...]]]></description>
			<content:encoded><![CDATA[<p>My textbook <em>Touch of Class: An Introduction to Programming Well Using Objects and Contracts</em> [1] is now available from Springer Verlag [2]. I have been told of many bookstores in Europe that have it by now; for example Amazon Germany [3] offers immediate delivery. Amazon US still lists the book as not yet published [4], but I think this will be corrected very soon.</p>
<p><a href="http://bertrandmeyer.com/wp-content/upLoads/touch_of_class.jpg"><img class="aligncenter size-full wp-image-484" title="touch_of_class" src="http://bertrandmeyer.com/wp-content/upLoads/touch_of_class.jpg" alt="touch_of_class" width="222" height="300" /></a></p>
<p>The book results from six years of teaching introductory programming at ETH Zurich. It is richly illustrated in full color (not only with technical illustrations but with numerous photographs of people and artefacts). It is pretty big, but designed so that a typical one-semester introductory course can cover most of the material.</p>
<p>Many topics are addressed (see table of contents below), including quite a few that are seldom seen at the introductory level. Some examples, listed here in random order: a fairly extensive introduction to software engineering including things like requirements engineering (not usually mentioned in programming courses, with results for everyone to see!) and CMMI, a detailed discussion of how to implement recursion, polymorphism and dynamic binding and their role for software architecture, multiple inheritance, lambda calculus (at an introductory level of course), a detailed analysis of the Observer and Visitor patterns, event-driven programming, the lure and dangers of references and aliasing, topological sort as an example of both algorithm and API design, high-level function closures, software tools, properties of computer hardware relevant for programmers, undecidability etc.</p>
<p>The progression uses an object-oriented approach throughout; the examples are in Eiffel, and four appendices present the details of Java, C#, C++ and C. Concepts of Design by Contract and rigorous development are central to the approach; for example, loops are presented as a technique for computing a result by successive approximation, with a central role for the concept of loop invariant. This is not a “formal methods” book in the sense of inflicting on the students a heavy mathematical apparatus, but it uses preconditions, postconditions and invariants throughout to alert them to the importance of reasoning rigorously about programs. The discussion introduces many principles of sound design, in line with the book&#8217;s subtitle, “Learning to Program <em><strong>Well</strong></em>”.</p>
<p>The general approach is “Outside-In” (also known as “Inverted Curriculum” and described at some length in some of my articles, see e.g. [5]): students have, right from the start, the possibility of working with real software, a large (150,000-line) library that has been designed specifically for that purpose. Called Traffic, this library simulates traffic in a city; it is graphical and of good enough visual quality to be attractive to today&#8217;s “Wii generation” students, something that traditional beginners&#8217; exercises, like computing the 7-th Fibonacci number, cannot do (although we have these too as well). Using the Traffic software through its API, students can right from the first couple of weeks produce powerful applications, without understanding the internals of the library. But they do not stop there: since the whole thing is available in open source, students learn little by little how the software is made internally. Hence the name “Outside-In”: understand the interface first, then dig into the internals. Two advantages of the approach are particularly worth noting:</p>
<ul>
<li>It emphasizes the value of abstraction, and particular contracts, not by preaching but by showing to students that abstraction helps them master a large body of professional-level software, doing things that would otherwise be unthinkable at an introductory level.</li>
<li>It addresses what is probably today the biggest obstacle to teaching introductory programming: the wide diversity of initial student backgrounds. The risk with traditional approaches is either to fly too high and lose the novices, or stay too low and bore those who already have programming experience. With the Outside-In method the novices can follow the exact path charted from them, from external API to internal implementation; those who already know something about programming can move ahead of the lectures and start digging into the code by themselves for information and inspiration.</li>
</ul>
<p> (We have pretty amazing data on students&#8217; prior programming knowledge, as  we have been surveying students for the past six years, initially at ETH and more recently at the University of York in England thanks to our colleague Manuel Oriol; some day I will post a blog entry about this specific topic.)</p>
<p>The book has been field-tested in its successive drafts since 2003 at ETH, for the Introduction to Programming course (which starts again in a few weeks, for the first time with the benefit of the full text in printed form). Our material, such as a full set of slides, plus exercises, video recordings of the lectures etc. is available to any instructor selecting the text. I must say that Springer did an outstanding job with the quality of the printing and I hope that instructors, students, and even some practitioners already in industry will like both form and content.</p>
<h4>Table of contents</h4>
<p><strong>Front matter</strong>: Community resource, Dedication (to Tony Hoare and Niklaus Wirth), Prefaces, Student_preface, Instructor_preface, Note to instructors: what to cover?, Contents</p>
<p><strong>PART I: Basics<br />
</strong>1 The industry of pure ideas<br />
2 Dealing with objects<br />
3 Program structure basics<br />
4 The interface of a class<br />
5 Just Enough Logic<br />
6 Creating objects and executing systems<br />
7 Control structures<br />
8 Routines, functional abstraction and information hiding<br />
9 Variables, assignment and references<br />
<strong>PART II: How things work</strong><br />
10 Just enough hardware<br />
11 Describing syntax<br />
12 Programming languages and tools<br />
<strong>PART III: Algorithms and data structures</strong><br />
13 Fundamental data structures, genericity, and algorithm complexity<br />
14 Recursion and trees<br />
15 Devising and engineering an algorithm: Topological Sort<br />
<strong>PART IV: Object-Oriented Techniques</strong><br />
16 Inheritance<br />
17 Operations as objects: agents and lambda calculus<br />
18 Event-driven design<br />
<strong>PART V: Towards software engineering</strong><br />
19 Introduction to software engineering<br />
<strong>PART VI: Appendices</strong><br />
A An introduction to Java (from material by Marco Piccioni)<br />
B An introduction to C# (from material by Benjamin Morandi)<br />
C An introduction to C++ (from material by Nadia Polikarpova)<br />
D From C++ to C<br />
E Using the EiffelStudio environment<br />
Picture credits<br />
Index</p>
<h4>References</h4>
<p>  [1] Bertrand Meyer, <em>Touch of Class: An Introduction to Programming Well Using Objects</em> <em>and Contracts</em>, Springer Verlag, 2009, 876+lxiv pages, Hardcover, ISBN: 978-3-540-92144-8.</p>
<p>[2] Publisher page for [1]: see  <a href="http://www.springer.com/computer/programming/book/978-3-540-92144-8">here</a>. List price: $79.95. (The page says “Ships in 3 to 4 weeks” but I think this is incorrect as the book is available; I&#8217;ll try to get the mention corrected.)</p>
<p>[3] Amazon.de page: see <a href="http://www.amazon.de/s/ref=nb_ss_w?__mk_de_DE=%C5M%C5Z%D5%D1&amp;url=search-alias%3Daps&amp;field-keywords=bertrand+meyer+touch+of+class&amp;x=0&amp;y=0">here</a>. List price: EUR 53.45 (with offers starting at EUR 41.67).</p>
<p>[4] Amazon.com page: see <a href="http://www.amazon.com/Touch-Class-Learning-Program-Contracts/dp/3540921443">here</a>. List price: $63.96.</p>
<p>[5] Michela Pedroni and Bertrand Meyer: <em>The Inverted Curriculum in Practice</em>, in <em>Proceedings of SIGCSE 2006</em>, ACM, Houston (Texas), 1-5 March 2006, pages 481-485; available <a href="http://se.ethz.ch/~meyer/publications/teaching/sigcse2006.pdf">online</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/shFZBJBauNM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/11/touch-of-class-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/11/touch-of-class-published/</feedburner:origLink></item>
		<item>
		<title>One cheer for incremental research</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/RGLY5pjI3IU/</link>
		<comments>http://bertrandmeyer.com/2009/08/10/one-cheer-for-incremental-research/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 23:53:25 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Essay]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[Darwin]]></category>
		<category><![CDATA[Einstein]]></category>
		<category><![CDATA[Galileo]]></category>
		<category><![CDATA[Ground-breaking]]></category>
		<category><![CDATA[Hoare]]></category>
		<category><![CDATA[Incremental]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Research funding]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=373</guid>
		<description><![CDATA[The world of research funding, always a little strange, has of late been prey to a new craze: paradigm-shift mania. We will only fund twenty curly-haired cranky-sounding visionaries in the hope that one of them will invent relativity. The rest of you — bit-players! Petty functionaries! Slaves toiling at incremental research!  — should be ashamed of even asking.
Take this from the [...]]]></description>
			<content:encoded><![CDATA[<p>The world of research funding, always a little strange, has of late been prey to a new craze: <em>paradigm-shift mania</em>. We will only fund twenty curly-haired cranky-sounding visionaries in the hope that one of them will invent relativity. The rest of you — bit-players! Petty functionaries! Slaves toiling at incremental research!  — should be ashamed of even asking.</p>
<p>Take this from the US National Science Foundation&#8217;s current description of funding for Computer Systems Research [1]:</p>
<blockquote><p><em>CSR-funded projects will enable significant progress on challenging high-impact problems, as opposed to incremental progress on familiar problems.</em></p></blockquote>
<p> The European Research Council is not to be left behind [2]:</p>
<blockquote>
<h4>Projects being highly ambitious, pioneering and unconventional</h4>
<p><em>Research proposed for funding to the ERC should aim high, both with regard to the ambition of the envisaged scientific achievements as well as to the creativity and originality of proposed approaches, including unconventional methodologies and investigations at the interface between established disciplines. Proposals should rise to pioneering and far-reaching challenges at the frontiers of the field(s) addressed, and involve new, ground-breaking or unconventional methodologies, whose risky outlook is justified by the possibility of a major breakthrough with an impact beyond a specific research domain/discipline. </em></p></blockquote>
<p>Frontiers! Breakthrough! Rise! Aim high! Creativity! Risk! Impact! Pass me the adjective bottle. Ground-breaking! Unconventional! Highly ambitious! Major! Far-reaching! Pioneering! Galileo and Pasteur only please &#8211; others need not apply.</p>
<p>As everyone knows including the people who write such calls, this is balderdash. First, 99.97% of all research (precise statistic derived from my own ground-breaking research, further funding welcome) is incremental. Second, when a “breakthrough&#8221; does happen — the remaining 0.03%  &#8212; it was often not planned as a breakthrough.</p>
<p>Incremental research is a most glorious (I have my own supply of adjectives) mode of doing science. Beginning PhD students can be forgiven for believing the myth of the lone genius who penetrates the secrets of time and space by thinking aloud during long walks with his best friend [3]; we all, at some stage, shared that delightful delusion. But every researcher, presumably including those who go on to lead research agencies,  quickly grows up and learns that it is not how things happen. You read someone else&#8217;s solution to a problem, and you improve on it. Any history of science will tell you that for every teenager who from getting hit by a falling apple intuits the structure of the universe there are hundreds of great researchers who look at the state of the art and decide they can do a trifle better.</p>
<p>Here is a still recent example, particularly telling because we have the account from the scientist himself. It would not be much of an exaggeration to characterize the entire field of program proving over the past four decades as a long series of variations on Tony Hoare&#8217;s 1969 Axiomatic Semantics paper [4]. Here Hoare&#8217;s recollection, from his Turing Award lecture [5]:</p>
<blockquote><p><em>In October 1968, as I unpacked my papers in my new home in Belfast, I came across an obscure preprint of an article by Bob Floyd entitled “Assigning Meanings to Programs.” What a stroke of luck! At last I could see a way to achieve my hopes for my research. Thus I wrote my first paper on the axiomatic approach to computer programming, published in the Communications of the ACM in October 1969.</em></p></blockquote>
<p>(See also note [6].) Had the research been submitted for funding, we can imagine the reaction: “<em>Dear Sir, as you yourself admit, Floyd has had the basic idea [7] and you are just trying to present the result better. This is incremental research; we are in the paradigm-shift business.</em>” And yet if Floyd had the core concepts right it is Hoare&#8217;s paper that reworked and extended them into a form that makes practical semantic specifications and proofs possible. Incremental research at its best.</p>
<p>The people in charge of research programs at the NSF and ERC are themselves scientists and know all this. How come they publish such absurd pronouncements? There are two reasons. One is the typical academic&#8217;s fascination with industry and its models. Having heard that venture capitalists routinely fund ten projects and expect one to succeed, they want to transpose that model to science funding; hence the emphasis on “risk”. But the transposition is doubtful because venture capitalists assess their wards all the time and, as soon as they decide a venture is not going to break out, they cut the funding overnight, often causing the company to go under. This does not happen in the world of science: most projects, and certainly any project that is supposed to break new ground, gets funded for a minimum of three to five years. If the project peters out, the purse-holder will only realize it after spending all the money.</p>
<p>The second reason is a sincere desire to avoid mediocrity. Here we can sympathize with the funding executives: they have seen too many “<em>here is my epsilon addition to the latest buzzword</em>” proposals. The last time I was at ECOOP, in 2005, it seemed every paper was about bringing some little twist to aspect-oriented programming. This kind of research benefits no one and it is understandable that the research funders want people to innovate. But telling submitters that every project has to be epochal (surprisingly, “<em>epochal</em>” is missing from the adjectives in the descriptions above  — I am sure this will soon be corrected) will not achieve this result.</p>
<p>It achieves something else, good neither for research nor for research funding: promise inflation. Being told that they have to be Darwin or nothing, researchers learn the game and promise the moon; they also get the part about “risk” and emphasize how uncertain the whole thing is and how high the likelihood it will fail. (Indeed, since — if it works — it will let cars run from water seamlessly extracted from the ambient air, <em>and</em> with the excedent produce free afternoon tea.)</p>
<p>By itself this is mostly entertainment, as no one believes the hyped promises. The real harm, however, is to honest scientists who work in the normal way, proposing to bring an important contribution to the  solution of an important problem. They risk being dismissed as small-timers with no vision.</p>
<p>Some funding agencies have kept their heads cool. How refreshing, after the above quotes, to read the general description of funding by the Swiss National Science Foundation [8]:</p>
<blockquote><p><em>The central criteria for evaluation are the scientific quality, originality and project methodology as well as qualifications and track record of the applicants. Grants are awarded on a competitive basis.</em></p></blockquote>
<p>In a few words, it says all there is to say. Quality, originality, methodology, and track record. Will the research be “<em>ground-breaking</em>” or “<em>incremental</em>”? We will know when it is done.</p>
<p>I am convinced that the other agencies will come to their senses and stop the paradigm-shift nonsense. One reason for hope is in the very excesses of the currently fashionable style. The European Research Council quote includes, by my count, nineteen ways of saying that proposals must be daring. Now it is a pretty universal rule of life that someone who finds it necessary to say the same thing nineteen times in a single paragraph does not feel sure about it. He is trying to convince himself. At some point the people in charge will realize that such hype does not breed breakthroughs; it breeds more hype.</p>
<p>Until that happens there is something that some of us can do: refuse to play the game. Of course we are all convinced that our latest idea is the most important one ever conceived by humankind, and we want to picture it in the most favorable light. But we should resist the promise inflation. Such honesty comes at a risk. (I still remember a project proposal, many years ago, which came back with glowing reviews: the topic was important, the ideas right, the team competent. The agency officer&#8217;s verdict: reject. The proposers are certain to succeed, so it&#8217;s not research.) For some people, there is really no choice but to follow the lead: if your entire career depends on getting external funding, no amount of exhortation will prevent you from saying what the purse-holders want to hear. But those of us who do have a choice (that is to say, will survive even if a project is rejected) should refuse the compromission. We should present our research ideas for what they are.</p>
<p>So: one cheer for incremental research.</p>
<p>Wait, isn&#8217;t the phrase supposed to be “<em><strong>two</strong></em> cheers” [9]?</p>
<p>All right, but let&#8217;s go at it incrementally. One and one-tenth cheer for incremental research. </p>
<h4>References</h4>
<p> </p>
<p>[1]  National Science Foundation, Division of Computer and Network Systems: <em>Computer Systems Research  (CSR)</em>, at <a href="http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=13385">http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=13385</a>.</p>
<p>[2] European Research Council:<em> Advanced Investigators Grant</em>, at <a href="http://erc.europa.eu/index.cfm?fuseaction=page.display&amp;topicID=66">http://erc.europa.eu/index.cfmfuseaction=page.display&amp;topicID=66</a>.</p>
<p>[3] The Berne years; see any biography of Albert Einstein.</p>
<p>[4] C.A.R. Hoare: <em>An axiomatic basis for computer programming</em>, in <em>Communications of the ACM</em>, vol. 12, no 10, pages 576–580,583, October 1969.</p>
<p>[5] C.A.R. Hoare: <em>The Emperor&#8217;s Old Clothes</em>, in <em>Communications of the ACM</em>, vol. 24, no.  2, pages 75 &#8211; 83, February 1981.</p>
<p>[6] In the first version of this essay I wrote &#8220;Someone should celebrate the anniversary!&#8221;. Moshe Vardi, editor of Communications of the ACM, has informed me that the October 2009 issue will include a retrospective by Hoare on the 1969 paper. I cannot wait to see it.</p>
<p>[7] Robert W. Floyd: <em>Assigning meanings to programs</em>, in <em>Proceedings of the American Mathematical Society Symposia on Applied Mathematics</em>, vol. 19, pp. 19–31, 1967.</p>
<p>[8] Swiss National Science Foundation:  <em>Projects – Investigator-Driven Research</em>, at <a href="http://www.snf.ch/E/funding/projects/Pages/default.aspx">http://www.snf.ch/E/funding/projects/Pages/default.aspx</a>. Disclosure: The SNSF kindly funds some of my research.</p>
<p>[9] E.M. Forster: <em>Two Cheers for Democracy</em>, Edward Arnold, 1951.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/RGLY5pjI3IU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/10/one-cheer-for-incremental-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/10/one-cheer-for-incremental-research/</feedburner:origLink></item>
		<item>
		<title>The good and the ugly</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/_kOH_Kq82kE/</link>
		<comments>http://bertrandmeyer.com/2009/08/06/the-good-and-the-ugly/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 20:51:00 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Essay]]></category>
		<category><![CDATA[Research evaluation]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[User interface design]]></category>
		<category><![CDATA[ACM]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[IEEE]]></category>
		<category><![CDATA[Journals]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=336</guid>
		<description><![CDATA[Once in a while one hits a tool that is just right. An example worth publicizing is the EasyChair system for conference management [1], which  — after a first experience as reviewer —  I have selected whenever I was in a position to make the choice for a new conference in recent years.
At first sight, [...]]]></description>
			<content:encoded><![CDATA[<p>Once in a while one hits a tool that is just right. An example worth publicizing is the EasyChair system for conference management [1], which  — after a first experience as reviewer —  I have selected whenever I was in a position to make the choice for a new conference in recent years.</p>
<p>At first sight, a conference management system does not seem so hard to put together; it is in fact a traditional project topic for software engineering courses. But this apparent simplicity is deceptive, as a usable system must accommodate countless small and large needs. To take just one example, you can be a member of a program committee for a conference and also submit a paper to it; this implies strict rules about what you can see, for example reviews of other people&#8217;s papers with the referees&#8217; names, and what you should not see. Taking care of myriad such rules and requirements requires in-depth domain knowledge about conferences, and a thorough analysis.</p>
<p>EasyChair is based on such an analysis. It knows what a conference is, and understands what its users need. Here for example is my login screen on EasyChair:</p>
<p style="text-align: center;"><a href="http://bertrandmeyer.com/wp-content/upLoads/easychair.jpg"><img class="aligncenter size-full wp-image-342" title="easychair" src="http://bertrandmeyer.com/wp-content/upLoads/easychair.jpg" alt="easychair" width="700" /></a></p>
<p>EasyChair knows about me: I only have one user name and one password. It knows the conferences in which I have been involved (and found them by itself). It knows about my various roles: chair, author etc., and will let me do different things depending on the role I choose.</p>
<p>The rest of the tool is up to the standards set by this initial screen. Granted, the Web design is very much vintage 1994; a couple of hours on the site by a professional graphics designer would not hurt, but, really, who cares? What matters is the functionality, and it is not by accident that EasyChair&#8217;s author is a brilliant logician [2]. Here is someone who truly understands the business of organizing and refereeing a conference, has translated this understanding into a solid logical model, and has at every step put himself in the shoes of the participants in the process. As a user you feel that everything has been done to make you feel comfortable  and perform efficiently, while protecting you from hassle.</p>
<p>Because this is all so simple and natural, you might forget that the system required extensive design. If you need proof, it suffices to consider, by contrast, the ScholarOne system, which as punishment for our sins both ACM and IEEE use for their journals.</p>
<p>Even after the last user still alive has walked away, ScholarOne will remain in the annals of software engineering, as a textbook illustration of how not to design a system and its user interface. Not the visuals; no doubt <em>that</em> site had a graphics designer. But everything is designed to make the system as repellent as possible for its users. You keep being asked for information that you have already entered. If you are a reviewer for <em>Communications of the ACM</em> and submit a paper to an IEEE Computer Society journal, the system does not remember you, since CACM has its own sub-site; you must re-enter everything. Since your identifier is your email address, you will have two passwords with the same id, which confuses the browser. (I keep forgetting the appropriate password, which the site obligingly emails me, <em>in clear</em>.) IEEE publications have a common page, but here is how it looks:</p>
<p style="TEXT-ALIGN: center"><a href="http://bertrandmeyer.com/wp-content/upLoads/scholarone-detail.jpg"><img class="aligncenter size-full wp-image-345" title="scholarone-detail" src="http://bertrandmeyer.com/wp-content/upLoads/scholarone-detail.jpg" alt="scholarone-detail" width="660" /></a></p>
<p style="TEXT-ALIGN: left">See the menu on the right? It is impossible  to see the full names of each of the &#8220;Transactio&#8230;&#8221;. (No tooltips, of course.) Assume you just want to know what one of them is, for example &#8220;th-cs&#8221;: if you select it you are prompted to provide all kinds of information (which you have entered before for other publications), before you can even proceed.</p>
<p style="TEXT-ALIGN: left">This user interface design (the minuscule menu, an example of what Scott Meyers calls the &#8220;<em>Keyhole problem</em>&#8221; [3]) is only a small part of usability flaws that plague the system. The matter is one of design: the prevailing viewpoint is that of the  designers and administrators, not the users. I was not really surprised when I found out that the system comes from the same source as the ISI Web of Science system (which should never be used for computer science, see [4]).</p>
<p style="TEXT-ALIGN: left">It is such a pleasure in contrast to see a system like EasyChair  — for all I know a one-man effort — with its attention to user needs, its profound understanding of the problem domain, and its constant improvements over the years.</p>
<h4>References</h4>
<p>[1] EasyChair system, at <a href="http://www.easychair.org" target="blog_illustrations">http://www.easychair.org</a>.</p>
<p>[2] Andrei Voronkov, <a href="http://www.voronkov.com/" target="blog_illustrations">http://www.voronkov.com/</a>.</p>
<p>[3] Scott Meyers, <em>The Keyhole Problem</em>, at <a href="http://www.aristeia.com/TKP/draftPaper.pdf" target="blog_illustrations">http://www.aristeia.com/TKP/draftPaper.pdf</a>; see also slides at <a href="http://se.ethz.ch/~meyer/publications/OTHERS/scott_meyers/keyhole.pdf" target="blog_illustrations">http://se.ethz.ch/~meyer/publications/OTHERS/scott_meyers/keyhole.pdf</a></p>
<p>[4]  Bertrand Meyer, Christine Choppy, Jan van Leeuwen, Jørgen Staunstrup: <em>Research Evaluation for Computer </em>Science, in  <em>Communications  of the ACM</em>, vol. 52, no. 4, pages 131-134, online at <a href="http://portal.acm.org/citation.cfm?id=1498765.1498780" target="blog_illustrations">http://portal.acm.org/citation.cfm?id=1498765.1498780</a> (requires subscription). Longer version, available at <a href="http://www.informatics-europe.org/docs/research_evaluation.pdf" target="blog_illustrations">http://www.informatics-europe.org/docs/research_evaluation.pdf</a> (free access).</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/_kOH_Kq82kE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/06/the-good-and-the-ugly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/06/the-good-and-the-ugly/</feedburner:origLink></item>
		<item>
		<title>Methods need theory</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/T3HydVge5GI/</link>
		<comments>http://bertrandmeyer.com/2009/08/06/methods-need-theory/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 18:45:43 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[General technology]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Methodology]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=332</guid>
		<description><![CDATA[&#8220;For someone in search of a software development method, the problem is not to find answers; it&#8217;s to find out how good the proposed answers are. We have lots of methods &#8212; every year brings its new harvest &#8212; but the poor practitioner is left wondering why last year&#8217;s recipe is not good enough after [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em>For someone in search of a software development method, the problem is not to find answers; it&#8217;s to find out how good the proposed answers are. We have lots of methods &#8212; every year brings its new harvest &#8212; but the poor practitioner is left wondering why last year&#8217;s recipe is not good enough after all, and why he or she has to embrace this year&#8217;s buzz instead. Anyone looking for serious conceptual arguments has to break through the hype and find the precious few jewels of applicable wisdom.</em>&#8221;</p>
<p>This is the start of an article that Ivar Jacobson and I just wrote for Dr. Dobb&#8217;s Journal;  it is available in the online edition [1] and will appear (as I understand) in the next paper edition. The article is a plea for a rational, science-based approach to software development methodology, and a call for others to join us in establishing a sound basis.</p>
<h4>Reference</h4>
<p>&nbsp;
<p>[1] Ivar Jacobson and Bertrand Meyer, <em>Methods Need Theory</em>, Dr. Dobb&#8217;s Journal, August 2009, <a href="http://www.ddj.com/architect/219100242" target="blog_illustrations">available online</a>.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/T3HydVge5GI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/06/methods-need-theory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/06/methods-need-theory/</feedburner:origLink></item>
		<item>
		<title>Void safety: Getting rid of the spectre of null-pointer dereferencing</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/WD0TyEJKMT8/</link>
		<comments>http://bertrandmeyer.com/2009/08/04/void-safety-getting-rid-of-the-spectre-of-null-pointer-dereferencing/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 21:22:22 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[ECMA]]></category>
		<category><![CDATA[ISO]]></category>
		<category><![CDATA[Null references]]></category>
		<category><![CDATA[Void safety]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=296</guid>
		<description><![CDATA[A spectre is haunting programming — the spectre of null-pointer dereferencing. All the programming languages of old Europe and the New World have entered into a holy alliance to make everyone&#8217;s programs brittle:  Java, C, Pascal, C++, C# and yes, until recently, Eiffel.
The culprit is the use of references to denote objects used in calls: in
 [...]]]></description>
			<content:encoded><![CDATA[<p>A spectre is haunting programming — the spectre of null-pointer dereferencing. All the programming languages of old Europe and the New World have entered into a holy alliance to make everyone&#8217;s programs brittle:  Java, C, Pascal, C++, C# and yes, until recently, Eiffel.</p>
<p>The culprit is the use of references to denote objects used in calls: in</p>
<pre>        <span style="color: #0000ff;"><em> x</em><span>.</span><em>f</em> (...)</span></pre>
<p>the value of <span style="color: #0000ff;"><em>x</em></span> is a reference, which normally denotes an object but could at any time be <strong>void</strong> (or &#8220;null&#8221;). If this happens, the resulting &#8220;<em>void call</em>&#8221; will cause an exception and, usually, a crash.  No amount of testing can remove the risk entirely; the only satisfactory solution is a static one, enforcing <strong>void safety</strong> at the language level.</p>
<p>To this end, Eiffelists of various nationalities have assembled in the Cloud and sketched the following manifesto, to be published in the English language:</p>
<pre>        <em>Avoid a Void: The Eradication of Null Dereferencing</em>
        Bertrand Meyer, Alexander Kogtenkov, Emmanuel Stapf
        White paper available <a href="http://docs.eiffel.com/sites/default/files/void-safe-eiffel.pdf">here</a>.</pre>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/WD0TyEJKMT8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/04/void-safety-getting-rid-of-the-spectre-of-null-pointer-dereferencing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/04/void-safety-getting-rid-of-the-spectre-of-null-pointer-dereferencing/</feedburner:origLink></item>
		<item>
		<title>Contracts written by people, contracts written by machines</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/C-rGu1O1dIM/</link>
		<comments>http://bertrandmeyer.com/2009/08/03/contracts-human-machines/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 03:17:46 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Eiffel]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[CITADEL]]></category>
		<category><![CDATA[Ciupa]]></category>
		<category><![CDATA[Contract inference]]></category>
		<category><![CDATA[Daikon]]></category>
		<category><![CDATA[Design by Contract]]></category>
		<category><![CDATA[Ernst]]></category>
		<category><![CDATA[Invariant]]></category>
		<category><![CDATA[Loop invariant]]></category>
		<category><![CDATA[Polikarpova]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=259</guid>
		<description><![CDATA[What kind of contract do you write? Could these contracts, or some of them, be produced automatically?
The idea of inferring contracts from programs is intriguing; it also raises serious epistemological issues. In fact, one may question whether it makes any sense at all. I will leave the question of principle to another post, in connection [...]]]></description>
			<content:encoded><![CDATA[<p>What kind of contract do you write? Could these contracts, or some of them, be produced automatically?</p>
<p>The idea of inferring contracts from programs is intriguing; it also raises serious epistemological issues. In fact, one may question whether it makes any sense at all. I will leave the question of principle to another post, in connection with some of our as yet unpublished work. This is, in any case, an active research field, in particular because of the big stir that Mike Ernst&#8217;s <em>Daikon</em> created when it appeared a few years ago.</p>
<p>Daikon [1] infers loop invariants <em>dynamically</em>: it observes executions; by looking up a repertoire of invariant patterns, it finds out what properties the loops maintain. It may sound strange to you (it did to Mike&#8217;s PhD thesis supervisor [2] when he first heard about the idea), but it yields remarkable results.</p>
<p>In a recent paper presented at ISSTA [3], we took advantage of Daikon to compare the kinds of contract people write with those that a machine could infer. The work started out as Nadia Polikarpova&#8217;s master&#8217;s thesis at ITMO  in Saint Petersburg [4], in the group of Prof. Anatoly Shalyto and under the supervision of Ilinca Ciupa from ETH. (Ilinca recently completed her PhD thesis on automatic testing [5], and is co-author of the article.) The CITADEL tool — the name is an acronym, but you will have to look up the references to see what it means — applies Daikon to Eiffel program.</p>
<p>CITADEL is the first application of Daikon to a language where programmers can write contracts. Previous interfaces were for contract-less languages such as Java where the tool must synthesize everything. In Eiffel, programmers do write contracts (as confirmed by Chalin&#8217;s experimental study [6]). Hence the natural questions: does the tool infer the same contracts as a programmer will naturally write? If not, which kinds of contract is each best at?</p>
<p>To answer these questions, the study looked at three sources of contracts:</p>
<ul>
<li>Contracts already present in the code (in the case of widely used libraries such as EiffelBase, equipped with contracts throughout).</li>
<li>Those devised by students, in a small-scale experiment.</li>
<li>The contracts inferred by Daikon.</li>
</ul>
<p>What do you think? Before looking up our study, you might want to make your own guess at the answers. You will not find a spoiler here; for the study&#8217;s results, you should read our paper [3]. All right, just a hint: machines and people are (in case you had not noticed this before) good at different things.</p>
<p> </p>
<h4>References</h4>
<p> </p>
<p>[1] Michael Ernst and others, Daikon bibliography on <a href="http://www.cs.washington.edu/homes/mernst/research/#Invariant_detection">Ernst&#8217;s research page </a>at the University of Washington.</p>
<p>[2] David Notkin, see his <a href="http://www.cs.washington.edu/homes/notkin/">web page</a>.</p>
<p>[3] A<em> Comparative Study of Programmer-Written and Automatically Inferred Contracts</em>, by Nadia Polikarpova, Ilinca Ciupa and me, in <em>ISSTA 2009: International Symposium on Software Testing and Analysis</em>, Chicago, July 2009, <a href="http://se.ethz.ch/~meyer/publications/testing/citadel-issta.pdf">online copy available</a>.</p>
<p>[4] ITMO (Saint-Petersburg State University of Information Technologies, Mechanics and Optics), see <a href="http://www.ifmo.ru/">here</a>.</p>
<p>[5] Ilinca Ciupa, <em>Strategies for random contract-based testing;</em> PhD thesis, ETH Zurich, December 2008. For a link to the text and to her other publications see Ilinca&#8217;s <a href="http://se.inf.ethz.ch/people/ciupa/">ETH page</a>.</p>
<p>[6] Patrice Chalin,  <em>Are practitioners writing contracts</em>? In <em>Rigorous</em> <em>Development of Complex Fault-Tolerant Systems</em>, eds. Jones et al.,  Lecture Notes in Computer Science 4157, Springer Verlag, 2006, pages 100-113.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/C-rGu1O1dIM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/03/contracts-human-machines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/03/contracts-human-machines/</feedburner:origLink></item>
		<item>
		<title>Long AND clear?</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/WivD27-dEKc/</link>
		<comments>http://bertrandmeyer.com/2009/08/03/long-and-clear/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 23:51:46 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Recycled]]></category>
		<category><![CDATA[Writing and style]]></category>
		<category><![CDATA[Autological]]></category>
		<category><![CDATA[Proust]]></category>
		<category><![CDATA[Style]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=176</guid>
		<description><![CDATA[ (Originally a Risks forum posting, 1998.)
Although complaints about Microsoft Word&#8217;s eagerness to correct what it sees as mistakes are not new in the Risks forum, I think it is still useful to protest vehemently the way recent versions of Word promote the dumbing down of English writing by flagging (at least when you use their [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bertrandmeyer.com/about/"></a><a href="http://bertrandmeyer.com/wp-content/upLoads/recycled-small1.jpg"><img class="alignnone size-full wp-image-320" title="recycled-small" src="http://bertrandmeyer.com/wp-content/upLoads/recycled-small1.jpg" alt="recycled-small" width="15" height="14" /></a> (Originally a <a href="http://catless.ncl.ac.uk/Risks/20.07.html#subj13.1">Risks forum posting</a>, 1998.)</p>
<p>Although complaints about Microsoft Word&#8217;s eagerness to correct what it sees as mistakes are not new in the Risks forum, I think it is still useful to protest vehemently the way recent versions of Word promote the dumbing down of English writing by flagging (at least when you use their default options) any sentence that, according to some mysterious criterion, it deems too long, even if the sentence is made of several comma- or semicolon-separated clauses, and even though it is perfectly obvious to anyone, fan of Proust or not, that clarity is not a direct function of length, since it is just as easy to write obscurely with short sentences as with longish ones and, conversely, quite possible to produce an absolutely limpid sentence that is very, very long.</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/WivD27-dEKc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/03/long-and-clear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/03/long-and-clear/</feedburner:origLink></item>
		<item>
		<title>Computer technology: making mozzies out of betties</title>
		<link>http://feedproxy.google.com/~r/BertrandMeyer/~3/stV7-eCtQf8/</link>
		<comments>http://bertrandmeyer.com/2009/08/02/computer-technology-making-mozzies-out-of-betties/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 20:11:08 +0000</pubDate>
		<dc:creator>Bertrand Meyer</dc:creator>
				<category><![CDATA[Essay]]></category>
		<category><![CDATA[General technology]]></category>
		<category><![CDATA[Writing and style]]></category>
		<category><![CDATA[Beethoven]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[Computer-Aided Design]]></category>
		<category><![CDATA[Mozart]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://bertrandmeyer.com/?p=215</guid>
		<description><![CDATA[Are you a Beethoven or a Mozart? If you&#8217;ll pardon the familarity, are you more of a betty or more of a mozzy? I am a betty. I am not referring to my musical abilities but to my writing style; actually, not the style of my writings (I haven&#8217;t completed any choral fantasies yet) but [...]]]></description>
			<content:encoded><![CDATA[<p>Are you a Beethoven or a Mozart? If you&#8217;ll pardon the familarity, are you more of a betty or more of a mozzy? I am a betty. I am not referring to my musical abilities but to my writing style; actually, not the style of my writings (I haven&#8217;t completed any choral fantasies yet) but the style of my writing <em>process</em>. Mozart is famous for impeccable manuscripts; he could be writing in a stagecoach bumping its way through the Black Forest, on the kitchen table in the miserable lodgings of his second, ill-fated Paris trip, or in the antechamber of Archbishop Colloredo — no matter: the score comes out immaculate, not reflecting any of the doubts, hesitations and remorse that torment mere mortals. <a href="http://bertrandmeyer.com/wp-content/upLoads/Beethoven.jpg"></a></p>
<p style="text-align: center;"> <a href="http://bertrandmeyer.com/wp-content/upLoads/Mozart.jpg"><img title="Mozart" src="http://bertrandmeyer.com/wp-content/upLoads/Mozart-198x300.jpg" alt="Mozart" width="198" height="300" /></a></p>
<p>Beethoven&#8217;s music, note-perfect in its final form, came out of a very different process. Manuscripts show notes overwritten, lines struck out in rage, pages torn apart. He wrote and rewrote and gave up and tried again and despaired and came back until he got it the way it had to be.</p>
<p style="text-align: center;"><a href="http://bertrandmeyer.com/wp-content/upLoads/Beethoven.jpg"><img title="Beethoven" src="http://bertrandmeyer.com/wp-content/upLoads/Beethoven.jpg" alt="Beethoven" width="250" height="181" /></a></p>
<p>How I sympathize! I seldom get things right the first time, and when I had to use a pen and paper I  almost never could produce a clean result; there always was one last detail to change. As soon as I could, I got my hands on typewriters, which removed the effects of ugly handwriting, but did not solve the problem of second thoughts followed by third thoughts and many more. Only with computers did it become possible to work sensibly. Even with a primitive text editor, the ability to try out ideas then correct and correct and correct is a profound change of the creation process. Once you have become used to the electronic medium, using a pen and paper seems as awkard and insufferable as, for someone accustomed to driving a car, being forced to travel in an oxen cart.</p>
<p>This liberating effect, the ability to work on your creations as a sculptor kneading an infinitely malleable material, is one of the greatest contributions of computer technology. Here we are talking about text, but the effect is just as profound on other media, as any architect or graphic artist will testify.</p>
<p>The electronic medium does not just give us more convenience; it changes the nature of writing (or composing, or designing). With paper, for example, there is a great practical difference between introducing new material at the end of the existing text,  which is easy, and inserting it at some unforeseen position, which is cumbersome and sometimes impossible. With computerized tools, it doesn&#8217;t matter. The change of medium changes the writing process and ultimately the writing: with paper the author ends up censoring himself to avoid practically painful revisions; with software tools, you work in whatever order suits you.</p>
<p>Technical texts, with their numbered sections and subsections, are another illustration of the change: with a text processor you do not need to come up with the full plan first, in an effort avoid tedious renumbering later. You will use such a top-down scheme if it fits your natural way of working, but you can use any other  one you like, and renumber the existing sections at the press of a key. And just think of the pain it must have been to produce an index in the old days: add a page (or, worse, a paragraph, since it moves the following ones in different ways) and you would  have to recheck every single entry.</p>
<p>Recent Web tools have taken this evolution one step further, by letting <em>several</em> people revise a text collaboratively and concurrently (and, thanks to the marvels of  longest-common-subsequence algorithms and the resulting <em>diff</em> tools, retreat to an earlier version if in our enthusiasm to change our design we messed it up) . Wikis and Google Docs are the most impressive examples of these new techniques for collective revision.</p>
<p>Whether used by a single writer or in a collaborative development, computer tools have changed the very process of creation by freeing us from the tyranny of physical media and driving to zero the logistic cost of  one or a million changes of mind. For the betties among us, not blessed with an inborn ability to start at A, smoothly continue step by step, and end at Z, this is a life-changer. We can start where we like, continue where we like, and cover up our mistakes when we discover them. It does not matter how messy the process is, how many virtual pages we tore away, how much scribbling it took to bring a paragraph to a state that we like: to the rest of the world, we can present a result as pristine as the manuscript of a Mozart concerto.</p>
<p>These advances are not appreciated enough; more importantly, we do not take take enough advantage of them. It is striking, for example, to see that blogs and other Web pages too often remain riddled with typos and easily repairable mistakes. This is undoubtedly because the power of computer technology tempts us to produce ever more documents and in the euphoria to neglect the old ones. But just as importantly that technology empowers  us to go back and improve. The old schoolmaster&#8217;s advice — revise and revise again [1] — can no longer  be dismissed as an invitation to fruitless perfectionism; it is right, it is fun to apply, and at long last it is feasible.</p>
<h4>Reference</h4>
<p>&nbsp;
<p>[1] &#8220;<em>Vingt fois sur le métier remettez votre ouvrage</em>&#8221; (Twenty times back to the loom shall you bring your design), Nicolas Boileau</p>
<img src="http://feeds.feedburner.com/~r/BertrandMeyer/~4/stV7-eCtQf8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bertrandmeyer.com/2009/08/02/computer-technology-making-mozzies-out-of-betties/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://bertrandmeyer.com/2009/08/02/computer-technology-making-mozzies-out-of-betties/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.282 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-02 10:15:09 -->
