Download DB2 Upgrade DB2

Smart Marketing, Dumb Marketing

July 31st, 2007 by Leons Petrazickis

My Firefox upgraded itself and I saw this:

Smart Marketing

Ah, the Firefox crowd is encouraging casual users to discover Firefox extensions. Firefox extensions are a great way to get people addicted to Firefox. That’s pretty smart.

Dumb Marketing

And, naturally, the extension that the casual crowd needs most is Firebug. Not an extension for music, or photos, or weather. An extension for web development. That’s pretty dumb.

Disclaimer: I use Opera.

Posted in opinion | No Comments »

The Web is Dead; Long Live the Facebook

May 25th, 2007 by Leons Petrazickis

TechCrunch | Facebook Launches Facebook Platform

developers.facebook.com

Facebook is going to do to the Web what the Web did to the Internet.

When the Web with its HTTP showed up, it was just one among Email, Usenet, FTP, Telnet, Gopher, and many others. Now, most people think of the other things as applications running on top of the Web.

Facebook is a social-network driven by real-life relationships. I have my real-life friends, my classmates, and my coworkers on it. At least 20% of Torontonians are on it already. When one of my contacts posts a photo, joins a group, accepts an event invitation, or changes their status, I can see it on the front page. I check it daily.

They are about to add third-party applications to the site. They’ll nest in tidy spots on our profiles or improve on Facebook’s features. More than that, whenever I choose to use a third-party app, all my contacts will be notified via their front page.

This is unobtrusive, extremely viral, and has zero distribution cost. If I add the Last.fm widget, all the Last.fmers on my contacts list will add it too within a week.

Facebook is still just one among billions of sites. Shortly, it’ll be a platform. Digg, Delicious, Last.fm, Flickr, Gmail, et al. will be reduced to applications running upon the one true site — Facebook.

Is this a good thing? It’s easy and convenient, but it’s also centralized — the bad guys will need only one subpoena to find out things they should not.

Can it be stopped? Facebook’s reached critical mass. Usenetters have tried boycotting the Web, and yet the Web has soared past Usenet’s slow oblivion. Attempts to boycott Facebook are unlikely to succeed if a plurality uses it and gets locked in by it.

I, for one, welcome our new Facebook overlords. As a trusted web guru, I could be helpful in rounding up others to toil in their underground API caves.

Posted in opinion | No Comments »

Writing for the Web

April 11th, 2007 by Leons Petrazickis

“Not that the story need be long, but it will take a long while to make it short.”
- Thoreau

How users read on the web
In short:

  • Neutral language is 27% easier to read than marketese
  • Short text is 58% easier to read than verbose text
  • Scannable bullets are 47% easier to read than blank prose
  • Start with conclusion; add details after
  • Voice one idea per paragraph

Posted in links, opinion | No Comments »

Dividing code into functions

April 9th, 2007 by Leons Petrazickis

Functions are methods are procedures are subroutines. They are blocks of code that are called and that call each other. They can be divided into classes or modules, but their nature remains the same.

Most of the time, a poorly designed function is too long and monolithic. An oversized function is micromanaging too many details, making it hard to read, and not encapsulating repetitive operations enough, making it harder to expand and revise.

Delegate to Other Functions

Don’t let your big picture function get bogged down in the details. If you are marshaling resources across an application, don’t get side-tracked customizing a single parameter.

page = Page();
title = "Monkey";
title = "(" + title + ") ";
title += str(23);
page.title = title;
page.display();
 

Code is read much more often than it is written, so plan accordingly! What’s wrong with the above? Its topic is very high level, but 5/7 lines are spent micromanaging a single parameter. You need to delegate that:

def makeTitle(core, number):
  title = core;
  title = "(" + title + ") ";
  title += str(23);
  return title;

page = Page();
page.title = makeTitle("Monkey", 23);
page.display();
 

Now that the details are hidden, the big picture is much easier to manage. Generally, when several lines of your function body take several things to reach a single answer, they belong in a function of their own.

Put Complex Operations into Functions

If you are doing the same data munging operation all over the place, abstract it away into a function. Not only is a well-named function call clearer than the actual operation, but you’ll also make it easy for yourself to change the operation down the road. A function created with foresight will save you from a complex Find-and-Replace regex dance.

This is surely old hat to experienced coders and refactorers

Posted in opinion | No Comments »