Wednesday, March 26, 2008

Parsing command line args

I love the way it's done in Gant!!

def cli = new CliBuilder ( usage : 'gant [option]* [target]*' , parser : new GnuParser ( ) )
cli.c ( longOpt : 'usecache' , 'Whether to cache the generated class and perform modified checks on the file before re-compilation.' )
cli.d ( longOpt : 'cachedir' , args : 1 , argName : 'cache-file' , 'The directory where to cache generated classes to.' )
cli.f ( longOpt : 'gantfile' , args : 1 , argName : 'build-file' , 'Use the named build file instead of the default, build.gant.' )
cli.h ( longOpt : 'help' , 'Print out this message.' )

cli.l ( longOpt : 'gantlib' , args : 1 , argName : 'library' , 'A directory that contains classes to be used as extra Gant modules,' )
cli.n ( longOpt : 'dry-run' , 'Do not actually action any tasks.' )
cli.p ( longOpt : 'projecthelp' , 'Print out a list of the possible targets.' )
cli.q ( longOpt : 'quiet' , 'Do not print out much when executing.' )
cli.s ( longOpt : 'silent' , 'Print out nothing when executing.' )
cli.v ( longOpt : 'verbose' , 'Print lots of extra information.' )

cli.D ( argName : 'name>=<value' , args : 1 , 'Define <name> to have value <value>.  Creates a variable named <name> for use in the scripts and a property named <name> for the Ant tasks.' )
cli.L ( longOpt : 'lib' , args : 1 , argName : 'path' , 'Add a directory to search for jars and classes.' )
cli.P ( longOpt : 'classpath' , args : 1 , argName : 'path' , 'Specify a path to search for jars and classes.' )
cli.T ( longOpt : 'targets' , 'Print out a list of the possible targets.' )
cli.V ( longOpt : 'version' , 'Print the version number and exit.' )

def options = cli.parse ( args )

parse(args) returns a map you use like so...


if ( options.h ) { cli.usage ( ) ; return 0 }
if ( options.l ) { gantLib << options.l.split ( System.properties.'path.separator' ) }
if ( options.n ) { GantState.dryRun = true }
def function = ( options.p || options.T ) ? 'targetList' : 'dispatch'
if ( options.q ) { GantState.verbosity = GantState.QUIET }
if ( options.s ) { GantState.verbosity = GantState.SILENT }
if ( options.v ) { GantState.verbosity = GantState.VERBOSE }

PS. I'll try to clean this up later... pygments.org looks neat!

Tuesday, March 25, 2008

The Four Stages of Learning

Unconscious incompetence

In the first stage of learning you don't know you're no good - ignorance is bliss! Sometimes this comes from simply having preconceptions about how easy a task is and sometimes it comes from not knowing there's a better way. Dysfunctional teams and developers are often unaware of what they're doing wrong, even if it becomes obvious when scrutinized.

Conscious incompetence

The second stage of learning is the tricky one as it starts to dawn that you're not actually all that good! At this stage, teams and developers need a lot of support to prevent them wallowing in despair and to help them select and adopt new techniques.

Conscious competence

In the third stage of learning you're consciously applying the techniques you need in order to be "good". Here teams and developers know what they should be doing but need their momentum to be maintained, often by external encouragement and review.

Unconscious competence

At the fourth stage of learning you're naturally doing things right.

Monday, March 24, 2008

Interview: Nathan Shedroff

An interview by Kate Rutter with Nathan Shedroff about blending the roles of designer and business analyst in a new program being offered at the California College of the Arts. Brilliant...

[KR]: It seems that a common attribute of similar programs is to blur the boundaries between fields, and to foster the ability to synthesize…to cross-pollinate concepts and ideas across different functional areas. With this trend towards generalization, how do you avoid teaching people to be, for lack of a better phrase, Jack-or-Jane-of-all-trades but master of none?

[NS]: This is a great question. There’s no way we can teach students everything they need to know. We’re specifically looking for passionate individuals who will take what we learn together and apply it to the passions, interests, and experience they already possess. Their learning is life-long so the best we can do is frame some of these perspectives and skills for them, give them some experience, and inspire them to continue the process. We’ve prioritized, in the curriculum, the skills, knowledge, and experiences we think they will need the most, but it’s just a start. Besides, there’s only so much you can learn in school. At some point, you need to learn “on-the-job” — whatever that job may be. So, we’re exposing our students to a variety of skills but with unified perspectives (design-led innovation, meaningful experience, sustainability, and visionary leadership) so that their deep skills will follow these lines. They will be expert innovation leaders and will be able to apply these skills to any domain or challenge.

Sunday, March 23, 2008

Bounded Irrationality or Decision Making Traps

1. Anchoring

When considering a decision, our minds are unduly influenced by the first information we find. Initial impressions and data anchor subsequent judgments.

2. Confirmation

Through selective search and perception, we subconsciously seek data that supports our existing point of view, and avoid contradictory evidence.

3. Memorability

We are overly influenced by recent or dramatic events. Repetition from one or multiple sources can also influence belief, memory, and judgment.

4. Status quo

Decision makers exhibit a strong bias toward conservatism, inertia and alternatives that perpetuate the status quo. We look for reasons to do nothing.

5. Sunk cost

Unwilling, consciously or not, to admit past mistakes, we make decisions in a way that justifies past choices.

From Ambient Findability (pg. 157)

User Experience

Peter Morville's definition of user experience is broader than most but I like the direction he takes it in... (His book Ambient Findability is fantastic btw.)

1. Useful

As practitioners we can't be content to paint within the lines drawn by managers. we must have the courage and creativity to ask whether our products and systems are useful, and to apply our deep knowledge of craft and medium to define innovative solutions that are more useful.

2. Usable

Ease of use remains vital, and yet the interface-centered methods and perspectives of human-computer interaction do not address all dimensions of web design. In short, usability is necessary but not sufficient.

3. Desirable

Our quest for efficiency must be tempered by an appreciation for the power and value of image, identity, brand and other elements of emotional design.

4. Findable

We must strive to design navigable web sites and locatable objects, so users can find what they need.

5. Accesible

Just as our buildings have elevators and ramps, our web sites should be accessible to people with disabilities (more than 10% of the population). today, it's good business and the ethical thing to do. Eventually, it will become the law. Standards-based design for accessibility also supports access via mobile devices.

6. Credible

Thanks to some ground-breaking research out of Stanford's Persuasive Technologies Lab, we're beginning to understand the design elements that influence whether users trust and believe what we tell them.

7. Valuable

Finally, it's not just about the user. Our sites must deliver value to our sponsors. For non-profits, the user experience must advance the mission. With for-profits, it must contribute to the bottom line and improve customer satisfaction.

From Ambient Findability (pg. 109)

Saturday, March 1, 2008

Information Hierarchies

It really is amazing the amount of information most people can absorb quickly if it's organized effectively. The 2 screens linked below illustrate this...

Yahoo Desktop1:

before-page-hierarchy

Yahoo Desktop2:

after-page-hierarchy

Differences between the first and second screens:

- 4 main content groupings: the search field, sidebar, main content area and tag cloud

- Data grouped to align with user goals like music, photos and documents

- Icons are used effectively to break up the different groups with the main content area

- Even fonts are used to group similar items with categories

[Proximity, shape, size and colour are all examples of some of the visual cues we'll use to group related things together.]