<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Software Tools</title>
	<atom:link href="http://swtools.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://swtools.wordpress.com</link>
	<description>Do one thing well, and work together.</description>
	<lastBuildDate>Sun, 03 Jul 2011 22:06:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='swtools.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Software Tools</title>
		<link>http://swtools.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://swtools.wordpress.com/osd.xml" title="Software Tools" />
	<atom:link rel='hub' href='http://swtools.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Credo example: from lex and c source to cygwin executable, across directories</title>
		<link>http://swtools.wordpress.com/2011/07/03/credo-example-from-lex-and-c-source-to-cygwin-executable-across-directories/</link>
		<comments>http://swtools.wordpress.com/2011/07/03/credo-example-from-lex-and-c-source-to-cygwin-executable-across-directories/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 19:51:22 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=250</guid>
		<description><![CDATA[This article walks through building a trivial example of lex source code into C, and then compiling the generated C source code into object files and an executable in a different directory. The point is to demonstrate using dodep to generate and customize build scripts and list dependencies, and credo to execute the build process. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=250&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This article walks through building a trivial example of lex source<br />
code into C, and then compiling the generated C source code into<br />
object files and an executable in a different directory.  The point is<br />
to demonstrate using <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/dis/dodep" title="/dis/dodep">dodep</a> to generate and customize build scripts<br />
and list dependencies, and <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/dis/credo" title="/dis/credo">credo</a> to execute the build process.</p>
<p>Lines which start with ; are shell commands; lines without are output.<br />
Key commands are displayed in red text.</p>
<p><strong>Starting state</strong></p>
<p>We start with the files <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/test/1/credo/lex/lorem" title="lorem">lorem</a>, <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/test/1/credo/lex/src/dcr.l" title="src/dcr.l">src/dcr.l</a>, <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/test/1/credo/lex/src/header.c" title="src/header.c">src/header.c</a>, <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/test/1/credo/lex/src/lex.h" title="src/lex.h">src/lex.h</a>,<br />
and an empty <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/test/1/credo/lex/#lex%2Fobj" title="obj/">obj</a> directory.  Each line of lorem ends with a<br />
carriage return (not usually printed), which we want to strip.<br />
header.c is an ordinary C source file to compile and link.<br />
lex.h gives us a local header to look for.</p>
<p><strong>Generate source code</strong></p>
<p><code>; cd src<br />
; <font color="#ff0000">echo flex &gt; dcr.c.lex.env</font></code></p>
<p>We first go into the src directory, and set the lex shell variable to flex,<br />
to specify which lexer to use. To demonstrate an unusual feature,<br />
that would be valid across ports to different operating systems,¹<br />
we’ll capture it with this command.<br />
 ¹ Inferno and Plan 9 store variables by name in the directory <a href="http://www.vitanuova.com/inferno/man/3/env.html" title="/env">/env</a>,<br />
different for each process.  This gives it a definite advantage in<br />
capturing dependencies on variables, since we can just list the name<br />
of the shell-variable file as a dependency.</p>
<p><code>src/dcr.c.lex.env:1: flex</code></p>
<p>This setting applies (is transformed into a shell variable) when credo<br />
processes the target dcr.c, if dcr.c depends on /env/lex.</p>
<p><code>; <font color="#ff0000">dodep (c lex l c) dcr.c</font><br />
credo dcr.c</code></p>
<p>We ask dodep to generate a shell script and list of dependencies with<br />
this command.  The content of these files comes from <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/#hg%2Flib%2Fdo" title="/lib/do in jasoncatena-acmesac">a library</a>,<br />
indexed by the four parameters given before the name of the file we<br />
want to build.  In this case, we want to look in the “c” namespace,<br />
at the command “lex”, to translate an “l” file to a “c” file.</p>
<p>The generated dependency list includes the name of the lex source file,<br />
and references to the variables lex and lflags.</p>
<p><code>src/dcr.c.dep:1: 0 dcr.l<br />
src/dcr.c.dep:2: 0 /env/lex<br />
src/dcr.c.dep:3: 0 /env/lflags</code></p>
<p>Credo passes the name of its target, the C source file, to the shell script,<br />
which prints the name of the C source file if it was able to create it.</p>
<p><code>src/dcr.c.do:1: #!/dis/sh<br />
src/dcr.c.do:2: c = $1<br />
src/dcr.c.do:3: (sum l) = `{grep '\.l$' $c^.dep}<br />
src/dcr.c.do:4:<br />
src/dcr.c.do:5: if {no $lex} {lex = lex}<br />
src/dcr.c.do:6:<br />
src/dcr.c.do:7: if {<br />
src/dcr.c.do:8: flag x +<br />
src/dcr.c.do:9: os -T $lex $lflags $l<br />
src/dcr.c.do:10: mv lex.yy.c $c<br />
src/dcr.c.do:11: } {<br />
src/dcr.c.do:12: echo $c<br />
src/dcr.c.do:13: }</code></p>
<p>The hosted-Inferno command <a href="http://www.vitanuova.com/inferno/man/1/os.html" title="os(1)">os</a> calls host-OS commands.  Under Cygwin,<br />
it calls Cygwin or Windows commands.</p>
<p>Dodep finally prints a credo command to build the requested target.</p>
<p><code>; <font color="#ff0000">credo dcr.c</font><br />
credo dcr.l<br />
credo dcr.c<br />
os -T flex dcr.l<br />
mv lex.yy.c dcr.c<br />
dcr.c</code></p>
<p>Credo builds all its non-/env dependencies in parallel. Once these<br />
are complete, it determines whether the checksum of each file on which<br />
it depends is different than the checksum stored for that file the<br />
last time credo built this target.</p>
<p>This credo command creates a build-avoidance marker file dcr.l.redont,<br />
which tells further runs of credo that the file dcr.l does not need<br />
any processing, so exit early. It calls the host’s flex program,<br />
on the path set when the Inferno environment started, to create the<br />
target file dcr.c.</p>
<p>It updates the check sums in the file dcr.c.dep, to reflect content at<br />
the time of compilation. This means that each target has its own view<br />
of its dependencies, and any change to any file on which it depends,<br />
or a change to the list of files on which it depends, prompts the<br />
target to rebuild.</p>
<p><code>src/dcr.c.dep:1: 79f9925952d9cfb5a58270c0e2b67691 dcr.l<br />
src/dcr.c.dep:2: 897a779351421523cadbafccdce22efe /env/lex<br />
src/dcr.c.dep:3: 0 /env/lflags</code></p>
<p>It creates these checksum files to detect any changes to the target’s<br />
dependencies or build script.</p>
<p><code>src/dcr.c.dep.sum:1: c33129421847b7d897d4e244caf1b8c0 dcr.c.dep</code></p>
<p><code>src/dcr.c.do.sum:1: 71d94d651922bd5ff5b543bba52f47d0 dcr.c.do</code></p>
<p>It also checksums the target file itself. If credo finds, the next<br />
time it runs, that the current checksum of the target does not match,<br />
then it assumes that the target was changed by hand, and will not<br />
overwrite it.</p>
<p><code>src/dcr.c.sum:1: 2fed3667f390fd80993e090a7eb92c75 dcr.c</code></p>
<p><strong>Compile objects and executable</strong></p>
<p>We now have all the source, so we go to the object-file and executable<br />
directory, and ask dodep to provide do and dep files to build dcr.exe.<br />
From the “c”-language toolset, we use “cc” to compile an “o”bject file<br />
into an “exe”cutable.</p>
<p><code>; cd ../obj<br />
; <font color="#ff0000">dodep (c cc o exe) dcr.exe</font><br />
credo dcr.exe</code></p>
<p>This time the dodep command created two *.do files, dcr.exe.dep.do and<br />
dcr.exe.do, instead of a do and dep file for the target dcr.exe.</p>
<p><code>obj/dcr.exe.dep.do:1: #!/dis/sh<br />
obj/dcr.exe.dep.do:2: dep = $1<br />
obj/dcr.exe.dep.do:3: exe = `{echo $dep | sed 's,\.dep,,'}<br />
obj/dcr.exe.dep.do:4: (stem ext o) = `{crext o $exe}<br />
obj/dcr.exe.dep.do:5:<br />
obj/dcr.exe.dep.do:6: adddep $exe /env/ars /env/cc /env/cflags /env/ldflags /env/objs<br />
obj/dcr.exe.dep.do:7: adddep $exe $o<br />
obj/dcr.exe.dep.do:8: adddep $exe `{/lib/do/c/coneed $o}</code></p>
<p>dcr.exe.dep.do creates the dependency list dcr.exe.dep for the target<br />
dcr.exe by adding a set of credo-specific (ars and objs) and standard<br />
(cc, cflags, and ldflags) shell variables; the primary object file,<br />
named for the executable; and any other object files which the primary<br />
one needs. The tool <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/c/coneed" title="/lib/do/c/coneed">coneed</a> does this last bit of analysis by compiling<br />
the primary object file, looking for unresolved symbols in available<br />
source code, compiling the source code to make sure, and printing the<br />
set of matching object files.</p>
<p><code>obj/dcr.exe.do:1: #!/dis/sh<br />
obj/dcr.exe.do:2: exe = $1<br />
obj/dcr.exe.do:3: if {no $cc} {cc = cc}<br />
obj/dcr.exe.do:4: if {<br />
obj/dcr.exe.do:5: flag x +<br />
obj/dcr.exe.do:6: os -T $cc $cflags -o $exe $objs $ars $ldflags<br />
obj/dcr.exe.do:7: } {<br />
obj/dcr.exe.do:8: echo os -T ./$exe<br />
obj/dcr.exe.do:9: }</code></p>
<p>To gather enough information to compile the executable, credo relays<br />
information from dependencies back to calling targets through *.relay<br />
files, which are shell scripts that set the environment for calling targets.</p>
<p>Finally, to start the build process, we locate the source code,<br />
record which compilation tools to use, and again call credo.</p>
<p><code>; <font color="#ff0000">srcdir = ../src/</font><br />
; <font color="#ff0000">echo cpp-3 &gt; default.cpp.env</font><br />
; <font color="#ff0000">echo -I../src/ &gt; default.cppflags.env</font><br />
; <font color="#ff0000">echo gcc-3 &gt; default.cc.env</font><br />
; <font color="#ff0000">credo dcr.exe</font><br />
credo dcr.exe.dep<br />
os -T gcc-3 -I../src/ -c ../src/dcr.c<br />
os -T gcc-3 -I../src/ -c ../src/header.c<br />
credo dcr.o.dep<br />
credo dcr.o<br />
credo header.o.dep<br />
credo header.o<br />
credo dcr.exe<br />
os -T gcc-3 -o dcr.exe dcr.o header.o<br />
os -T ./dcr.exe</code></p>
<p>Credo first runs dcr.exe.dep.do to find and store the dependencies of<br />
dcr.exe in dcr.exe.dep. dcr.exe.dep is an implicit dependency of dcr.exe,<br />
so credo runs its *.do script automatically.</p>
<p><code>obj/dcr.exe.dep:1: 0 /env/ars<br />
obj/dcr.exe.dep:2: 131eb9ab2f6a65b34e0158de1b321e3c /env/cc<br />
obj/dcr.exe.dep:3: 0 /env/cflags<br />
obj/dcr.exe.dep:4: 0 /env/ldflags<br />
obj/dcr.exe.dep:5: 84a1a3c306e006dd723bebe9df29ee6c /env/objs<br />
obj/dcr.exe.dep:6: 3f0d90c1c7483ad1805080cf9e48d050 dcr.o<br />
obj/dcr.exe.dep:7: 1db618b791dc87ac0bd5504f69434273 header.o</code></p>
<p>Coneed uses $srcdir to find dcr.c, and the setting of cppflags in<br />
default.cppflags.env to find lex.h. Once coneed compiles dcr.o,<br />
it finds the unresolved symbol for the header function, finds a<br />
definition of header() in header.c, and compiles header.o to verify<br />
that it defines the symbol. Coneed finds no other unresolved symbols<br />
supplied by other source code in $srcdir (c.f. printf), so it stops.<br />
Coneed uses “dodep (c cc c o)” to compile the source code in $srcdir<br />
into object files in the current directory (obj). This generates<br />
*.o.dep.do and *.o.do for each source file: those for dcr are shown,<br />
the ones for header are identical.</p>
<p><code>obj/dcr.o.dep.do:1: #!/dis/sh<br />
obj/dcr.o.dep.do:2: dep = $1<br />
obj/dcr.o.dep.do:3: o = `{echo $dep | sed 's,\.dep,,'}<br />
obj/dcr.o.dep.do:4: (stem ext c) = `{crext c $srcdir^$o}<br />
obj/dcr.o.dep.do:5:<br />
obj/dcr.o.dep.do:6: adddep $o /env/cc /env/cflags /env/cppflags<br />
obj/dcr.o.dep.do:7: adddep $o $c<br />
obj/dcr.o.dep.do:8: adddep $o `{/lib/do/c/findh $c}</code></p>
<p><code>obj/dcr.o.do:1: #!/dis/sh<br />
obj/dcr.o.do:2: o = $1<br />
obj/dcr.o.do:3: (sum c) = `{grep '\.c$' $o^.dep}<br />
obj/dcr.o.do:4:<br />
obj/dcr.o.do:5: if {no $cc} {cc = cc}<br />
obj/dcr.o.do:6:<br />
obj/dcr.o.do:7: if {<br />
obj/dcr.o.do:8: flag x +<br />
obj/dcr.o.do:9: os -T $cc $cflags $cppflags -c $c<br />
obj/dcr.o.do:10: } {<br />
obj/dcr.o.do:11: echo 'objs = $objs '^$o &gt; $o^.relay<br />
obj/dcr.o.do:12: }</code></p>
<p>Before credo runs dcr.o.do it runs dcr.o.dep.do to generate dcr.o.dep<br />
(header.o likewise). To find the paths to C header files it calls <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/c/findh" title="/lib/do/c/findh">findh</a>,<br />
which gathers header-file #includes from the C source files,<br />
and searches for them in local and system directories using cppflags<br />
and the search list printed by $cpp -v.</p>
<p><code>obj/dcr.o.dep:1: 131eb9ab2f6a65b34e0158de1b321e3c /env/cc<br />
obj/dcr.o.dep:2: 0 /env/cflags<br />
obj/dcr.o.dep:3: 9134215aef7b4657beb5c4bb7a20d4a1 /env/cppflags<br />
obj/dcr.o.dep:4: 2fed3667f390fd80993e090a7eb92c75 ../src/dcr.c<br />
obj/dcr.o.dep:5: feea1fa232f248baa7a7d07743ee86c4 ../src/lex.h<br />
obj/dcr.o.dep:6: fb584676de41ee148c938983b2338f5b /n/C/cygwin/usr/include/stdio.h<br />
obj/dcr.o.dep:7: f6409b1008743b1866d4ad8e53f925cc /n/C/cygwin/usr/include/string.h<br />
obj/dcr.o.dep:8: 468b1dd86fef03b044dceea020579940 /n/C/cygwin/usr/include/errno.h<br />
obj/dcr.o.dep:9: 4e6678324ba6b69666eba8376069c950 /n/C/cygwin/usr/include/stdlib.h<br />
obj/dcr.o.dep:10: c7575313e03e7c18f8c84a5e13c01118 /n/C/cygwin/usr/include/inttypes.h<br />
obj/dcr.o.dep:11: a8fd5fa102b8f74d1b96c6c345f0e22d /n/C/cygwin/usr/include/unistd.h</code></p>
<p><code>obj/header.o.dep:1: 131eb9ab2f6a65b34e0158de1b321e3c /env/cc<br />
obj/header.o.dep:2: 0 /env/cflags<br />
obj/header.o.dep:3: 9134215aef7b4657beb5c4bb7a20d4a1 /env/cppflags<br />
obj/header.o.dep:4: ecd87752a211e69078e6bc37afbb561b ../src/header.c<br />
obj/header.o.dep:5: feea1fa232f248baa7a7d07743ee86c4 ../src/lex.h<br />
obj/header.o.dep:6: fb584676de41ee148c938983b2338f5b /n/C/cygwin/usr/include/stdio.h</code></p>
<p>At this point credo has the dependencies for dcr.exe, so it works<br />
through them, calling the *.relay files—generated by the object files’<br />
do scripts—to gather object names in $objs.</p>
<p><code>obj/dcr.o.relay:1: objs = $objs dcr.o</code></p>
<p><code>obj/header.o.relay:1: objs = $objs header.o</code></p>
<p>There&#8217;s not much to do since coneed already compiled the object files,<br />
so it links them, and prints an os command to run the executable,<br />
since Inferno can’t directly run a Cygwin executable.</p>
<p><strong>Clean up</strong></p>
<p>To clean up, we remove generated files in the src and obj directories.</p>
<p><code>; <font color="#ff0000">rm -f *.redoing *.redont *.renew *.reold *.sum</font></code></p>
<p><a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/credo/rm-f.state..do" title="/lib/do/credo/rm-f.state..do">This</a> removes all the temporary state files created by credo.<br />
Once this is done credo will rebuild from scratch, and reconstruct<br />
each target’s view of its dependencies.</p>
<p><code>; <font color="#ff0000">rm -f `{lsdo | sed 's,^c?redo ,,'}</font></code></p>
<p><a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/credo/rm-f.target..do" title="/lib/do/credo/rm-f.target..do">This</a> removes all the targets created by do scripts. The lsdo command<br />
(called by credo with no targets) prints credo commands for all the<br />
credo targets in the current directory. For example:</p>
<p><code>; cd src; credo<br />
credo dcr.c</code></p>
<p><code>; cd obj; credo<br />
credo dcr.exe<br />
credo dcr.exe.dep<br />
credo dcr.o<br />
credo dcr.o.dep<br />
credo header.o<br />
credo header.o.dep</code></p>
<p>Once the targets are removed, credo will unconditionally generate them.</p>
<p><code>; <font color="#ff0000">rm -f *.do *.dep *.relay</font></code></p>
<p><a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/credo/rm-f.dodep..do" title="/lib/do/credo/rm-f.dodep..do">This</a> removes all the instructions credo uses to build files.<br />
These may usually be regenerated by dodep, <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/dis/adddep" title="/dis/adddep">adddep</a> (which adds<br />
to the given target’s dependency list the given files), and<br />
<a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/dis/rmdep" title="/dis/rmdep">rmdep</a> (which removes the given files).</p>
<p>A single library <a href="http://code.google.com/r/jasoncatena-acmesac/source/browse/lib/do/credo/rm-f.std..do" title="/lib/do/credo/rm-f.std..do">script</a> is provided to remove the state, target,<br />
and dodep files.</p>
<p><code>; <font color="#ff0000">rm -f *.env</font></code></p>
<p>This removes default and per-target environment settings.</p>
<p>Once we remove these sets of files, the directories contain only the<br />
files present in their starting state.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/250/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=250&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2011/07/03/credo-example-from-lex-and-c-source-to-cygwin-executable-across-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Age: absolutely minimal version control</title>
		<link>http://swtools.wordpress.com/2010/05/10/age-absolutely-minimal-version-control/</link>
		<comments>http://swtools.wordpress.com/2010/05/10/age-absolutely-minimal-version-control/#comments</comments>
		<pubDate>Mon, 10 May 2010 21:51:08 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=222</guid>
		<description><![CDATA[The timing of this post was inspired by a rant against git by Mike Taylor. Here’s a version-control system in two rc (Plan 9 shell) scripts. Age copies files (without certain derived files such as objects and archives) to a backup directory under the current directory, and stores in that directory a tgz for distribution. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=222&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The timing of this post was inspired by <a href="http://reprog.wordpress.com/2010/05/10/git-is-a-harrier-jump-jet-and-not-in-a-good-way/">a rant against git</a> by Mike Taylor.</p>
<p>Here’s a version-control system in two rc (Plan 9 shell) scripts. <a href="http://dl.dropbox.com/u/502901/age">Age</a> copies files (without certain derived files such as objects and archives) to a backup directory under the current directory, and stores in that directory a tgz for distribution. <a href="http://dl.dropbox.com/u/502901/aged">Aged</a> gives you a contextual difference of files changed since your last save. (There&#8217;s also little scripts called <a href="http://dl.dropbox.com/u/502901/stardate">stardate</a> and <a href="http://dl.dropbox.com/u/502901/monnum">monnum</a> that print YYYYMMDD.)</p>
<p>It’s got about none of git’s features, and is woefully inefficient, but it does one thing really well: have a backup when you make a bad change, if you use it regularly.  I&#8217;ve used this for a few weeks, and it&#8217;s Good Enough.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=222&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2010/05/10/age-absolutely-minimal-version-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>nb—search and index notes in files by keyword</title>
		<link>http://swtools.wordpress.com/2010/03/05/nb%e2%80%94search-and-index-notes-in-files-by-keyword/</link>
		<comments>http://swtools.wordpress.com/2010/03/05/nb%e2%80%94search-and-index-notes-in-files-by-keyword/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:34:12 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=212</guid>
		<description><![CDATA[[Download a UTF-8 version of this file.] nb name search index keyword nb—search and index notes in files by keyword nb keyword nb description search keyword path file line acme Nb searches for the given keyword in each nbindex file listed in $HOME/nbindexes. If it finds a match, nb prints the path, filename, and line [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=212&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>[Download a UTF-8 version of <a href="http://dl.dropbox.com/u/502901/nb.1">this file</a>.]</p>
<pre>
nb name search index keyword
nb—search and index notes in files by keyword

nb keyword

nb description search keyword path file line acme
Nb searches for the given keyword in each nbindex file listed in
$HOME/nbindexes.  If it finds a match, nb prints the path, filename,
and line number of the indexed file in the format acme uses to refer to
lines in a file.

nb file format store index line path file line acme nbindexes
This file is an example.  Nb searches all files in the current directory
for lines which begin “^nb ”, and copies them into the file nbindex.
Each match is listed with its filename, and line number, e.g. for acme
to show the line on a right-click of the mouse.  It then adds the
path and filename of the current directory’s nbindex file to the file
$HOME/nbindexes.

By convention I use 1 blank line to separate paragraphs after an nb
line, and 2 blank lines to separate nb lines, but nb doesn’t care about
this.

nb nbindex example search keyword
This is the nbindex file for this file.

	nb.1:1 name search index keyword
	nb.1:5 keyword
	nb.1:8 description search keyword path file line acme
	nb.1:15 file format store index line path file line acme nbindexes
	nb.1:28 nbindex example search keyword
	nb.1:50 source plan9port rc script
	nb.1:70 port plan9port rc shell script grëp
	nb.1:75 author jason.catena@gmail.com
	nb.1:78 bugs

This is the output of the command “nb keyword”.  It lists the full
path since it may refer to files anywhere in the filesystem.

	/usr/local/plan9/bin/nb.1:1 name search index keyword
	/usr/local/plan9/bin/nb.1:5 keyword
	/usr/local/plan9/bin/nb.1:8 description search keyword path file line acme
	/usr/local/plan9/bin/nb.1:28 nbindex example search keyword

nb source plan9port rc script
#!/usr/local/plan9/bin/rc
flag e +

catalog=$HOME^'/nbindexes'
if(test -r $catalog &amp;&amp; ! ~ $1 ''){
	list=`{cat $catalog}
	grëp $* $list | sed 's,nbindex:[0-9]+: ,,'
}

grep -n '^nb ' * &gt;[2]/dev/null | sed 's,: ?nb +, ,' &gt; nbindex
echo `{pwd}^'/nbindex' &gt;&gt; $catalog
if(~ $TMPDIR ''){
	TMPDIR=/var/tmp
}
tmp=$TMPDIR^'/nbindexes.'^$USER^'.'^$pid
sort -u $catalog &gt; $tmp
mv $tmp $catalog

nb port plan9port rc shell script grëp
Nb in written in plan9port’s rc, but should be straightforward to port
to any shell.  Use grep instead of grëp.

nb author jason.catena@gmail.com

nb bugs
Nb generates the index after it searches, to present results immediately,
so it does not show changes since its last run.  If you want to see
the latest changes, then run nb with no parameters before you supply a
keyword (e.g. in acme, middle-click on nb after you edit an nb line or
following text).
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=212&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2010/03/05/nb%e2%80%94search-and-index-notes-in-files-by-keyword/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Update Go scanner to accept non-ASCII operators</title>
		<link>http://swtools.wordpress.com/2010/02/10/update-go-scanner-to-accept-non-ascii-operators/</link>
		<comments>http://swtools.wordpress.com/2010/02/10/update-go-scanner-to-accept-non-ascii-operators/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 06:16:26 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=184</guid>
		<description><![CDATA[Read the discussion of this change on the golang-nuts mailing list. See this notice in UTF-8 format. For each line, the scanner accepts, in place of the first operator, any of the remaining operators, and outputs a token whose string (set in $GOROOT/src/go/token/token.go) is the first operator. ! ¬ != ≠ &#38; ∧ &#38;&#38; ⋀ &#38;= ∧= [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=184&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Read the <a href="http://groups.google.com/group/golang-nuts/browse_thread/thread/502a754f5541a61">discussion</a> of this change on the golang-nuts mailing list.  See <a href="http://dl.dropbox.com/u/502901/myscanner.1">this notice</a> in UTF-8 format.</p>
<p>For each line, the scanner accepts, in place of the first operator, any of the remaining operators, and outputs a token whose string (set in $GOROOT/src/go/token/token.go) is the first operator.</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>!<span style="white-space:pre;"> </span>¬</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>!=<span style="white-space:pre;"> </span>≠</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&amp;<span style="white-space:pre;"> </span>∧</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&amp;&amp;<span style="white-space:pre;"> </span>⋀</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&amp;=<span style="white-space:pre;"> </span>∧=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&amp;^<span style="white-space:pre;"> </span>∧¬</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&amp;^=<span style="white-space:pre;"> </span>∧¬=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&#8230;<span style="white-space:pre;"> </span>…</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>:=<span style="white-space:pre;"> </span>≔</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&lt;-<span style="white-space:pre;"> </span>←</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&lt;&lt;<span style="white-space:pre;"> </span>≪</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&lt;&lt;=<span style="white-space:pre;"> </span>≪=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&lt;=<span style="white-space:pre;"> </span>≤</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>==<span style="white-space:pre;"> </span>=?<span style="white-space:pre;"> </span>≟</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&gt;=<span style="white-space:pre;"> </span>≥</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&gt;&gt;<span style="white-space:pre;"> </span>≫</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>&gt;&gt;=<span style="white-space:pre;"> </span>≫=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>^<span style="white-space:pre;"> </span>⊻</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>^=<span style="white-space:pre;"> </span>⊻=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>|<span style="white-space:pre;"> </span>∨</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>|=<span style="white-space:pre;"> </span>∨=</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>|| ⋁</p>
<p>To install, copy $GOROOT/src/pkg/go/scanner/scanner.go to another file.</p>
<p>Replace scanner.go with <a href="http://dl.dropbox.com/u/502901/scanner.go">scanner.go</a></p>
<p>Run $GOROOT/src/all.bash and check for 0 unexpected errors.</p>
<p>Changes to scanner.go update gofmt, which accepts UTF-8 operators and outputs their ASCII equivalents.  This mkfile production rule uses gofmt as a preprocessor to create a sharable and compilable file.</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> </span>%.go: %.ℊℴ</p>
<p style="padding-left:60px;"><span style="white-space:pre;"> </span>cat $stem.ℊℴ | gofmt &gt; $stem.go</p>
<p>See these files for an example of each new operator form in the context of a simple Go program.</p>
<p style="padding-left:30px;"><span style="white-space:pre;"> <a href="http://dl.dropbox.com/u/502901/myscanner.%E2%84%8A%E2%84%B4">myscanner.ℊℴ</a></span></p>
<p style="padding-left:30px;"><span style="white-space:pre;"> <a href="http://dl.dropbox.com/u/502901/chan.%E2%84%8A%E2%84%B4">chan.ℊℴ</a></span></p>
<p>Please <a href="mailto:Jason.Catena@gmail.com">mail me</a> privately if something doesn&#8217;t work with this code, to avoid noise on the golang-nuts list, since we&#8217;re no longer discussing officially-released code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=184&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2010/02/10/update-go-scanner-to-accept-non-ascii-operators/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Encouragement for the new craftsman</title>
		<link>http://swtools.wordpress.com/2009/04/23/encouragement-for-the-new-craftsman/</link>
		<comments>http://swtools.wordpress.com/2009/04/23/encouragement-for-the-new-craftsman/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 00:11:05 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Agile Software Devevelopment]]></category>
		<category><![CDATA[branch integration]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[software configuration management]]></category>
		<category><![CDATA[software craft]]></category>
		<category><![CDATA[Technical Analysis]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=150</guid>
		<description><![CDATA[Do you now bear responsibility for the architecture of some code? I&#8217;d like to talk just with you. I&#8217;d like to say that I think it&#8217;s really important to &#8220;listen and then lead&#8221;. You&#8217;re responsible to the customers of your code for its quality, and you&#8217;ll get a lot of pressure to &#8220;just do this&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=150&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Do you now bear responsibility for the architecture of some code?  I&#8217;d like to talk just with you.</p>
<p>I&#8217;d like to say that I think it&#8217;s really important to &#8220;listen and then lead&#8221;.  You&#8217;re responsible to the customers of your code for its quality, and you&#8217;ll get a lot of pressure to &#8220;just do this&#8221; or &#8220;just do that&#8221;.  The processes you put in place, to control the quality of contributions, are for the benefit of its users and the code as a whole&#8212;to maximize usefulness, not <em>necessarily</em> to maximize development.</p>
<p>Sometimes it&#8217;s okay, even necessary, to inconvenience a few people (including the contributors) in order that you don&#8217;t fail an even larger number of people.  You&#8217;re not (at least I wasn&#8217;t) able to please everyone, and trying to do so can easily cause harm, both short term (immediate bugs) and long term (technical debt and bad architecture).  It&#8217;s your, just your, job to balance all this and do what&#8217;s right overall, and it&#8217;s very much a judgement call.  </p>
<p>Some of this might be replaced by a change control board&#8217;s decisions, but if you go that route, then you must have a change process that everyone follows, regardless of the demands of the moment.  Some people are really slick and sophisticated in getting what they want, especially when it doesn&#8217;t hurt them if they end up creating a problem. (Heh, the more I reread that the more it sounds like parenting.)</p>
<p>I found I had to be confident enough to implement decisions and defend them, but flexible enough to shift policy and correct errors.  On the plus side, I think these skills will help move you past your current position, and help you control the direction in which your career heads.</p>
<p>You&#8217;re doing pretty well if you don&#8217;t instantly take sides in conversation on the merits, which is better than I sometimes do.  Even if you&#8217;re slow making decisions&#8212;and there is so much to learn&#8212;a little slow is ok, since it gives a chance for more reflection and more mature ideas.  Don&#8217;t be afraid to be wrong: if you never make mistakes, never make a bold architectural decision, then you&#8217;re playing it too safe, and you could probably be replaced with a small shell script.</p>
<p>Take care and good luck!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=150&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2009/04/23/encouragement-for-the-new-craftsman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Software Craftsmanship and Programmers&#8217; Status</title>
		<link>http://swtools.wordpress.com/2009/04/03/software-craftsmanship-and-programmers-status/</link>
		<comments>http://swtools.wordpress.com/2009/04/03/software-craftsmanship-and-programmers-status/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 08:32:34 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Hierarchy]]></category>
		<category><![CDATA[open process]]></category>
		<category><![CDATA[peer review]]></category>
		<category><![CDATA[software craft]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=57</guid>
		<description><![CDATA[This post quotes, collects, organizes, and remixes several sources to provoke comparison and consideration. There&#8217;s not a lot of new theory, beyond my idea that this stuff belongs together in the first place. A change in status In 1985 Peter Naur described, in Programming as Theory Building, where we still are as a profession (emphasis [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=57&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post quotes, collects, organizes, and remixes several sources to provoke comparison and consideration.  There&#8217;s not a lot of new theory, beyond my idea that this stuff belongs together in the first place.</p>
<p style="text-align:left;"><em>A change in status</em></p>
<p>In 1985 Peter Naur described, in <a href="https://dl.getdropbox.com/u/502901/naurtf.pdf">Programming as Theory Building</a>, where we still are as a profession (emphasis mine).</p>
<blockquote><p>[M]uch current discussion of programming seems to assume that programming is similar to industrial production, the programmer being regarded as a component of that production, a component that has to be controlled by rules of procedure and which can be replaced easily. Another related view is that human beings perform best if they act like machines, by following rules, with a consequent stress on formal modes of expression, which make it possible to formulate certain arguments in terms of rules of formal manipulation. Such views agree well with the notion, seemingly common among persons working with computers, that the human mind works like a computer. At the level of industrial management these views support treating programmers as workers of fairly low responsibility, and only brief education.</p></blockquote>
<p>Here&#8217;s where he suggests we be.</p>
<blockquote><p>On the Theory Building View the primary result of the programming activity is the theory held by the programmers. Since this <em>theory by its very nature is part of the mental possession of each programmer</em>, it follows that the notion of the programmer as an easily replaceable component in the program production activity has to be abandoned. Instead the programmer must be regarded as a responsible developer and manager of the activity in which the computer is a part. In order to fill this position he or she must be given a permanent position, of a status similar to that of other professionals, such as engineers and lawyers, whose active contributions as employers of enterprises rest on their intellectual proficiency.</p></blockquote>
<p>Further, he comments on necessary changes to programmer education.</p>
<blockquote><p>The raising of the status of programmers suggested by the Theory Building View will have to be supported by a corresponding reorientation of the programmer education. While skills such as the mastery of notations, data representations, and data processes, remain important, the primary emphasis would have to turn in the direction of furthering the understanding and talent for theory formation. To what extent this can be taught at all must remain an open question. <strong>The most hopeful approach would be to have the student work on concrete problems under guidance, in an active and constructive environment.</strong></p></blockquote>
<p style="text-align:left;"><em>An active and constructive environment</em></p>
<p>It occurs to me that the <a href="http://blog.objectmentor.com/articles/2009/04/01/master-craftsman-teams">Master Craftsmanship Teams</a> described by Bob Martin comprise distinct, guiding roles, in a context of &#8220;concrete problems&#8221;, to help us create this &#8220;active and constructive environment&#8221;.  Bob proposes a static structure (remixed below, original emphasis) though which a person progresses (or not) through a career, but in my experience this classification applies <a href="http://swtools.wordpress.com/2009/04/02/my-experience-with-master-craftsman-teams/">between a person and each of many projects</a>.</p>
<blockquote><p><em>Apprentice.</em> The apprentices write a significant amount of code—most of which is discarded by the journeymen.</p></blockquote>
<blockquote><p><em>Journeymen.</em> They can make short term tactical decisions, and direct their apprentices accordingly. At the same time they take technical and architectural direction from the master&#8230;. The journeymen write a <em>lot</em> of code – almost as much as the master. They also throw away two thirds of the code written by the apprentices, and drive them to redo it better – always better. They teach the apprentices how to refactor, and often pair with them and sit with them while reviewing their code&#8230;. When an apprentice delivers code that the journeyman finds acceptable, the journeyman will commit that code to their main line. Otherwise he sends it back to the apprentice to do over&#8230;. The Journeymen see every line of code written by their apprentices, and they write a significant amount themselves. Pairing is prevalent though not universal. Anyone on the team can pair with anyone else. It should not be uncommon for the master to pair with the apprentices from time to time.</p></blockquote>
<blockquote><p><em>Master.</em> The master probably writes more code than any of the team members. This code is often architectural in nature, and helps to establish the seed about which the system will crystalize. The master also sets technical direction and overall architecture, and makes all critical technical decisions. However, the chief job of the master is to relentlessly drive the journeymen towards higher quality and productivity by establishing and enforcing the appropriate disciplines and practices&#8230;. By the same token the master accepts subsystems from the journeymen and, if acceptable, commits it to the master main line&#8230;. The master sees every line of code in the system.</p></blockquote>
<p>There&#8217;s a lot of code written by this team, but a pair of expert eyes reviews all of it.  This is manageable if the scope of the work is not too large: my build systems weigh in at under 10,000 lines of (possibly too) intricate and clever shell scripts, makefiles, and flat data files.  As with any software system, technical debt is the biggest hurdle to efficiently adding new code.  In my case most of the technical debt was revealed by a new point of view (aspect-oriented and functional programming), and fundamental mechanism of customization (sed-scripts rather than sets of macros with varying parts), added only two years before I left my ten-year project.</p>
<p style="text-align:left;"><em>Ethics and professional responsibility</em></p>
<p>If software craftsmen would be professionals (note above how Naur separates us from engineers), we should compare existing computer and information science codes of ethics, for example a 1998 <a href="http://ethics.iit.edu/codes/coe/inst.electrical.electronics.engineers.assoc.computing.machinery.software.engineering.1999.html">Software Engineering Code of Ethics and Professional Practice</a> (SECEPP), to a <a href="http://groups.google.com/group/software_craftsmanship/web/principles-of-software-craftsmanship?hl=en">draft Software Craftsman&#8217;s Ethic</a> (SCE, in bold face).  Here I roughly group practices by similar intent: the last two groups catch all unmatched practices.  (In the remainder of this post, only the italicized paragraph tags are my words.)</p>
<p><em>Follow process.</em> <strong>We follow our chosen practices deliberately, to ensure quality in our work.  We adopt development processes to suit our own unique abilities and talents.</strong> Ensure an appropriate method is used for any project on which they work or propose to work.  Work to follow professional standards, when available, that are most appropriate for the task at hand, departing from these only when ethically or technically justified.  Ensure that clients, employers, and supervisors know of the software engineer&#8217;s commitment to this Code of ethics, and the subsequent ramifications of such commitment.</p>
<p><em>Continue to learn.</em> <strong>We are skill-centric rather than process-centric.  We build competency in a broad range of languages and technologies to meet the needs of our customers.  We achieve technical and design excellence through continuous and deliberate learning and practice. We desire to remain Software  Craftsmen and write code for our entire careers. We value long lived technologies and languages and are wary of proprietary tools.  We are generalists.</strong> Not knowingly use software that is obtained or retained either illegally or unethically.  Strive to fully understand the specifications for software on which they work.  Ensure adequate documentation, including significant problems discovered and solutions adopted, for any project on which they work. Further their knowledge of developments in the analysis, specification, design, development,  maintenance and testing of software and related documents, together with the management of the development process.  Improve their ability to create safe, reliable, and useful quality software at reasonable cost and within a reasonable time.  Improve their ability to produce accurate, informative, and well-written documentation.  Improve their understanding of the software and related documents on which they work and of the environment in which they will be used. Improve their knowledge of relevant standards and the law governing the software and related documents on which they work.  Improve their knowledge of this Code, its interpretation, and its application to their work.</p>
<p><em>Protect reputation by accepting responsibility.</em> <strong>We build our reputations on delivered quality.  Our livelihoods and reputations are interdependent. We are proud of our work and the manner of our work. We take responsibility for our work by signing it.  We are proud of our portfolio of successful projects.</strong> Accept full responsibility for their own work.  Not promote their own interest at the expense of the profession, client or employer.  Recognize that violations of this Code are inconsistent with being a professional software engineer.  Recognize that personal violations of this Code are inconsistent with being a professional software engineer.</p>
<p><em>Network to sow the field.</em> <strong>We respect master craftsmen as the key to Software Craftsmanship.  We will help other craftsmen in their journey.  We can point to the people who influenced us and who we influenced. We recommend other craftsmen, hanging our own reputation on their performance.  We work in a community with other craftsmen.</strong> Not unjustly prevent someone from taking a position for which that person is suitably qualified.  Extend software engineering knowledge by appropriate participation in professional organizations, meetings and publications.  Support, as members of a profession, other software engineers striving to follow this Code.</p>
<p><em>Clean code.</em> <strong>We write code that is easy to read, understand and modify.  We put predictable and forgiving user interfaces on our software.</strong> Be accurate in stating the characteristics of software on which they work, avoiding not only false claims but also claims that might reasonably be supposed to be speculative, vacuous, deceptive, misleading, or doubtful.</p>
<p><em>Test and maintain.</em> <strong>We design software for testing and maintenance.  We build long-lived applications and support them throughout their life.  We automate every task possible (especially testing).  We drive our development with tests.</strong> Ensure adequate testing, debugging, and review of software and related documents on which they work.  Treat all forms of software maintenance with the same professionalism as new development.</p>
<p><em>Strive for perfection.</em> <strong>We deliver our work to our customer without known defect.  We value quality over feature set or delivery data.  We consistently exceed and raise our customer&#8217;s expectations of quality software.  We build in quality to the software we create.</strong> Take responsibility for detecting, correcting, and reporting errors in software and associated documents on which they work.</p>
<p><em>Plan tradeoffs.</em> <strong>We say no to prevent doing harm to our craft and our projects.</strong> Strive for high quality, acceptable cost and a reasonable schedule, ensuring significant tradeoffs are clear to and accepted by the employer and the client, and are available for consideration by the user and the public.  Ensure realistic quantitative estimates of cost, scheduling, personnel, quality and outcomes on any project on which they work or propose to work and provide an uncertainty assessment of these estimates.  Ensure realistic quantitative estimates of cost, scheduling, personnel, quality and outcomes on any project on which they work or propose to work, and provide an uncertainty assessment of these estimates.</p>
<p><em>Respect customers.</em> <strong>We deliver what our customers really need, not just what they ask for.  We build trust and respect in long term relationships with our customers.  We take our customer&#8217;s needs as seriously as they do.  We desire demanding users.</strong> Work to develop software and related documents that respect the privacy of those who will be affected by that software. Ensure that specifications for software on which they work have been well documented, satisfy the users&#8217; requirements and have the appropriate approvals.</p>
<p><em>Promote coworkers and colleagues.</em> <strong>We take on Apprentices and put them in an environment where they can learn our craft for themselves.</strong> Ensure that software engineers are informed of standards before being held to them.  Attract potential software engineers only by full and accurate description of the conditions of employment.  Offer fair and just remuneration.  Not ask a software engineer to do anything inconsistent with this Code.  Encourage colleagues to adhere to this Code.  Assist colleagues in professional development.  Credit fully the work of others and refrain from taking undue credit.  Review the work of others in an objective, candid, and properly-documented way.  Give a fair hearing to the opinions, concerns, or complaints of a colleague. Assist colleagues in being fully aware of current standard work practices including policies and procedures for protecting passwords, files and other confidential information, and security measures in general.  Not influence others to undertake any action that involves a breach of this Code.</p>
<p><em>Demonstrate competence.</em> <strong>We accept that different craftsmen are better suited for one kind of job over another.</strong> Provide service in their areas of competence, being honest and forthright about any limitations of their experience and education.  Ensure that they are qualified for any project on which they work or propose to work by an appropriate combination of education and training, and experience.  Only endorse documents either prepared under their supervision or within their areas of competence and with which they are in agreement.  Assign work only after taking into account appropriate contributions of education and experience tempered with a desire to further that education and experience.  Not unfairly intervene in the career of any colleague; however, concern for the employer, the client or public interest may compel software engineers, in good faith, to question the competence of a colleague.  In situations outside of their own areas of competence, call upon the opinions of other professionals who have competence in that area.</p>
<p><em>Manage projects.</em> <strong>We keep projects from spinning in circles.  We don&#8217;t wait for complete definition before beginning.  We never allow ourselves to be blocked.</strong> Identify, document, collect evidence and report to the client or the employer promptly if, in their opinion, a project is likely to fail, to prove too expensive, to violate intellectual property law, or otherwise to be problematic.  Ensure proper and achievable goals and objectives for any project on which they work or propose.  Ensure good management for any project on which they work, including effective procedures for promotion of quality and reduction of risk.</p>
<p><em>Own code.</em> <strong>We believe the code is also an end, not just a means.  We treat software like capital.</strong> Ensure that there is a fair agreement concerning ownership of any software, processes, research, writing, or other intellectual property to which a software engineer has contributed.</p>
<p><em>Represent the public interest.</em> Moderate the interests of the software engineer, the employer, the client and the users with the public good.  Approve software only if they have a well-founded belief that it is safe, meets specifications, passes appropriate tests, and does not diminish quality of life, diminish privacy or harm the environment.  The ultimate effect of the work should be to the public good.  Disclose to appropriate persons or authorities any actual or potential danger to the user, the public, or the environment, that they reasonably believe to be associated with software or related documents.  Cooperate in efforts to address matters of grave public concern caused by software, its installation, maintenance, support or documentation.Be fair and avoid deception in all statements, particularly public ones, concerning software or related documents, methods and tools. Consider issues of physical disabilities, allocation of resources, economic disadvantage and other factors that can diminish access to the benefits of software. Be encouraged to volunteer professional skills to good causes and contribute to public education concerning the discipline.  Identify, document, and report significant issues of social concern, of which they are aware, in software or related documents, to the employer or the client.  Identify, define and address ethical, economic, cultural, legal and environmental issues related to work projects.  Temper all technical judgments by the need to support and maintain human values.  Help develop an organizational environment favorable to acting ethically.  Promote public knowledge of software engineering.  Obey all laws governing their work, unless, in exceptional circumstances, such compliance is inconsistent with the public interest.  Express concerns to the people involved when significant violations of this Code are detected unless this is impossible, counter-productive, or dangerous.  Report significant violations of this Code to appropriate authorities when it is clear that consultation with people involved in these significant violations is impossible, counter-productive or dangerous.</p>
<p><em>Deal fairly.</em> Use the property of a client or employer only in ways properly authorized, and with the client&#8217;s or employer&#8217;s knowledge and consent.  Ensure that any document upon which they rely has been approved, when required, by someone authorized to approve it.  Keep private any confidential information gained in their professional work, where such confidentiality is consistent with the public interest and consistent with the law. Accept no outside work detrimental to the work they perform for their primary employer.  Promote no interest adverse to their employer or client, unless a higher ethical concern is being compromised; in that case, inform the employer or another appropriate authority of the ethical concern.  Be careful to use only accurate data derived by ethical and lawful means, and use it only in ways properly authorized.  Maintain the integrity of data, being sensitive to outdated or flawed occurrences.  Maintain professional objectivity with respect to any software or related documents they are asked to evaluate.  Not engage in deceptive financial practices such as bribery, double billing, or other improper financial practices.  Disclose to all concerned parties those conflicts of interest that cannot reasonably be avoided or escaped.  Refuse to participate, as members or advisors, in a private, governmental or professional body concerned with software related issues, in which they, their employers or their clients have undisclosed potential conflicts of interest. Ensure that software engineers know the employer&#8217;s policies and procedures for protecting passwords, files and information that is confidential to the employer or confidential to others. Provide for due process in hearing charges of violation of an employer&#8217;s policy or of this Code.  Not punish anyone for expressing ethical concerns about a project.  Avoid associations with businesses and organizations which are in conflict with this code.  Not give unfair treatment to anyone because of any irrelevant prejudices.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=57&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2009/04/03/software-craftsmanship-and-programmers-status/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>My experience with Master Craftsman Teams</title>
		<link>http://swtools.wordpress.com/2009/04/02/my-experience-with-master-craftsman-teams/</link>
		<comments>http://swtools.wordpress.com/2009/04/02/my-experience-with-master-craftsman-teams/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:14:53 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Free/Open Source]]></category>
		<category><![CDATA[Hierarchy]]></category>
		<category><![CDATA[open process]]></category>
		<category><![CDATA[Productivity/Tools]]></category>
		<category><![CDATA[software configuration management]]></category>
		<category><![CDATA[software craft]]></category>
		<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/?p=49</guid>
		<description><![CDATA[&#8220;Uncle Bob&#8221; wrote yesterday about Master Craftsman Teams. The thing that struck me most about this article is how closely it matched the way my own team of coworkers, who came and went, contributed and moved on, helped me develop two significant software build systems over ten years. Without a doubt I had the role [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=49&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8220;<a href="http://en.wikipedia.org/wiki/Robert_Cecil_Martin">Uncle Bob</a>&#8221; wrote yesterday about <a href="http://blog.objectmentor.com/articles/2009/04/01/master-craftsman-teams">Master Craftsman Teams</a>.</p>
<p>The thing that struck me most about this article is how closely it matched the way my own team of coworkers, who came and went, contributed and moved on, helped me develop two significant software build systems over ten years.</p>
<p>Without a doubt I had the role of &#8220;master&#8221;, and as Peter Naur would say, had the <a href="https://dl.getdropbox.com/u/502901/naurtf.pdf">theory of the program</a> in my head.  I developed the build system from empty directories twice, to build products for two different software systems.  Each time I had key responsibility to fit the system to customers&#8217; needs, and decide how it would involve internally.  (I&#8217;ve also been programming for thirty years, since BASIC on my first computers in grade school.)</p>
<p>I delegated what I saw fit to a handful of people who grew in responsibility as they demonstrated they understood and could make creative improvements to the system (journeyman).  One of the journeymen became committer when I recently left.  Since no-one had the theory as well as I did, architectural responsibility devolved from my fiat to a change control board, so that everyone could bring bits and pieces of their expertise to together make better decisions.</p>
<p>Hundreds of small changes were made over the years by a few dozen people who did not really grasp the principles of the system, so needed a significant amount of guidance.  I reviewed every line of code in the system, and know how it all works together.  I expect that some of this efficiency will suffer in future, at the advantage&#8212;to the organization that owns it&#8212;of not having &#8220;the keys to the kingdom&#8221; in one set of hands.</p>
<p>I&#8217;m not sure how well this approach would sit with people as a formalized organization chart and pay scale, but I&#8217;ve seen it work very well in practice with a software project I managed.  Further, I believe that if you look closely most software projects in practice run this way (<em>eg</em> Linux has Linus, Alan, various subsystem committers, and a <em>hoi polloi</em> of patchers.)  Even further, a single person may be an apprentice to one project, a journeyman to another, and a master to a third.</p>
<p>Perhaps the thing to do is to compensate people outside the company by bounties for the code they contribute; set up a contractor arrangement for journeymen; and actually hire only masters.  This keeps companies small, focused on their core competencies and most valuable people.  Even better for the community of programmers, this provides a structure for programmers to put food on the table while contributing to as many projects, and at the levels of depth, as suits their inclinations and abilities.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=49&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2009/04/02/my-experience-with-master-craftsman-teams/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Agile practice one-liners, and Alexander on refactoring</title>
		<link>http://swtools.wordpress.com/2007/08/24/agile-practice-one-liners-and-alexander-on-refactoring/</link>
		<comments>http://swtools.wordpress.com/2007/08/24/agile-practice-one-liners-and-alexander-on-refactoring/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 23:23:32 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Agile Software Devevelopment]]></category>
		<category><![CDATA[Christopher Alexander]]></category>
		<category><![CDATA[outline]]></category>
		<category><![CDATA[refactor]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/2007/08/24/agile-practice-one-liners-and-alexander-on-refactoring/</guid>
		<description><![CDATA[A few one-line descriptions of Agile practices, because I feel they get to the heart of each. Iterative development with feature teams: a few developers complete the development cycle (refactor, code, integrate, build, and test), for each of a few features, in two weeks to two months. Refactoring: instead of a static, outdated architecture, rework [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=38&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana;font-size:small;"><span class="750181422-24082007">A few one-line descriptions of Agile practices, because I feel they get to the heart of each.</span></span></p>
<blockquote><p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Iterative development with feature  teams:</em> a few developers complete the development<span class="750181422-24082007"> </span>cycle (refactor, code, integrate, build, and  test), for each of a few features,<span class="750181422-24082007"> </span>in two  weeks to two months.</span></span></p>
<p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Refactoring:</em> instead of a static,  outdated architecture, rework the codebase with<span class="750181422-24082007"> </span>each feature.</span></span></p>
<p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Test-driven development:</em> write  tests of functionality for user stories, then write<span class="750181422-24082007"> </span>code to pass these tests.</span></span></p>
<p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Pairing and collective ownership:</em> two developers introduce fewer errors to review<span class="750181422-24082007"> </span>and test for, and many developers distribute knowledge of the  code.</span></span></p>
<p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Frequent integration:</em> merge and  build new changes at least daily, test at least<span class="750181422-24082007"> </span>weekly.</span></span></p>
<p><span style="font-family:Verdana;"><span style="font-size:small;"><em>Automated regression test:</em> collect  all test cases into push-button test suites, run<span class="750181422-24082007"> </span>shortly after each deliverable build.</span></span></p></blockquote>
<p><span class="750181422-24082007"><span style="font-family:Verdana;font-size:small;">I also found a passage on refactoring  from an OOPSLA keynote by Christopher Alexander:</span></span></p>
<blockquote><p><span class="750181422-24082007"><span class="q"><span style="font-family:Verdana;font-size:small;">It  turns out that these living structures can only be produced by an unfolding  wholeness. That it, there is a condition in which you have space in a certain  state. You operate on it through things that I have come to call  &#8220;structure-preserving transformations,” maintaining the whole at each step, but  gradually introducing differentiations one after the other. And if these  transformations are truly structure-preserving and structure-enhancing, then you  will come out at the end with living structure. Just think of an acorn becoming  an oak. The end result is very different from the start point but happens in a  smooth unfolding way in which each step clearly emanates from the previous  one.</span></span></span></p></blockquote>
<blockquote>
<p dir="ltr" align="left"><span style="font-family:Verdana;font-size:small;">Alexander, C. 1999. The  origins of pattern theory: The future of the theory, and the generation<span class="234290823-24082007"> </span>of a living world. <em>IEEE Software 16</em>, 5  (Sept/Oct), 71<span class="234290823-24082007">&#8211;</span>82. </span><a title="http://doi.ieeecomputersociety.org/10.1109/52.795104" href="http://doi.ieeecomputersociety.org/10.1109/52.795104"><span style="font-family:Verdana;font-size:x-small;">http://doi.ieeecomputersociety.org/10.1109/52.795104</span></a></p>
<p><span style="font-family:Verdana;font-size:small;"><a title="http://www.patternlanguage.com/archive/ieee/ieeetext.htm" href="http://www.patternlanguage.com/archive/ieee/ieeetext.htm"></a></span></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/swtools.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/swtools.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=38&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2007/08/24/agile-practice-one-liners-and-alexander-on-refactoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Blacksmithing a Train Engine</title>
		<link>http://swtools.wordpress.com/2007/05/08/blacksmithing-a-train-engine/</link>
		<comments>http://swtools.wordpress.com/2007/05/08/blacksmithing-a-train-engine/#comments</comments>
		<pubDate>Tue, 08 May 2007 19:02:48 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/2007/05/08/blacksmithing-a-train-engine/</guid>
		<description><![CDATA[Yet another analogy comparing software development to a hardware activity: in this case, train engines. (Programs&#124;engines) run, within the bounds of a (computer&#124;track). The strength of the (computer&#124;track) determines the rate at which they can run. The design and internal processes of the (program&#124;engine) determines the rate at which they do run. Certain designs of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=36&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yet another analogy comparing software development to a hardware activity: in this case, train engines.</p>
<p>(Programs|engines) run, within the bounds of a (computer|track).  The strength of the (computer|track) determines the rate at which they can run.  The design and internal processes of the (program|engine) determines the rate at which they do run.  Certain designs of (programs|engines) make it easier to handle various loads of (data|cars), since (data|cars) have different properties when placed under the stress of running.</p>
<p>If (data|cars) properly interface with the (file|rail) format, then the (program|engine) can handle them.  If not, then the (program|engine) will fail to make any progress, or crash.  The more subtle the difference between the format expected by the (program|engine) and that implemented by the (data|cars), the longer it will run before the difference creates a problem.  Some problems might not be found at all, if no situation arises for which the difference has any noticeable effect. The (program|engine) handles a certain amount of (data|cars) before slowing to a crawl.  Users can handle more (data|cars) in the same amount of time by running additional (programs|engines) in parallel, but improvement is limited by the time required to coordinate final and intermediate delivery.</p>
<p>Standard (file|rail) formats are better, because more (programs|engines) and (data|cars) are built to use them, their properties are better known, and users can even reuse them in different systems.  However, vendors must differentiate themselves to drive business their way, so they often attempt to lock users into a particular format, in addition to (sometimes instead of) competing on the merits of their (program|engine).</p>
<p>In the early days of  (programs|engines), each part was laboriously crafted and fit into place by hand, and often failed spectacularly from the additional pressures of running.  Each part had to be crafted with a knowledge of all the stresses under which it would run, from materials suitable for the basic processes which powered the (program|engine).  Nonetheless, its appearance made a more significant impact on users and bystanders, unless its performance differed drastically from others&#8217;.</p>
<p>The tools with which the craftsmen created (program|engine) parts were themselves created by the same process, so a craftsman&#8217;s product quality varied dramatically with his knowledge of toolmaking.</p>
<p>There were common parts, interfaces, and controls expected by users who had used similar (programs|engines).  There was a great need to explain to users who had not: how they could expect the (program|engine) to behave with their (data|cars), and to make sure they were compatible with the (file|rail) format; how to control the (program|engine) at a basic level, and how to get a feel for its advanced capabilities; and how to get the (data|cars) to the (program|engine), and how to pass them off to others.</p>
<p><strong>Smithing Tools to Smith Tools </strong></p>
<p>Following text from Wikipedia on <a href="http://en.wikipedia.org/wiki/Blacksmith" title="Blacksmith - Wikipedia">blacksmiths</a>.</p>
<blockquote><p>Over the centuries (blacksmiths|programmers) have taken no little pride in the fact that theirs is one of the few crafts that allows them to make the tools that are used for their craft. Time and tradition have provided some fairly standard basic tools which vary only in detail around the world.</p>
<p>There are many other tools used by smiths, so many that even a brief description of the types is beyond the scope of this article and the task is complicated by a variety of names for the same type of tool. Further complicating the task is that making tools is inherently part of the smith&#8217;s craft and many custom tools are made by individual smiths to suit particular tasks and the smith&#8217;s inclination.</p>
<p>With that caveat one category of tools should be mentioned. A (jig|hack) is generally a custom built tool, usually made by the smith, to perform a particular operation for a particular task or project.</p></blockquote>
<p>More on software blacksmithing, apprenticeship, and artistry: <a href="http://syntatic.wordpress.com/2007/07/13/craftsmanship-as-a-bridge/" rel="bookmark" title="Permanent Link to Craftsmanship as a Bridge">Craftsmanship as a Bridge</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/swtools.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/swtools.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=36&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2007/05/08/blacksmithing-a-train-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
		<item>
		<title>Pave the Pathways</title>
		<link>http://swtools.wordpress.com/2007/02/18/pave-the-pathways/</link>
		<comments>http://swtools.wordpress.com/2007/02/18/pave-the-pathways/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 07:02:03 +0000</pubDate>
		<dc:creator>catena</dc:creator>
				<category><![CDATA[automate]]></category>
		<category><![CDATA[iterate]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://swtools.wordpress.com/2007/02/18/just-plant-the-grass-solidly-between-the-buildings/</guid>
		<description><![CDATA[Roger von Oech provides an example of backing off the design process, to observe usage patterns. For example, designer Christopher Williams tells a story about an architect who built a cluster of large office buildings that were set on a central green. When construction was completed, the landscape crew asked him where he wanted the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=34&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Roger von Oech provides an example of <a href="http://blog.creativethink.com/2007/01/back_off.html" title="Pause for a Bit">backing off</a> the design process, to observe usage patterns.</p>
<blockquote><p>For example, designer Christopher Williams tells a story about an architect who built a cluster of large office buildings that were set on a central green. When construction was completed, the landscape crew asked him where he wanted the pathways between the buildings.</p>
<p>&#8220;Not yet,&#8221; the architect said. &#8220;Just plant the grass solidly between the buildings.&#8221;</p>
<p>This was done, and by late summer pedestrians had worn paths across the lawn, connecting building to building. The paths turned in easy curves rather than right angles, and were sized according to traffic.</p>
<p>In the fall, the architect simply paved the pathways. Not only did the new pathways have a design beauty, they responded directly to user needs.</p></blockquote>
<p>In software, this argues to release to users in iterations, incorporate their feedback, and simplify their use cases.  Common use cases, added late, tend not to elegantly fit the software&#8217;s architecture, so increase the maintenance burden.</p>
<p>Kathy Sierra reminds us that <a href="http://headrush.typepad.com/creating_passionate_users/2007/02/test.html" title="The real secret to a successful blog/book/business...">providing what&#8217;s good for users is good business</a>.</p>
<blockquote><p>Ask the question we keep bringing up here, &#8220;What will this help the user do?&#8221; Not, &#8220;How can we make a great product?&#8221; Nobody cares about your company, and nobody cares about your product. Not really. <em>They care about themselves in relation to your product.</em> What it means to them. What it does for them. What it says about them that they use your product or believe in your company.</p></blockquote>
<p>And that users don&#8217;t want us to <a href="http://headrush.typepad.com/creating_passionate_users/2007/02/how_much_contro.html" title="How much control should our users have?">pave the entire courtyard</a>.</p>
<blockquote><p><strong>How much control should users have? </strong></p>
<p>Obviously this is a big &#8220;it depends&#8221;, but the main point is to focus on the relationship between user control and user capability. As user capability (knowledge, skill, expertise) increases, so should control &#8212; at least for a lot of things we make, especially software, and especially when we&#8217;re aiming not just for satisfied users but potentially <em>passionate</em> users. The big problem is that we make our beginning users suffer just so our advanced users can tweak and tune their configurations, workflow, and output. [For the record, I'm a big fan of splitting capabilities into different products, or having a really good user-level modes--where you use wizards or simpler interfaces for new users, etc. Yes, they're often done badly, but they don't have to be.]</p></blockquote>
<p>In the build systems I write, the interface tends to one shell script, whose options behave like make options (passed to the main subsidiary make process), and whose parameters are make targets (with an optional subtarget syntax).  So if you know how to ask make to build what you want, then you know how to ask my build system.</p>
<p>There is a lot of room in this interface style for build system developers (<em>eg</em>, you can ask the build system to run <em>any </em>internal target), application developer experts (<em>eg</em>, custom-build individual tasks or libraries, or even single files), and application developer novices (<em>eg</em>: all-encompassing clean, build, and package targets; wrapper scripts which set the shell environment).</p>
<p>Best of all, novice features tend to form the foundation of automation.  If a novice developer can easily run a use case, then the process scheduler (cron) probably can also run it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/swtools.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/swtools.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swtools.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swtools.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swtools.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swtools.wordpress.com&amp;blog=201050&amp;post=34&amp;subd=swtools&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swtools.wordpress.com/2007/02/18/pave-the-pathways/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c4d1f79da6d413fefdf779f6437aa15?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">catena</media:title>
		</media:content>
	</item>
	</channel>
</rss>
