Updates

I apologize about the month without updates. Our business manager and lead designer ("Director of Operations" and "Creative Director") both had to go to the hospital at about the same time and the shortest stay was almost 2 weeks. They both pulled through just fine and everything is back to normal.

I hope to be back sometime later this week with some visible signs of awesomeness on a side project of mine.

In the mean time I've been playing with Flex Builder 3 (hooray for free Educational licenses) and while it's cool, so far the documentation is hindering my development efforts. I have a project planned where I intend to have an AIR client and am evaluating using Flex instead of HTML+JavaScript. We'll see how far that goes.

And finally I've been playing around with FriendFeed and have an account setup. I, for one, welcome our new stalker overlords.

Laziness Makes A Great Developer

One of the guiding principles I have lived by the came from my middle school swimming coach. He told us:

Don't do more work than you have to.

On first glance, it doesn't seem to be very good advice. However when you realize that what he was getting at was we shouldn't waste energy on a poor stroke, the quote takes on a much deeper and more profound meaning. It is this principle that takes a good developer and makes him great.

Profile of a Good Developer

Good developers are almost a dime a dozen. Walk in to any computer science course or web development shop and you'll find that the majority, if not all, are good developers.

These "good" developers can sit down and work through an object oriented architecture, they can construct their SQL queries, and can write an application that just works.

A "good" developer checks in his source code at the proper times, he comments his code as well as could be expected, and you can usually be guaranteed his code will compile and execute with very little fuss.

Profile of a GREAT Developer

What separates the great developers from the good developers is LAZINESS! You will find that the good developers, while producing clean, working code, operate much slower than great developers, and for the reason that separates the good from the great.

Good developers are set in their ways of just manually working with everything. A good developer handles deployment with FTP, and updates database structure by hand. In the end, the good developer ends up wasting time doing menial tasks. FTP alone can kill up to 30 minutes of your day. Good developers are very set in their ways and do not like new things introduced.

Meanwhile GREAT developers HATE menial tasks. They abhor having to drop into the console every time they wish to test or deploy, and loath dropping into the database to manually update structure. So these GREAT developers begin to write scripts and integrate all their tools to reduce their menial overhead as much as possible.

The GREAT developer is lazy because they do not want to do things themselves, so they spend 20 minutes automating their tasks so they'll never deal with it again. And when you think about it, when you could spend 20 minutes once writing automated deploy scripts but instead spend 20 minutes every deploy in FTP, you are doing more work than you have to.

What Does This Mean For Me?

All of us developers should strive to be as lazy as possible. Do you have a task you have to do more than 3 times total? Write a script or a build task for it. Do you spend a lot of time testing features? Automate your testing. And if possible, integrate the systems so you never even have to run those scripts manually, reducing user intervention to one step.

I know I try to be as lazy as possible, do you?

Edit 6/10/2008:

I feel I should make sure everyone knows that I am to an extent being facetious with the word "laziness" but I'm being completely serious on the "don't do more work than you have to." While a good developer can handle long, arduous tasks that are prone to human error, a great developer avoids them in the first place.

Updates To Come

I'm currently out for the weekend, brother's graduated high school!

When I get back I've got some updates for the hierarchical data post, and should have a post ready on using rsync and phing for remote deployment.

10 Hours With Plurk

So I now have spent about 10 hours on Plurk.

About an hour of those 10 I spent OFF the service.

It is officially addicting.

Plurk: Even worse than twitter!

So whurley pointed me towards plurk earlier today.

Naturally I join because (a) I'm a natural sucker, and (b) being a geek I join just about every service to check it out.

To give a brief rundown, plurk is another microblogging service just like twitter only it focuses on the social networking aspect a bit more than twitter, its currently more responsive than twitter (but that will change as plurk starts experiencing heavy load), and it has a really nifty timeline interface (by the way, plurk guys: we're all kinda used to reading a timeline from right-to-left, not left-to-right).

I would highly suggest people join up and check it out, if for anything to boost my karma points and waste the time in your day you weren't going to spend on something useful in the first place.

Oh and for you first time users, check out The Unofficial Guide To Plurk to get the help that is so woefully inadequate on the official plurk website.

Hierarchical Data With PHP and MySQL

I recently had fun with an all-to-common issue with SQL driven websites: hierarchical data. For those who don't like big words, think trees. Other people have already discussed storage methods, and I would actually highly suggest you read the writeup if you haven't already.

While it is fairly straightforward to deal with, in our case we use HTML_QuickForm to handle our forms and are using QuickForm's hierselect to select a category.

The issue starts showing its face in 2 distinct areas: (1) the client is not yet sure how deep they need their categories to go, and (2) the hierselect requires a very specific format of data to be passed in.

Continue reading ‘Hierarchical Data With PHP and MySQL’ »

*AMP and Runaway Scripts

Peter Zaitsev posted a very interesting test on how PHP and Apache handle runaway PHP scripts.

I'm sure all of us have had a long executing SQL script or at least a runaway script, and he points out even with ignore_user_abort set to FALSE and max execution times set both in PHP and Apache, a runaway SQL query can execute beyond the timeouts, even when aborted by the user (stop button on the browser).

Even using the function connection_aborted() to check for a user abort fails.

However, the script will cease on a user abort if it performs regular ob_flush(); flush(); commands. For example:

<?php
echo("Hello");
for($i=0;$i<10000;$i++)
{
	sleep(1);
	echo('.');
	ob_flush();
	flush();
}
?>

Just one more reason why I love the MySql Performance Blog.

CompizFusion: Blur Your Terminal Window!

Messing around with CompizConfig the other day and discovered a nifty tweak: blur your transparent terminal windows!

Blurred Gnome Terminal!

To do this you need CompizConfig installed:

sudo apt-get install compizconfig-settings-manager

Once installed, go to System > Preferences > Advanced Desktop Effects Settings. Scroll down to Effects and enabled Blur Windows. Then click the Blur Windows button to open the configuration panel. Set "Alpha blur windows" to (class=Gnome-terminal), Check Alpha Blur, set "Blur Filter" to Gaussian, and set "Gaussian Radius" to 9.

Settings for Alpha-Blurred gnome-terminal

Automating the Development Workflow

I just rolled out some new automation tools for a few projects here at work and so far I've been extremely happy.

Much to my embarrassment, development has previously been outside of source control due to the fact that we develop sites, we don't deploy packaged applications, and we don't have a cohesive IT setup (everyone sets up their desktop to their liking so maintaining consistent development environments across all computers is difficult).

However, thanks to SVN, Xinc and Phing (and DBDeploy), this has changed! Now everything is in source control and automatically deployed to our dev server upon commit. I am currently talking with Arno about perfecting svn tag monitoring to automate staging and (possibly) live deployments, so I'll post about what I did when that's finished.

The great thing about this setup is all pieces are technically interchangeable. If you don't like Xinc you can use CruiseControl. If you don't like Phing you can use Pake, or a shell script even. If you don't like DBDeploy you can roll your own setup or swap it out for your database versioning system of your choice!

However this post will cover Xinc, Phing, and DBDeploy as (a) I have experience with them and none of the others, and (b) they integrate extremely well (Xinc and Phing's primary distribution method of choice are PEAR channels).

Continue reading ‘Automating the Development Workflow’ »

Indy!!

 
from indiana import jones
import whip
import ruins
 
cave = new Ruins()
 
trap = indiana.steal( cave.treasure )
indiana.escape( trap )
 
ImportError: Snakes? I hate snakes!