21 June 2006
Raleigh NFJS 2006

Recently Jay brought his current lineup of speakers to town for the 2006 NFJS Symposium Tour . Lots of great speakers. Packed with nuts and bolts details. It was buzzword compliant, with plenty of talks on AJAX and Ruby. Justin Gehtland’s talks on hibernate were excellent and can be found on codecite . These are polished speakers who have given these sessions many times prior. Dave Thomas could make event the most prosaic topic engaging and entertaining. The rare bit of wit, humor and humanity go a long way in this field.Points that stood out:

Keep Track of Your Ideas

Andy Hunt talked at length about keeping track of the ideas that occur to you throughout the day. Method doesn’t really matter. Some techniques he proposed: spacepen and pad, voice memos on your cell phone, wiki or wiki modes in your editor. I’ve installed potwiki to give it a try. Elsewhere on the web Michael Michalko seems to have a few things to say on this topic.

I like Michalko’s suggestions for developing ideas once captured:

  • What can be SUBSTITUTED? (Who else? What else? Other ingredient? Other process? Other power? Other place? Other approach? Can you change the rules?)
  • What can be COMBINED? (How about a blend, an alloy, an assortment, an ensemble? Combine units? Combine purposes with something else? Combine appeals? Combine ideas?)
  • What can I ADAPT from something else to the idea? (What else is like this? What other idea does this suggest? Does the past offer a parallel? What could I copy? Whom could I emulate?)
  • What can I MAGNIFY? (What can be added? More time? Stronger? Higher? Longer? Extra value? Extra features? Duplicate? Multiply? Exaggerate?)
  • What can I MODIFY or change? (What can be altered? New twist? Change meaning, color, motion, sound, odor, form, shape? What other changes can be made?)
  • Can I PUT the idea TO OTHER USES? (New ways to use as? Other uses if modified? Can you make it do more things? Other extensions? Other spin-off? Other markets?)
  • What can be ELIMINATED? (What to subtract? Smaller? Condensed? Miniature? Lower? Shorter? Lighter? Omit? Streamline? Split up? Understate?)
  • What can be REARRANGED the parts? (What other arrangement might be better? Interchange components? Other pattern? Other layout? Other sequence? Transpose cause and effect? Change pace? Change schedule?)
  • Can it be REVERSED? (Transpose positive and negative? How about opposites? Turn it upside down? Reverse roles? Consider it backwards? What if you did the unexpected?)

Class Oriented Development

During his keynote Dave Thomas took more than a few well-deserved pot-shots at the received wisdom in the software community. He ticked through some of the usual suspects: type safety, methodologies, backward compatibility. Simply stated, his thesis was: if you don’t a have direct and clear understanding of why you are doing something: stop doing it. One point that resonated with me was his characterization of Java and many other object-oriented languages as really class-oriented. We spend our days developing sophisticated class relationships and hierarchies. Is-a. Has-a. While these languages provide anemic support for actually orienting your development around objects; the heart and soul of your application at runtime. Few true hierararchical taxonomies exist in the real world. Classes were invented by stamp-collectors. Why are we trying to put the world into neat little boxes?

This was of course a shameless plug for features like mix-ins that exist in many modern programming languages . Either way this is an idea worth kicking around the block.

Learn By Doing

In his Refactoring your Wetware talk Andy Hunt drew on the example of surgerical residents who follow the pattern of observe, assist and perform. For surgeons there is no substitute for doing. The same is probably true for developers.

Put down that book. Close Firefox. mkdir testapp

13 June 2006
Vim7 Feature Roundup

I noticed Emacs 22 getting some press lately. So figured it was time to spread a little vim7 love .

Here is a grab bag of features I noticed.

Omni Complete


Completion now comes to vim. <ctl-x><ctl-o> and vim does it’s best to complete the symbol. It’s not perfect. The implementations look like they are mostly regexp’ing around. No knowledge type systems. Based on the contents of $VIM/autoload it looks like there’s out of the box support for: XML, HTML, CSS, C, JavaScript, PHP, Python, Ruby, and SQL. Sorry Java!

Quoted Text Select


New quoted text selection shortcuts while in select mode. With cursor in a string <ctl-q>i” will select all the text within double quotes. If you want the quotes <ctl-q>a” will do the trick.

:vimgrep


Vim now comes out of the box with a grep implementation that works well with existing errorlist functionality.Recursively look for all the FIXME tags in the ruby source tree.:vimgrep /FIXME/j C:/ruby/src/**.rb

View the hits and step through them

:cope

Tabs


Enable this feature and you’ll feel like you walked into a room with 3 switches that control the same light. It looks nice, but when cycling through buffers with :bnext and you can see any buffer in any tab. It’s there if you want it, but I suspect this will largely go unused by most gvim people.To open a new tab:

:tabnew

Spell Check


It’s 2006! I want a jetpack not spell checker!

Nothing too surprising here. Ships with English support. You can grab OpenOffice dictionaries and use the :mkspell to convert it into something vim can cope with. Notice red squiggles under the spelling errors and blue under the punctuation errors.

:setlocal spell spelllang=Fr_fr

Undo Branches


This is an excellent feature with a confusing name. Think of it as restore to any point in time during an edit session. It will save your bacon when you make some edits, undo a few levels, make some more edits and realize you wanted something back from before the undo. New commands support restoring to a text state based on time:

  • g+ / g- This is like u / CTRL-R except it will walk across all changes over time. Good candidates for mapping.
  • :earlier 5m Restore to state 5 minutes ago
  • :later 1h Restore to state 1 hour later
  • :undolist Show leaves in undo / redo tree

:MkVimball

Package and distribute plugins and vim macros into vba files with this new command. When opening vim will recognize the vba files and prompt to extract. Uninstall would be a nice addition.

:GetLatestVimScripts

A very lightweight package manager is now included. Make sure you have a version of wget in your path. Then create a file $VIM/getlatest/GetLatestScripts.dat that looks like:

ScriptID SourceID Filename
————————–

A call to :GetLatestVimScripts will then attempt to update all plugins aware of this new functionality.

It will update the file with version and date information. Note that vim ships with more plugins than this, but GLVS, netrw and vimball are the only ones aware of this new feature.

ScriptID SourceID Filename
————————–
642 5228 :AutoInstall: GetLatestVimScripts.vim
1075 5814 :AutoInstall: netrw.vim
1502 5828 :AutoInstall: vimball.vim

Script Enhancements

Vim’s macro language continues to evolve. Things like this are now possible:

:let num = { 1: ‘one’, 2: ‘two’, 3: ‘three’ }
:echo num[2]

One step closer to emacs convergence?

22 March 2006
Music to code by!

The already great somafm just launched space station soma.

Tune in, turn on, space out. Spaced-out ambient and mid-tempo electronica.

6 December 2005
Aardvark’d: 12 Weeks With Geeks

I finished Joel’s Aardvark’d documentary last night. It captured the experiences of his 4 interns for 12 weeks. Pointing a camera at 4 guys typing for 3 months and editing that into something entertaining is non-trivial. I struggled to find the thesis, but there was plenty to like.

Some observations:

What it is:

A little bit of advertising. Without being cynical, let’s be realistic. I paid $20 for this thing. Now I’m blogging about it. Mission accomplished.

A look through the key-hole at this medium’s potential. Cameras and computers are cheap. There’s more of this type of thing to come and they will build it’s strengths.

A tease for folks interested in the Y Combinator. Paul Graham’s work in Boston is briefly contrasted. Someone send a guy and a camera up there!

What it might be:

A HOWTO for companies starting internships. There more than a few lessons to be learned: find them housing, buy them a TV, let them get some skin in the game the first day by putting together their workspace, give them the same hardware as the rest of the team, give them a spec, etc…

A depiction of the banality that comes along with software development. Long nights where the only thing interesting that happens is a cockroach crawling across the floor. Endless debates in the forums. The office manager / secretary provides us the view of some one looking in from the outside.

What it wasn’t:

A deep look into the journey of the intern; intern as Ubermensch; emerges from long dark 12 week tunnel having re-evaluated prior ideals.

An insightful portrayal of the starts and stops of software development; the highs and lows; peaks and valleys. While some demos crashed and some bugs were found, the contrast between the intoxicating sensation of shipping and sober realities along the way went largely unaddressed.

21 July 2005
Book Review: Maven - A Developer’s Notebook

Maven: A Developer’s Notebook is a recently published book by Vincent Massol and Timothy O’Brien in O’Reilly’s Developer Notebook series. It fills a void in the market for a quality book on Maven. I had a chance to spend some time with Vincent while in Paris earlier in the summer; we talked about the book, his company: Pivolis, the French language and every manner of other topics. I’ve just now taken the time read through the book and should have done so earlier. It’s excellent. Vincent’s passion and focus comes across loud and clear.

According to O’Reilly’s site the Developer Notebook Series “is for early adopters of leading-edge technologies who want to get up to speed quickly on what they can do now with emerging technologies.” This book delivers on that promise, weighing in at under 200 pages, but providing the reader with more than enough to get them up and running quickly. It goes beyond the basics, covering customization via maven.xml, multiproject configuration, site customization, and plugin creation. A very practical set of labs are woven through the book as well; making the book suitable for use in a training class.

It is published at an interesting time with Maven2 in alpha. The book targets Maven 1.x, but Vincent and Tim don’t ignore Maven2. They make frequent references to features Maven2 will offer and help prepare the reader for migration when Maven2 is production ready.

The book comes along with a counterpart web site that offers up info on the book and additional content of interest to the reader: www.mavenbook.org

Some areas for improvement:

  • Help the reader understand if Maven isn’t for them. When is it overkill? When would something else be a better choice? What are the alternatives?
  • Additional coverage of XDoc; a poorly documented aspect of Maven that is generally learned by looking at other examples (read: cut and paste).

Three and half out of four stars. Great job…

5 July 2005
DAX Checked into Subversion

After a few months being off the air, the lights are back on. Relocation from the West Coast of the US to the East Coast, a month in France, selling a house, buying a house, and a new job have kept me a bit more occupied than I expected.

I’ve finally taken the time to check in DAX to the Subversion repository Lars setup for me. Point your svn clients over to: http://www.goshaky.com/svn/dax/

Some tiny changes:

  • Jar file naming is Maven compatible
  • @Path is now @Match
  • build.xml tidied up a bit

A few suggestions have been sent along; I may get to some of these…

  • Use annotations for the POJO -> XML mapping of simple Java types; mitigating the DOM4J dependancy.
  • Support XPath2; perhaps via Saxon
3 March 2005
Introducing DAX: Declarative API for XML

Inspired by XSLTO, I’ve put together a bit of code to allow XSLT like tranformations from within Java. DAX glues together Java 5 annotations, Jaxen XPath and DOM4J to make possible the declarative style of processing shown below.

Getting Started

  • Install JDK 5 and a recent flavor of Ant
  • Download DAX here
  • Extract and do an “ant test”
  • “ant javadocs” for API guide
  • Look at the dax.examples package for sample code

More postings to follow. Stay tuned…


public class BindingTransform extends Transformer {

	public List items = new ArrayList();
	private RSSItem currentItem;

	public BindingTransform() {
		// tell engine about anticipated namespace
		setNamespace("dc", "http://purl.org/dc/elements/1.1/");
	}

	public void init() {
		items.clear();
	}

	public void complete() {
		for (RSSItem i : items) {
			System.out.println(i.getTitle());
		}
	}

	@Path("//item")
	public void item(Node node) {
		currentItem = new RSSItem();
		items.add(currentItem);
		applyTemplates(node);
	}

	@Path("item/title")
		public void title(Node node) {
		currentItem.setTitle(node.getStringValue());
	}

	@Path("item/link")
		public void link(Node node) {
		currentItem.setLink(node.getStringValue());
	}

	@Path("item/description")
		public void description(Node node) {
		currentItem.setDescription(node.getStringValue());
	}

	@Path("item/dc:creator")
		public void creator(Node node) {
		currentItem.setCreator(node.getStringValue());
	}
}
23 February 2005
What Great Java Developers Ought To Know ( stone soup version )

What would a Java version of this post look like?

What Great .NET Developers Ought To Know (More .NET Interview Questions)

20 January 2005
XPath Performance Followup

Shirasu has extended my XPath benchmarking work to include testing across object models.

His observations:

  • Traversal of Jaxen is a bit slower than others.
  • Performance of JXPath does not depend on object models generally. JXPath uses the original traversal mechanism (i.e. NodePointers), and this mesurement suggests that it does not use object model explicitly.
  • Jaxen and Saxon in DOM is a bit slower than ones in JDOM and XOM.
  • The following-sibling traversal of Saxon in DOM is a bit slow, but good in JDOM and XOM
  • Details in English

    Details in Japanese

    14 January 2005
    Tips for Computer Book Authors

    Over the last 18 months or so I’ve had the great experience of reviewing a handful of books in various stages of development. In doing so I noted several patterns that emerged and captured them here. Enjoy!

    Make sample code stand-alone test cases

    Whether you are developing Python or PowerBuilder, chances are there is a unit-test framework available. Leverage these frameworks in creating your samples. It forces discipline upon the author to keep examples small and self-contained. More significantly, it provides code that will compile and be immediately useful to readers.

    Never underestimate the power of copy and paste.

    Lucene in Action

    Testing Frameworks

    Develop reader personas

    Writers face the challenge of crystallizing target readers. What is their level of education? What is their experience with the subject being presented? More importantly, writers face the less obvious question: Who are they not writing for? Poor attention to these questions manifests itself in the form of inconsistencies like: assuming the reader understands the quicksort algorithm but in the previous chapter explaining how to download and unzip a file.

    Borrow a technique from the design world to mitigate this challenge: Develop full-blown personas of your readers. Include photos. Include a work-history. Is this the type of person who wants to go home at 5PM or understand the subject from the inside out? What is their reading style? Make a few copies. Hang them on the wall where you write. Send them to your editors.

    Mercilessly challenge yourself: Is this something the readers already know? Is this something readers need additional foundation on?

    Perfecting Personas

    Define your value proposition

    Odds are, your book is not the only one on the subject. In the planning stages of the book define your value proposition in clear terms. Send it to your editors. What does your book bring to the party that no other does? Does it consider common pitfalls? Does it describe internal implementation details? Is it aimed specifically at beginners or advanced readers? Is it a comprehensive treatise on a subject?

    Struggling to come up with your value proposition? Maybe the project isn’t such a great idea.

    Consider various styles of reading

    A small minority of your readers will make a front-to-back consideration of your manuscript. More readers look for answers to a specific problem. Still more read in an exploratory style, seeking an overall survey or looking for topics that interest them. Ask yourself: How do I serve these various types of readers? Devices such as “Best Practices” or “Pitfalls” beak-out boxes help capture the attention of explorers. A topical Q&A summary can serve the answer seekers.

    Think about the guy at Borders flipping through your book on a rainy afternoon. Remember the frantic developer spilling cold coffee on your book as he works on solving a problem with a production system.

    JUnit In Action
    Head First Design Patterns

    “Don’t be too pleased with yourself.”

    This one is borrowed from the style guide provided to writers of the Economist magazine. The idea’s relevance to programmers is emphasized in Larry Wall’s consideration of great virtues a programmer. In it he defines “Hubris” as:

    “Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won’t want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience. (p.607)”

    Self-confidence is a good thing; leave it unchecked and you will endear yourself to few readers. For whatever reasons, the industry breeds excessive self-assurance. Challenge yourself: Can use of the first person singular be reduced? Better yet, eliminated entirely? Do you see phrases like: “A naive programmer would…” or “Inexperienced users might…”?

    Respect your reader; they could probably teach you a thing or two.

    3 Traits
    Economist Style Guide

    Leave your fingerprints on the manuscript

    This is the corollary to “Don’t be too pleased with yourself”. Without being self-serving let your unique voice be heard. You represent a unique intersection of experience, education and ideas. Let this individuality come through. Have you been consulting for years and seen techniques succeed or fail. Tell readers about it! Have a relevant war story? Share it! Inject some personality; relentlessly combat a dry documentary style.

    If you are not consciously battling tedium, you have ceded to it.

    Enterprise Java w/o EJB

    Use a single problem domain for sample code

    Don’t be seduced by metasyntactic variables. Pick a realistic problem domain and stick to it. Don’t switch from stock quotes in the first chapter to class scheduling in the second. Let your reader reap the benefits of investing time in understanding the problem domain. Note: This is not to say examples should be cumulative and dependent on prior chapters.

    Allow them to focus on the message and not the means to convey it.

    Hibernate: A Developer’s Notebook
    Metasyntactic Variables

    Say more by saying less

    Keep your language simple and eliminate digressions. Simple words are the most powerful. “It was the best times, it was the worst of times…”. “In the beginning…”. “We didn’t land on Plymouth Rock…” Unsparingly revise long and wordy sentences. Watch some DVD commentaries and listen to directors wax-nostalgic about scenes they deleted in the interest of producing a better film. Learn from them. Don’t make your book the next Ishtar. Unsympathetically delete sentences, paragraphs and chapters.

    You’ve got work to do if you can’t remember the last time you simplified a sentence or deleted a portion of your manuscript.

    Cryptography Decrypted

    Cite other works

    Citations reinforce the hard work that went into the manuscript. More importantly they show readers where more can be learned on a specific topic. Subscribe to O’Reilly’s Safari service. Spend some time at a good book store. Work with your publisher to get copies of books they publish on related topics.

    Unix System Administration Book
    Code Complete

    Communicate compromises

    Every technology represents a series of compromises. Communicate these to the reader. Don’t make them learn the hard way. This isn’t a hammer for every nail. This isn’t a solution to every problem. Challenge yourself when outlining a topic: What are the relative merits the implementation? What were the alternatives? When should this technology not be employed? What would my readers benefit most for knowing?

    Prove to your reader you’re not a zealot.

    Effective XML ( particularly items 24,25,41 )