June 16th, 2005

diesel, learning, evil, sweeti

Marketing trumps Code

This was originally sent out to a couple of people. I put it here for idle curiousity.

This has been brewing for a while but is largely unformed. Please feel free to fill in the gaps in my argument yourselves. Then get back to me with them. You know, just to check that your reasoning is the same as mine. *cough*

Currently it's very rough - more like fleshed out notes thatn a coherent argument.

Largely this rant will be focussed on Perl technologies because, well, that's what I know most about. The principles can be applied to a lot of things.

The Perl community seems to be gradually disintegrating. Actually, that's nto true, it's getting larger but it's getting larger less quickly. This bothers me because there's nothing actually wrong with Perl per se - there are gripes for sure but nothing fundamentally broken. It just seems to have lost momentum because, well, what else would you do to it?

With this loss of momentum comes a loss of advocacy. As such, very cool projects - killer apps in other languages, get ignored. There are usually a bunch of reasons for this but in essence, I think, it's to do with marketing.

A case in point two Wiki toolkits written in Perl called CGI::Wiki and Kwiki (the Kwiki Wiki). CGI::Wiki was technically superior but Kwiki was easy to install. Kwiki had a charismatic developer who shouted a lot about it. CGI::Wiki didn't. Kwiki doesn't have versioning out of the box (dependencies are too hard) and didn't in fact get the feature for a while. CGI::Wiki eventually got CGI::Wiki::Kwiki which allowed you to use all the features of Kwiki and made it easy to install and set up. It was too late. More on charismatic leaders later.

Cross languages Twisted for Python seems to be analogous to POE for Perl. Twisted has the benefit of being a standout project for Python. POE is, for sure, a good module on CPAN but it's got nowhere near the publicity that Twisted has, not even in the Perl community? Why? Better name? Maybe.

Ruby On Rails has a lot of hype at the moment - it's called a killer app even though similar frameworks exist for other languages (Catalyst and Maypole in Perl for one). The momentum is self sustaining, it's hard to keep developing something when there's no user community and no cheer leader section and so eventually it becomes self fufilling, somethignt hat was seen as somehow better does actually become better (Linux and *BSD are a sort of case in point here although there were a bunch of other features)

It's not limited to projects though - I've ranted often about hwo frustrated I was at Yahoo that it didn't matter how hard I coded, Google were always seen as better. I had a flame war on a mailing list were one guy insisted that Yahoo did paid placement of results and Google did none - it took screen shots with highlighted sections for me to show him that both did so called sponsored matches which were *more* highlighted in Yahoo and that users loved them because, in short, when you play 40K+ GBP for a sponsored match you make *damn* sure that it's relevant to the keyword. The problem was marketing and grass roots support. We didn't have any, they were getting puff piece articles in the NYT, later syndicated worldwide, that showed how they were tracking the Las Ketchup phenomenom. Because, you know, EVERY OTHER SEARCH ENGINE COMPANY WAS JUST IGNORING THEIR LOGS.


As an aside I recently saw an article in the Daily Mirror which said that Google's new London Office was ground breaking. The photo showed a typical cubical farm but it had a ... sofa. And they got free soft drinks. When I'm sitting in the Sky Bar or down in the cinema, drinking my free soft drink (inlcuding Diet Coke with Lime nowadays) I'll actually be wistfully wishing I was back in a cube farm. Oh. Wait. No I won't.

Charismatic leaders seem to make a hell of a difference - Steve vs John Sculley, Linus, Miguel D'Icaza, Theo D'Raadt, Larry, Guido, Matz.

As a sort of counter example - Ajax. Jesse James Garret puts a name to an old technology and suddenly it's the second coming providing it with the momentum it needs to become a much healthier product (although I have another rant somewhere about about getting this awful feeling that we're building this teetering stack of technologies to make sure that we can do stuff on the web that we could do 30 or 40 years ago)

Answers on a post card to the usual address. Feel free to pass on if it won't embarrass you.

diesel, learning, evil, sweeti

Pel Mel

At someone else's behest at work I spent a couple of days writing something called Pel::Mel. Basically it acted as a bridge between Perl and MEL, the Maya Embedded Language. The advantages of this are huge - you get support for namespaces and CPAN within MEL and we can do a much better job centrally installing and versioning extensions. The way it works is quite, well, evil.

Essentially it opens a port to Maya and speaks through that. Callbacks are done by recognising a callback being apssed in, stashing it somewhere and then installing a global callback in Maya space that actually writes to a FIFO which the Pel runloop then picks up and demarshalls back into arguments for the actual callback.

I know. I was vageuly surprised when it worked too.

What it does mean is that you can write stuff like ...

    my $pel = Pel::Mel->new( port => $port );
    my $win = $pel->window( -vis => 1, -title => 'myWin64'  );
    $pel->rowColumnLayout( -numberOfColumns => 4 );
    for (1..64)  {
          $pel->button(-label => $_, -command => [\&foo,$_,"second call back"] );
    $pel->button(-label => "quit", -command => [\&foo,"quit"] );
    $pel->window(-edit, -width => 400, -height => 428, $win);
    sub foo {
        my $data = shift;
        my $next = shift;
        if ("quit" eq $data) {
        } else {
            print "callback from perl $data\n";
            print "second argument to call back - '$next'\n" 
                    if defined $next;
            print "\n";


    my $url  = "http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml";
    my $feed = get($url);
    my $rss  = XML::RSS->new; $rss->parse($feed); 
    my $text = "";
    foreach my $item (@{$rss->{"items"}}) 
        my $title = $item->{title};
        $title =~ s/[^\w ]/ /g;
        $text .= $title . "; ";
        last if length($text) > 255;
    $text =~ s/; $//;
    my $groupname = $pel->group(-n => "Text_foo0", -em);
    my $string    = $pel->textCurves(-ch => 0, 
                                     -f  => "Courier", 
                                     -t  => quote_arg($text), 
                                     -n  => $groupname);
    $pel->setAttr(${string}.".translateX => 0);                                                  
    $pel->setAttr(${string}.".translateY => 0);                                                  
    $pel->setAttr(${string}.".translateZ => 0);  
    $pel->setAttr(${string}.".rotateX" => 0);                                                     
    $pel->setAttr(${string}.".rotateY" => 0);                                                     
    $pel->setAttr(${string}.".rotateZ" => 0);                                                     
    my $off = 0;
    while (1) {
        $pel->setAttr(${string}.".translateX" => -$off);  
        $off = (++$off%200);
        select(undef, undef, undef, 1/$FPS);

The last one gets the BBC news headlines and scrolls them through a scene. It's funny loading it into existing scenes and seeing letters float behind characters' heads.

diesel, learning, evil, sweeti

Transferring the bot

I have a terrible tendency to nearly get projects done and then not finish with them. Last weekend I finally decided to sit down and move dipsy over to her new code base. Except the tests weren't passing because some poeople decided that refactoirng is fine as long as you don't check against the tests. *sigh*

Finally got round to fixing those up and then this morning I moved her over. And Lo! It worked. Huzzahs all round. Except that trying to get all the keys out of a DBM::Deep db is slow. Hella slow. And would cause the bot to lock up for ages. Which was bad.

So now I'm trying to transfer her brane across to a mysql DB and see if that works. I have a horrible lurking feeling that it's just a problem with the fact that dipsy's brane contains 93,957 factoids at the last count and trying to work out which keys are variable keys from that is always going to be slow. Which is a shame.

There are a couple of ideas I have to fix it if that's the case but the simplest is probably for each plugin to have a vars() method that returns a list of variable names.