Jan 22

The genius behind the Google 20% time; It isn’t the time

Google, Tech 5 Comments »

googledrex

Paul Buchheit has a really nice post on the power of code over talk and has one item that resonated with me:

This is where Google’s “20% time” comes in — if you want innovation, it’s critical that people are able to work on ideas that are unapproved and generally thought to be stupid. The real value of “20%” is not the time, but rather the “license” it gives to work on things that “aren’t important”. (perhaps I should do a post on “20% time” at some point…)

That is exactly how I felt about 20% time. It wasn’t about the time. In fact, I didn’t actually know that many people who took the time! The key was the following effect:

  • In order for 20% time to work, anyone must be able to see what is out there
  • In fact, if you want to get some people working “for free” you need to both advertise your project, and write it in such a way that it is easy to get ramped up and productive (end result: better code)

The end result is the culture HAS to be kept very open. The ability to see the projects that are worked on, check out the code, see presentations and design docs, is a key reason why Google does so well at engineering in my opinion.

Compare this to companies such as Apple where you don’t know what the chap sitting on the other side of the cube is doing. Therefore, even if you have some amazing wisdom that could be game changing for his project, it will never happen.

20% time means that sparks of genius can happen. If you copy anything about it, ignore the “time” part, and go with the open culture part.

Whenever I saw projects that were secret within Google it irked me. It stopped this from happening. It was as though that project was going walkabout instead of joining the party.

Jan 20

Why I often prefer Prototype too

Ajax, Tech, Web Frameworks with tags: 9 Comments »

protofun

Picture via Dunechaser

I still get asked “what Ajax framework should I use?” frequently indeed. I think that people feel that with my Ajaxian postings I have seen every framework in the world and will have a magic feel for things.

I dread these questions, as context is king for making the decision, and “feel” is a major part of it too. The various frameworks have in many ways come closer together over the years, so making the choice is harder, but also maybe not as big a deal as it once was.

That being said, I really enjoyed Glenn Vanderburg talk about why he prefers Prototype to jQuery. This is the kind of subject that is asking for trouble and foaming at the mouth from people on various camps. Glenn has the kind of nature, wisdom, and touch that makes it hard to think that way. He gives thoughtful points and isn’t trying to cause a stir.

These days, without any real context (e.g. skills on the team, what the project does) I kinda think:

  • jQuery is fantastic for taking a website and making it dynamic. Easy. elegant. Beautiful. If I was a designer doing a rich site I would stop here.
  • Dojo is fantastic for building a large scale application that will do a lot, and end up with a ton of JavaScript. Everything you need will be found there. This isn’t to say that Dojo can’t be used on the small anymore. The new core is small and fast and good.

Prototype, for me, fits in between these worlds. It is small enough to feel small (not a huge library to learn) yet large enough that I don’t jump out into creating a lot of my own code.

On a recent jQuery project that grew fairly big and I found myself surprised that the core didn’t have certain methods and features. Much of it was small things (one example I remember is array utilities). I would find myself looking around for plugins, wondering which ones are good, and generally having a little bit of a tough time. Then there is a the type system. For something that isn’t strapping on a bit of code to the web site, I actually like Class.extend and the like. With jQuery I would use Traits or Base or something which is fine…. but not just there in the same way.

I get used to myArray.last() and having the convenience methods available to me directly on the objects, even if the puritan in me feels a little strange. Just as Ruby “felt right” to me. Prototype does too (duh, since its heritage). A blend of purity and pragmatism. More often than not Prototype surprises me “oh, wow, it has that function already!” On another recent project that got converted to Prototype, I was able to delete a LOT of code. Utility classes went away. Libraries went away. There is nothing better than the feeling of deleting code. Am I right? :)

So, I agree with Glenn. For me, Prototype is the right balance for many of my projects. I still enjoy playing and using others when the project calls for them, and I am ignoring the huge number of other great frameworks (YUI, GWT, MooTools, Ext, SproutCore, Cappucino, man I could go on forever here).

Jan 19

Frustrating User Experiences: Remember what I say Wordpress!

Tech, UI / UX with tags: 4 Comments »

Wordpress 2.7 is such a breath of fresh air. The admin interface feels great and they fixed so many small things that used to drive me nuts.

One of these items was the file uploader. Here is Wordpress 2.6:

wp26

My use case is that I use the full size image 99.99% of the time. I never want to link to the image itself in the hyperlink. However, the admin interface tries to force me down that path EVERY darn time. I would find myself hacking up the Wordpress code to give me what I want, and then when I upgrade I had to do it all over again. Grr.

Then I upgraded to Wordpress 2.7 and got:

wp27

It remembers. Imagine that! Kudos to the Wordpress team.

Jan 07

TokenObject: A strange little piece of code that creates objects for me

JavaScript 2 Comments »

Do you ever write random bits of code and wonder why you are doing it? Something that seems worth it at the time and then you really wonder?

I just did this with a class that I call TokenObject. The goal of this trivial class is to take a string, and give me a nice way to get pieces out of it. Normally I would use split and grab the right piece, but I was doing so much conversion from “command line string” to an object, that I ended up with something that lets me do this:

var userpass = "dion password";
var up = new TokenObject(userpass, {params: "user pass"});
// up.user;
// up.pass;
// Can also get via: up.param('user'); up.param(0);

Funny huh? :)

/*
 * TokenObject: Given a string, make a token object that holds positions and has name access
 */
 
var TokenObject = function(input, options) {
	this._input = input;
	this._options = options;
	this._splitterRegex = new RegExp(this._options.splitBy || '\\s+');
	this._pieces = input.split(this._splitterRegex);
 
	if (this._options.params) { // -- create a hash for name based access
		this._nametoindex = {};
		var namedparams = this._options.params.split(' ');
		for (var x = 0; x < namedparams.length; x++) {
			this._nametoindex[namedparams[x]] = x;
 
			if (!this._options['noshortcutvalues']) { // side step if you really don't want this
				this[namedparams[x]] = this._pieces[x];
			}
		}
 
	}
}
 
TokenObject.prototype.param = function(index) {
	return (typeof index == "number") ? this._pieces[index] : this._pieces[this._nametoindex[index]];
}
 
TokenObject.prototype.length = function() {
	return this._pieces.length;
}
Jan 02

Loving Ubiquity; Extending the Web in 2009

Ajax, Tech, Web Browsing 4 Comments »

I have a project that deals with JavaScript commands that anyone can author, so I decided it would be smart to take more time looking and integrating with Ubiquity which recently got another beautiful upgrade.

Ubiquity really is the “other” command line of the Web (the URL bar being the first one). It gives me Quicksilver like access, but also has huge improvements: Writing plugins is simple JavaScript, and you can subscribe to commands from other people. This is huge. A social command-line!

There is a built in tinyurl command, but I use tr.im one these days, so I quickly wrote one:

CmdUtils.CreateCommand({
  name: "trimurl",
  homepage: "http://almaer.com/firefox/commands/",
  author: { name: "Dion Almaer", email: "[email protected]"},
  license: "ASL",
  description: "Sends your URL to tr.im instead of tiny url",
  help: "Just type in the URL!",
  takes: {"url to shorten": noun_arb_text},
  modifiers: {"as": noun_arb_text},
 
  preview: "Replaces the inputted URL with a Tr.im URL.",
  execute: function(urlToShorten, mods) {
    var baseUrl = "http://tr.im/api/trim_url.json";
    var params = "?url=" + urlToShorten.text;
 
    var custom  = mods["as"].text;
    if (custom) {
      params += "&custom=" + custom;
    }
    jQuery.getJSON(baseUrl + params, function(data) {
      CmdUtils.copyToClipboard(data.url);
    })
  }
});

This chap uses modifiers to allow me to pass in a custom url.

The following said that there will be a url following, and you can optionally say “as customname”:

  takes: {"url to shorten": noun_arb_text},
  modifiers: {"as": noun_arb_text},

I couldn’t find a way to just add to the takes hash, as it would be nice to say:

  takes: {"url to shorten": noun_arb_text, custom: noun_optional_text },

After using Ubiquity for some time now, I am really impressed with how the team is accelerating, and I see this as a great way to extend the Web, and Firefox in 2009.

I find myself in a funny place with the key combos for bringing up Ubiquity and Quicksilver in my mind. I am using Quicksilver less and less (e.g. won’t use it to search the Web or do anything with email) and Ubiquity more and more. As the Open Web takes over the desktop (another prediction;) then Ubiquity will gain usage for me.

Atul has released a preview of Ubiquity 0.2 which has a new architecture and a new Locked-Down Feed Plugin (LDFP).