![]() |
Articles Feed |
Categories
Archives
- July 2010 (5)
- June 2010 (4)
- April 2010 (3)
- March 2010 (2)
- February 2010 (2)
- January 2010 (1)
- December 2009 (1)
- October 2009 (2)
- September 2009 (2)
- August 2009 (1)
- July 2009 (5)
- June 2009 (2)
- May 2009 (2)
- April 2009 (8)
- March 2009 (7)
- January 2009 (2)
- December 2008 (3)
- November 2008 (5)
- October 2008 (4)
- September 2008 (6)
- August 2008 (4)
- July 2008 (5)
- June 2008 (5)
- May 2008 (4)
- April 2008 (2)
- February 2008 (4)
- January 2008 (2)
- December 2007 (2)
- November 2007 (2)
- October 2007 (2)
- September 2007 (1)
- August 2007 (3)
- July 2007 (1)
- June 2007 (4)
- May 2007 (7)
- April 2007 (2)
- February 2007 (3)
- January 2007 (3)
- November 2006 (3)
- October 2006 (3)
- September 2006 (17)
- November 2004 (1)
Material Consciousness in Software
by: paul | March 30th, 2009 | 1 comments »
The following excerpt is from Richard Sennett’s, The Craftsman. All craftsmen have [material consciousness], even those who practice the most arcane art. The painter Edgar Degas is once supposed to have remarked to Stéhane Mallarmé, “I have a wonderful idea for a poem but I can’t seem to work it out,” whereupon Mallarmé replied, “My dear Edgar, poems are not made with ideas, they are made with words.”
In this same vein, software is not made with designs and ideas, but with code. Code is the raw material. Code is the only means we have to create anything. The ideas we have are only as good as the code we can write to implement them. So, the code is the object of all a software craftsman’s material consciousness. Material consciousness for the software craftsman becomes a fancy way to say that we are aware of the code at all times.
The code being the object of our craft is an important distinction, because it provides a rationale for never being too far from the code in our practices. The farther you are from the code itself, the farther you are from being able to produce an actual object of work.
When I learned eXtreme programming, this was taught to me in a series of practices. For example, using evolutionary design rather than designing an entire system before you write the code. When you design something before you write the code, you add a level of removal from thinking about the code itself. You are thinking about abstractions. An alternative, evolutionary design, tells me to write a test, then do the simplest thing I can possibly do to make that test pass. Through looking at the code, I get a feel for what the design should be. This feel lets me refactor to a better design. This design technique allows my material consciousness to not be obstructed. I get to think critically about the design of my code, but I do it in a combination of abstractions and examples, rather than just designing in the abstract.
Another example of material consciousness in crafting software is developing in vertical slices. A vertical slice is when you develop the whole set of requirements for a specific feature before moving on to another feature. When you develop in vertical slices, you are never far from changing the code and seeing the feedback in the application. You can change some code and look at the user interface, instead of having to imagine what the front end will look like. Or if you are coding the front end first, trying to visual what the entire API should look like. This idea resonates with the famous William Carlos Williams quote, there are "no ideas but in things."
It is important for me as a software craftsman to know what the material I need to be aware of is, so I don’t remove my thought too far from it. During the software craftsmanship summit in Chicago, Brian Marick said we need to treat the code as an end in itself, not just the means. To me, this captures the idea of thinking in code.
MM-HTTP: Simple Java HTTP Server
by: micah | March 24th, 2009 | 0 comments »
Bloodroot seeds. They have nothing to do with this blog except that this was the first search result on flickr for ‘MM HTTP’. I think they’re quite interesting.
I was recently working on a Java project where I needed to serve up a couple pages via HTTP. These pages were nothing fancy but their content was purely dynamic. It’s also worth noting that the project was a shrink wrapped product.
The most immediate options that came to mind when I thought Java/Web were, Servlets, Struts, EJB, …. oh my! These options seemed like overkill. I didn’t want to complicated the deployment of this product with beasties like Tomcat and JBoss. That’s just silly. I wanted a simple web server that I could plug into my code and serve a couple dynamic pages. I took a quick peek at Jetty and thought “No thanks”.
Of course, all along I was thinking about FitNesse. FitNesse is a stand-alone web server. And it’s just a jar file. In fact, I have fond memories of writing the FitNesse HTTP server and it occurred to me how simple it would be to extract that module into a self contained library. So I did it. It was simple. And I call it MM-HTTP.
So how do you write a Hello World web app with MM-HTTP? Like this:
- import mmhttp.server.*;
- import mmhttp.protocol.*;
- public class HelloWorld
- {
- public static void main(String[] args) throws Exception
- {
- Server server = new Server(8000);
- server.register("hello.*", HelloResponder.class);
- server.start();
- }
- public static class HelloResponder implements Responder
- {
- public Response makeResponse(Server server, Request request) throws Exception
- {
- return new SimpleResponse(200, "<h1>Hello World!</h1>");
- }
- }
- }
You’ll need to download the mmhttp jar file. Once you’ve pasted the above code in a HelloWorld.java file, you can compile and run the web server like so:
- javac -classpath mmhttp-1.1.jar HelloWorld.java
- java -classpath mmhttp-1.1.jar HelloWorld
Then plug the following URL into your browser. http://localhost:8000/hello. That’s it!
To find out more, visit the MMHTTP github page and the javadocs. Enjoy!
Software Journeyman program
by: paul | March 19th, 2009 | 0 comments »
8th Light and Obtiva have partnered up to provide a journeyman program. Traditionally, a journeyman program is when a master craftsman hires a journeyman for a specific project. This journeyman lives and works with the master, learning from her/his experience and helping the master produce craftwork. A lot has changed since this type of journeyman program was prevalent.
We are going to have to alter the journeyman idea to fit into the way that both companies do business.
Our program is the first software journeyman program that I know of. It consists of sending a craftsman to the another company for a specific amount of time. It is exciting to have the opportunity to travel to another workshop and gain new experiences. Being the first of its kind, it is hard to set hard goals. I hope among them are the ability to see how a different style and thought process goes into software craftsmanship at different workshop. As a journeyman, I think it is important to be very diverse in skills and techniques, so you can use the ones which best fit your coding style and problem sets.
Our solidarity with Obtiva on the topic of craftsmanship provided a willingness to work together to make the program work in today's business environment.
So, how did this happen? Corey Haines has been traveling the countryside on his own journeyman tour, dropping apple seeds. One of those seeds was getting 8th Light and Obtiva together in a room to hammer out solutions to all the obstacles involved in starting a cooperative journeyman program. I am very thankful to Corey for being proactive in putting it together.
Copyrights Conundrum
by: micah | March 12th, 2009 | 0 comments »
Here’s the situation. You’ve spent days working on an open source project. Your sweat, blood, and tears have been poured into thousands of lines of code spread through countless file in a sprawling tree of directories. The final step is to release your masterpiece into the wild. So you choose your open source license and then it hits you; you realize that need to add a copyright header to EACH and EVERY source code files. How tedious! You google for a tool that will automatically add the headers for you, and you find nothing satisfactory. In the end, you write your own script to add the headers for you.
I’ve been in this exact situation and written such a script too many times. My most recent experience and script implementation will be the last. I’ve dubbed this last imeplementation MM Copyrights and you’re welcome to use it.
MM Copyrights is a simple Ruby gem that will search a directory for source code files, inserting or updating a header comment in each file.
Installing
It’s just a matter of installing the gem hosted on Github.
- gem sources -a http://gems.github.com
- sudo gem install slagyr-mmcopyrights
Update: The github shenanigans is not longer needed. To install, simply:
- sudo gem install mmcopyrights
Usage
Let’s say you want to add the following copyright header to all .rb files in the lib directory…
- require 'mmcopyrights'
- MM::Copyrights.process("lib", "rb", "#-", "©2009 Micah Martin\nAll rights reserved")
And all the ruby files will look like this:
- #- ©2009 Micah Martin
- #- All rights reserved
- ... ruby code ...
Typically I keep the copyright text in a separate file and write the following Rake task…
- task :copyrights do
- require 'mmcopyrights'
- MM::Copyrights.process('lib', "rb", "#-", IO.read('copyrights.txt'))
- end
or the following ant task if need be…
- <target name="copyrights">
- <exec command="ruby">
- <arg value="-rrubygems" />
- <arg value="-e" />
- <arg value="require 'mmcopyrights'; MM::Copyrights.process('src', 'java', '//-', IO.read('copyright.txt'))" />
- </exec>
- </target>
Details
If you haven’t guessed, MM::Copyrights::process takes 4 parameters.
- The path of the directory containing source code.
- The extension of source file to be processed.
- The comment prefix. Note that there’s an extra -. This is because we want the copyright comments to be unique from all other comments. The tool will search for this unique prefix to find existing copyright headers.
- The copyright text, without the comment prefix.
That’s about it. Feel free to run MM::Copyrights::process multiple times on the same code base. It’s harmless. And when the new year rolls around, just change the copyright text and rerun the tool. It will update existing headers.
History of the Software Craftsmanship Manifesto
by: paul | March 11th, 2009 | 0 comments »
I would like to prelude this with an assurance that this is not the history of the software craftsmanship. I know a little of that history, as far back as Pete McBreen's book Software Craftsmanship: the new imperative and Uncle Bob's Software Craftsmanship articles. No, this is just a brief history of the document hosted here.
It started when Uncle Bob's keynote speech last year at "Agile 2008." Uncle Bob proposed an amendment to the Agile Manifesto of "Software Craftsmanship over Crap." Now, the manifesto, to my knowledge, was never changed. However, the software craftsmanship community started to become more active.
The actual manifesto started with a summit on Software Craftsmanship in Chicago, on December 13, 2008. There we discussed what it means to be a craftsman and an apprentice and so forth. We spent the afternoon discussing who the document would be written for, what the contents of it would be, if the document already existed, and if it needed to exist at all. The attendees deserve a lot of credit on getting these ideas started, and they are listed below.
On a whiteboard, we wrote the first version of the manifesto and all the attendees signed it. For a few months afterwards, we talked about it on the google group, discussing the various ideas put forth at the summit. Then, in February, Doug Bradbury wrote an email called "The new Left Side" which started to get the values and wording which was refined into the actual Software Craftsmanship Manifesto. There was a debate about how the agile manifesto and the software craftsmanship manifesto that was instrumental in moving forward with the manifesto. You can read these threads at http://groups.google.com/group/software_craftsmanship. They start with "The new left side" by Doug Bradbury and "Right side, revisited" by Scott Pfister. It was a fascinating conversation, which spawned the final language of the manifesto.
So, the question that was asked on the software craftsmanship mailing list and in the twitterverse, is "Why a software craftsmanship manifesto?" Well, if you will permit me to give an existential answer, it is because the list has 1771 signatories as of this writing. That many people now know each other as craftsmen in some context. They know they can talk as craftsmen, and hopefully move forward in our industry as craftsmen.
Let me use some other answers to the question to give another perspective.
"As of today, there are over 1500 signatures on the Manifesto. 1500 people are fighting against "crap code". Those who have been fighting "crap code" now know that they are not alone in their fight. Those who write "crap code" now know that there are 1500 people fighting against them." -- Micah Martin
"By becoming a vocal community, publishing a manifesto, beginning work on establishing principles and concrete schools of thought, we are creating a light that new developers can see. Those who are really interested can more easily find us, talk to us about apprenticeships, meet companies that actively engage in craftsmanship activities (apprenticeships, journeymen programs, etc.). In some cases, this will introduce them sooner to these ideas, hopefully saving some from the frustrations they can face in a different situation." -- Corey Haines
- Dean Wampler
- Matt Segvich
- Dave Hoover
- Joseph Leddy
- Jake Scruggs
- Robert Martin
- Micah Martin
- Paul Pagel
- Brian Marick
- Eric Smith
- Doug Bradbury
- Jim Suchy
- Craig Demyanovich
- Raymond Hightower
- Corey Haines
- David Chelimsky
- Scott Pfister
- Eric Meyer
- Denny Abraham
- Matt Blodgett
- Zach Dennis
- John Hwang
- Mark Van Holstyn
- Scott Roth
Selenium on Rails Released
by: eric | March 7th, 2009 | 0 comments »
Quick announcement, Selenium on Rails has been released, now supporting Rails 2.2 and with the latest Selenium Core. Numerous bug fixes are in this release as well, thanks to commiters Marcos Tapajós, Nando Vieria, and Gordon McCreight.

To update to the latest version install the plugin from http://svn.openqa.org/svn/selenium-on-rails/stable/selenium-on-rails. This release is once again not compatible with previous versions of Rails, so check the website to install new revisions.
I also want to add a new patch policy. To patch/contribute to selenium on rails head to the http://github.com/paytonrules/selenium-on-rails and fork the repo, then just issue a pull request. I will not be taking patches that don’t have tests however, as it is just too much work for me to retrofit tests on to the patch.
For any questions or comments contact me at eric (at) 8thlight (dot) com. Look for me at SDWest and Scotland on Rails.
Software Craftsmanship 2009
by: micah | March 1st, 2009 | 1 comments »
Last week I flew to London to attend and speak at the Software Craftsmanship 2009 conference. My talk was on Ruby Kata and Sparring.
Plenty of folk gave me a funny look when I explained that I was traveling all the way from Chicago to London to attend a 1-day conference. But it was important to me. The Software Craftsmanship concept seems to have gained momentum in both Chicago and London at about the same time. I’m well aware of how it came about in Chicago, but it’s origin in London was a mystery.
As it turns out, one of the primary forces behind Software Craftsmanship in London is Jason Gorman. He chaired the conference and, with the help of many others, put it together from scratch. Jason was a very gracious host and the event was a very enjoyable.
The most enjoyable part of the conference was talking with the attendees, most of which were locals from London. I knew of many of them from their postings on the email group and it was nice to put a faces to the names. Their passion for software as a craft was invigorating. I expect great things to come out of those craftsmen.
The conference was hosted by the BBC. In the evening a few of us took a tour of the television center where we found a TARDIS (see right). I couldn’t resist the photo op. We ended up in the BBC club, ie Pub, and rejoiced in authentic British libations.
Check out some interviews at the conference.
#