Tuesday, 27 July 2010

Some ideas for programmer metrics

Lines of code is a terrible metric of programmer productivity, prone to all sorts of gaming of the system, and here's a great story to illustrate: -2000 lines of code (+ some nice discussion).  Bill Atkinson ends up subverting the simplistic management by entering -2000 under the lines of code box, signifying the net number of lines he contributed during the week.

Of course, what this didn't capture was the qualitative detail of his work: identifying bugs, deleting, adding, fixing, abstracting, simplifying.  No single number can capture that.

Indeed, the great W Edwards Deming warned -- but who takes notice? -- that taking any measure (simple or complex) and rewarding or punishing according to it is asking to be gamed.  Doing so made #3 in his list of seven deadly diseases:
1. Lack of constancy of purpose
2. Emphasis on short-term profits
3. Evaluation by performance, merit rating, or annual review of performance
4. Mobility of management
5. Running a company on visible figures alone
6. Excessive medical costs
7. Excessive costs of warranty, fueled by lawyers who work for contingency fees
That said, it's not to say that metrics can't be useful as a source of insight.  I wonder whether a simple multi-dimensional metric on lines-of-code could be helpful.

Suggestion:
1. Lines of own code added
2. Lines of own code deleted
3. Lines of others' code added
4. Lines of others' code deleted
5. Lines of code deleted by others
I envisage that collecting this kind of data on a weekly basis (say) could show interesting patterns for individuals over time, and corroborate gut feelings about who is refactoring vs adding functionality vs breaking stuff etc.

Another aspect to consider is the scope of these metrics. Does one measure individuals, pairs, or whole teams? If the metrics were implemented for the whole team as a means of self-assessment changes over time could be due to external factors (changes in the kind of functionality requested, crunch times, etc.) or internal factors (learning, change of personnel, change of practices, etc.).

Saturday, 19 June 2010

Tuesday, 15 June 2010

Turning MS Office into a game

There's now a plugin to Microsoft Office, Ribbon Hero, that adds simple game dynamics to encourage users to better learn how to drive the darn thing, betwixt coffee breaks.

Informative article, here.  Excellent slides:



Beats the hell out of reading the manual.

Tuesday, 4 May 2010

Bad writing

"The truth is, most US academic prose is appalling: pompous, abstruse, claustral, inflated, euphuistic, pleonastic, solecistic, sesquipedalian, Heliogabaline, occluded, obscure, jargon-ridden, empty: resplendently dead."

-- David Foster Wallace, in Authority and American Usage
Seen on Hacker news.  See also this article on business writing.

Tuesday, 13 April 2010

C# is *slowly* turning into Eiffel

When I first read Bertrand Meyer's fabulous tome, Object-oriented Software Development, (2nd edition). in 1997 I guessed that it was ten years ahead of its time.  Seems like I wasn't too far off the mark, with .NET 4 introducing language independent support for Design by Contract, as code contracts, and patching up some of the covariance and contravariance issues of previous versions.

How long it will take for most programmers to use the techniques well is anyone's guess, but having mainstream tools that support these approaches is a good thing.

Wednesday, 7 April 2010

Non-functional requirements

There's a lot of unglamorous stuff in software that is just "expected", and accounts for some of the project cost that you will miss when imagining two guys in a garage (or cafe) knocking out a quickie project.  Here's a handy list: Non-functional requirements: Minimal checklist.

Thursday, 11 March 2010

ToneMatrix: A fun, simple music synthesizer

ToneMatrix (Flash-based): The pattern determines the sound.  Example pattern:


Right-click copy and paste let's you save compositions as text.

Examples abound in the reddit discussion.

I must try my kids on this ...

Wednesday, 10 March 2010

Harmony: A neat drawing tool in JavaScript

Flash-free graphics in the browser is getting easier to do, and snazzier:



Try it here. View the source to see the JavaScript.

Monday, 8 March 2010

mmmm ... CoffeeScript

The most commonly used programming language in the world today, certainly within the browse, JavaScript superficially resembles the Java programming language in its syntax, but at deeper levels it owes far more to lesser-known languages, such as Scheme and Self.

The Java part of the name and syntax apparently came about as a result of a decree from Marketing that Java was the next hot thing, and inventor Brendan Eich worked feverishly to swiftly put a Java-esque sheen over the top.  This, plus the cutesy name, helped mislead a lot of people for a lot years into thinking that it was a toy scripting language, and only with the more recent success of AJAX has its underlying power come to the fore.

And yet we are still burdened with the clunky syntax.

However, CoffeeScript promises to change that, with a new, lightweight syntax for JavaScript that owes a fair bit to Python and Ruby syntaxes, and a lot to experience with JavaScript.  An example:

# Uses a binary search algorithm to locate a value in the specified array.
binary_search: (items, value) ->
 
  start: 0
  stop: items.length - 1
  pivot: Math.floor((start + stop) / 2)
 
  while items[pivot] isnt value and start < stop
 
    # Adjust the search area.
    stop: pivot - 1 if value < items[pivot]
    start: pivot + 1 if value > items[pivot]
 
    # Recalculate the pivot.
    pivot: Math.floor((stop + start) / 2)
 
  # Make sure we've found the correct value.
  if items[pivot] is value then pivot else -1
 
 
# Test the function.
puts(2 is binary_search([10, 20, 30, 40, 50], 30))
puts(4 is binary_search([-97, 35, 67, 88, 1200], 1200))
puts(0 is binary_search([0, 45, 70], 0))
puts(-1 is binary_search([0, 45, 70], 10))

At time of writing CoffeeScript is only up to version 0.5.5, and syntax is not guaranteed to stabilize until 1.0, but IMO it's well worth a look.

P.S. A neat little blog post about CoffeeScript (with short examples) from Thomas Reynolds.

P.P.S. There are similar tools/nicer syntaxes for HTML (HAML), and CSS (Sass).

Tuesday, 2 March 2010

What makes a good entrepeneurial blog

In his good-bye to blogging article Joel Spolsky of Joel on Software fame paraphrases Kathy Sierra:
To really work, Sierra observed, an entrepreneur's blog has to be about something bigger than his or her company and his or her product. This sounds simple, but it isn't. It takes real discipline to not talk about yourself and your company. Blogging as a medium seems so personal, and often it is. But when you're using a blog to promote a business, that blog can't be about you, Sierra said. It has to be about your readers, who will, it's hoped, become your customers. It has to be about making them awesome.
Now, that's not the aim of this blog, which started off as a combo. semi-regular frustrated rant / the traditional idea of a web log (keeping a log of cool things the author found on the web) / cute things about my kids, but nonetheless I reckon it's spot-on.

Wednesday, 10 February 2010

They should be remaking bad movies ... and fixing them

Wise talk from Ed Catmull, president of Pixar and Disney Animation studios, on what he's learned:



Gems (paraphrased):
  1. Give a good idea to mediocre people and they'll muck it up; give a mediocre idea to good people and they'll fix the idea, or throw it out and get a good one.
  2. A movie or product isn't just one idea, it's thousands, and most of them need to be done right for you to succeed, so you need a good team
  3. People are always remaking good movies; they should be remaking bad ones that were based on good ideas, but poorly executed
  4. People and how they function is more important than ideas
  5. It's very possible to misunderstand the reasons for your success
  6. What's important are the things that affect behavior
Plus insights into why people don't like to do post-mortems, gaming "the system", communication structure vs company structure, and why successful companies fail.

Sunday, 31 January 2010

Hygiene and Motivation

In Nine Things Developers Want, Rob references Herzberg's Two Factor Theory:
In the 1950s a researcher named Frederick Herzberg studied 200 engineers and accountants in the US. He asked them a few simple questions and came up with what is one of the most widely-accepted theories on job satisfaction called Two Factor Theory.
His theory breaks job satisfaction into two factors:
  • hygiene factors such as working conditions, quality of supervision, salary, safety, and company policies
  • motivation factors such as achievement, recognition, responsibility, the work itself, personal growth, and advancement
Hygiene factors are necessary to ensure employees don’t become dissatisfied, but they don’t contribute to higher levels of motivation. Motivation factors are what create motivation and job satisfaction by fulfilling a person’s need for meaning and personal growth.
In his cracking TED Talk Dan Pink delves into some of the behavioral research that explores the consequences of using extrinsic factors such as monetary rewards as motivational tools:



Bottom line: extrinsic rewards tend to narrow focus and hamper creativity.

Thursday, 28 January 2010

Some powerful Javascript tools

As the web-browser turns into the client of choice, it's good to have powerful tools to hand.  To whit:

 No doubt more to come.

Thursday, 21 January 2010

See no evil, hear no evil, speak no evil

The three wise monkeys together embody goodness of mind, speech, and action.



Daughter Ella, aged four, embodies cheekiness of mind, speech, and action.

Friday, 20 November 2009

My son just conducted the Melbourne Symphony Orchestra!

This morning our family went to a Classic Kids concert given by the Melbourne Symphony Orchestra. Lots of fun music and dancing and learning about the instruments and sections of the orchestra. The different sections were dressed in different colored tops to aid identification, a la the Wiggles, and the conductor had a multi-colored top on.

The MSO, in more formal attire

A boy and girl were selected to conduct The Liberty Bell, and my kids, who were seated at the front were predictably disappointed not to be picked. But wait ...

After kicking off the finale, The William Tell Overture ("Hi ho Silver - away!"), one of the most thrilling showpieces in the orchestral repertoire, the conductor, Ben -- Benjamin Northey, bless him, may he have a long life and outstanding career -- dashed into the audience, asked Jake's Mum if he'd like to conduct (swift affirmative response), and led Jake to the podium where he handed Jake the baton. Jake proceeded to perform with verve, enthusiasm and undisguised joy for about 3 minutes, all the way to the end of the finale, followed by wild applause from the audience.

Benjamin Northey, my favorite conductor

It was awesome. I was in tears, Andi (Jake's mum was in tears), and Ella no doubt expects to get to conduct the orchestra next time round. It was awesome and inspiring. A child came up to Jake afterwards and said that he was better than the real conductor; that kid will not grow up to be a music critic, but bless him too!

On questioning Jake said that the fast bits were more challenging to conduct than the slow bits, and that even though conducting was fun, he would prefer to be an inventor of new musical instruments when he grows up than an orchestra conductor.

Jake played Moses at kindergarten (with stick), and conducted the MSO at age 5 in the William Tell Overture with baton. What a little legend!

Andi's post on the same incident.

Update: Andi wrote to Benjamin Northey to thank him. Here's his reply:
From: Benjamin Northey
Sent: Sunday, 22 November 2009 11:32 AM
To: Andi Herman
Subject: Re: Thank you

Hi Andi,

So kind of you to share this with me. Jake was pretty much the highlight of the week for us! The orchestra loved him and as you say, to see such pure joy was very special indeed - very moving. Loved reading the blogs also.

I hope that this is something Jake will remember for a long time. Please say hi to BOTH of your children from me!

all best, Ben
We hope so too. Thanks again, Ben.

Tuesday, 17 November 2009

So he writes books about movies?

From the "Overheard" section in mX:
Girl: I'm going to see Taming of the Shrew.
Friend: Is that like the book that's based on the movie Ten Things I Hate About You?
Girl: Not quite. It's by William Shakespeare.
Friend: Didn't he do Romeo and Juliet?
Girl: That's the one.
Friend: So he writes books about movies?
Girl: Have you ever been to English class?
Classic.

Friday, 13 November 2009

Opposite rhymes

My daughter Ella, who is not yet four, has invented a new word game called "opposite rhymes".

You know how the word game "opposite pairs" works: Name pairs of words that are opposites. For example:
  • Big - little
  • Black - white
  • Hot - cold
And "rhyming pairs":
  • Fiddle - middle
  • Hot - cot
  • Head - said
But in opposite rhymes (also known as rhyming opposites) you have to do both at once, making it considerably harder:
  1. Ella: Tall - small
  2. Andi: Happy - crappy
  3. Andi: Sad - glad
  4. Dan: Familiar - unfamiliar (deemed unacceptable)
So I'm pretty impressed with my little girl for inventing this new form of wordplay and finding the first one.

Can you find of any others? It ain't easy.

Sunday, 8 November 2009

Which religion should I follow?

Gone are the days when one simply followed the religion of one's forefathers and foremothers. For those who find themselves confused by all the different choices on the market, here's a handy visual guide:

Click for a larger and clearer version

Hopefully people of all faiths and non-faiths are equally offended and amused.

Monday, 26 October 2009

Promoted - again!

It seems to be the season. Around this time last year I was promoted to CTO, and this time round, my boss has decided to move on, and I have stepped up to the hot seat of CEO-dom.

All of this has been bad for my Kibitz blogging, although I have been contributing to a new blog all about our emerging visual collaboration product: bCisive Online:

A diagram quickly knocked up in bCisive Online - click to enlarge

Divide and conquer meets visual thinking meets true real-time collaboration. Interested? Check it out, and get in touch.

That said, I'll try and post the occasional kibitz or update here too.