meshU featuring Avi Bryant, Leah Culver

Just a heads up that two of my fellow SXSW panelists, Avi Bryant and Leah Culver, will be making their way to Toronto to speak at Mesh Conference’s new sister-event, meshU.

meshU is a one-day event taking place May 20th, composed of a series of best-practice and how-to workshops intended for developers/designers. Other confirmed speakers include jQuery creator John Resig, and Carsonified’s Ryan Carson.

From the meshU site:

meshU is a one-day event that will be filled with small, focused workshops by those who have earned their stripes in the startup game; people who can talk knowledgeably about everything from interface design to using Amazon’s S3 distributed server network.

Disclosure note: FreshBooks is an “in-kind sponsor” of Mesh Conference, and my boss Mike McDerment is one of it’s co-founders. Oh, and he totally put me up to this.

Four things I learned at SXSW (the hard way)

So, SXSW Interactive is good and over. The panel went well (or so they tell me), I met some nice folk, and drank some darn good beer.

Unfortunately, things weren’t completely rosy. I made a couple of critical errors which slightly marred an otherwise brilliant weekend:

Don’t hand out the wrong business cards (as in, somebody else’s)

SXSW is a business card trading frenzy. So, a good idea is to make sure your business cards are your own. Mine weren’t.

I was sorting through my remaining business card supply half-way through the conference, and was horrified to notice that a handful were labeled “Kathy Donaghue”, a former FreshBooks co-worker who’d left the team back in August. I guess our cards got mixed up some time ago, and I hadn’t bothered to check them before handing them out. So, if you’re back from SXSW and wondering who the heck Kathy is, look no further – it was me!

MacBooks don’t have VGA-out

Unlike 99% of my web-developer peers – I don’t presently own a laptop. So I borrowed my colleague Sunir’s MacBook for the trip. As a PC-user-4-life, it didn’t occur to me that MacBooks don’t have VGA out – you need a separate adapter. So, before my presentation, I actually borrowed a second laptop just to play the slides – a Dell PC running Windows Vista (!). My street cred dropped 50% instantly.

Remember to introduce yourself during your own panel

Yep – no joke. We were about 20 minutes through the panel before I’d realized that, during introductions, I’d completely forgotten to introduce myself, or FreshBooks. Months of organizing, planning, and slide-preparing and nobody even knew who I was. Bummer!

(If you’re reading this now, I was the guy on the right.)

Bring a phone (that works)

My mobile phone company, Virgin, doesn’t offer roaming. With no connection to the outside world, I was always tethered to someone who did. Not being able to find your friends, hand out your number, find the latest party, or Twitter, was a complete drag. Never again!

Anyways, all things considered, I had a great time, and let’s face it – these aren’t big deals. Still, next year, I’ll be way more prepared … maybe.

Coming up: BarCamp Austin

Just a heads up that I’ll be attending BarCamp Austin 3 with some of my FreshBooks compatriots on March 7th. If the crowd’s willing, I’m hoping to get up and talk about my experiences building the FreshBooks API—what worked, what didn’t, that sort of thing.

Personally, I love BarCamp-style events over traditional conference fare. The openness, low cost, and great people you’ll find is tough to beat. I had a great time last year at BarCamp Toronto, and I’m sure Austin will be no different, judging by the names on this sign-up list (not to mention their awesome logo). Whether you’re a local or in town to catch SXSW, you should find the time to drop by.

Dreamhost mix-up not all smiles: delays, dollar fluxuation hurts refund

Dreamhost

In case you missed it, Dreamhost, the shared hosting provider, mistakenly charged its customers nearly 7.5 million dollars on January 15th, 2008.

Well, I was one of those customers. I’ve had my Dreamhost account for years now, and they’ve always been swell for me, performance issues aside. I didn’t gripe about it because I was only charged around $52 on my credit card, not $200+ like some folks.

Anyways, after a few weeks, Dreamhost’s refund appeared on my credit card statement. Unfortunately, there were a few inconsistencies.

Here’s the mistaken charges (2 of them) appearing on January 17th, followed by a single credit four days later. Notice the amount – it’s a full dollar less.


Then on January 31st, a final credit, presumably for the 2nd mistaken charge, is over two dollars short:


I’m going to assume that Dreamhost knows what it’s doing, and has attempted to refund me the proper amount—in USD. But the Canadian dollar has been fluctuating, such that the exchange rate has shifted by 3 cents between January 15th and the 31st. The numbers don’t work out perfectly (I don’t know what my credit card charged me for the exchange, nor do I know the exact moment the charges/debits went through), but they’re somewhat in line.

Long story short, so we’re only talking a couple of bucks, and I’m not too bothered by it. But at the same time, it kind of stinks to be out $3 because of somebody’s “fat finger”.

Anyways, I’m sending an e-mail to Dreamhost and hopefully they’ll sort it out.

PHP: Be careful with global constants

Did you know that global constants, when undefined, evaluate to a string containing the constant name? Talk about a mouthful – here’s an example repurposed from the PHP docs:

<?php
define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world." 
echo Constant; // outputs "Constant" and issues a notice.
?>

Depending on your programming background, this probably isn’t what you had in mind. Not me at least – all the languages I’ve ever dealt with fail when attempting to evaluate undefined constants.

That means that if you’re not careful, an undefined constant can cause bugs like this:

if ($user_level < ADMIN_LVL) { // Typo! Should be ADMIN_LEVEL
   // always evaluated
}

I’ve also seen permutations of the following:

define('DEBUG_MODE', true);

if (DEBUG) { // Yes, another typo
  // always executed -- aside: should use if_defined
}

There’s a couple defensive measures you can take. One, use an error reporting level of E_STRICT or E_ALL during development, which will emit a warning in the case above—if it’s evaluated. Better yet, stick to class constants. Undefined class constants throw good old fashioned errors, just like Ruby, Python, et al.

class Consts {
  const ADMIN_LEVEL = 5;
}

// Later that day ...

if ($user_level < Consts::ADMIN_LVL) { // Here's that typo again
  // throws an error
}

Failing fast like this could be the difference between having a bug reported to you immediately by your users, or having a bug reported to you 3 months later when errors pop-up in your database. Don’t know you guys, but I’ll take the first one.