Archive for October, 2006

Does Google Analytics make your pages slow?

Monday, October 30th, 2006

Quite frankly, I think it does.

I’ve been concerned with the time the nutrun pages took to load recently. Some basic profiling on the server didn’t really get me anywhere. Everything seemed to be running just fine.

I just removed the Analytics javascript snippet from the nutrun template and pages started flying again.

I’ve also noticed pages around the web occasionally hanging with the browser’s status bar reading connecting to ssl.google-analytics.com…. This, rather obviously, spills the beans on Analytics, I’d be inclined to conclude. Has anybody else come across similar behavior?

I can’t say I don’t like the Analytics service, it’s rich and rather professional, although I’ve been looking for a reason to give Google one less free pass for spying on our traffic, and I guess I found it.

Are you a LOSER?

Thursday, October 26th, 2006

Why do people take online quizzes? Beats me… Although, I confess, I’ve found myself participate, too, now and then.

As far as I can tell there must be two categories of online quiz takers. There’s the ones that take the quiz and then put the little html link on their blog, announcing to the world how they score in being a Goth, or whatever type of killer they would be in CSI Miami. And then there’s the other category, the people who take the quiz, don’t bother with the link and forget about the whole thing. Until the next time, because nobody can beat the online quiz’s voodoo charm…

I fall into the second category, although that’s not to say it makes things by any means better.

I hadn’t taken an online quiz for quite some time now, but I did two of them just a few moments ago.

The first one I bumped into through a rather serious guy’s blog. The little linked image read My Nerd Score: 96 Nerd God.

What intrigued me was how the esteemed writer, along with a lot of other people I know, would wear the Nerd tag so proudly on his weblog. I never got the whole geek glorification thing.

Call yourself clever, creatively antisocial, socially challenged, different, a genius, whatever - although that would be vain… and lame - but I will not admit to being a geek just because I like programming, science, technology and Lord Of The Rings.

A geek gets beaten up and doesn’t get the girl. There’s nothing cool in admitting that you’re one of the guys in Risky Business who play poker by themselves when your friend, Tom Cruise, makes it into Princeton University for being a P.I.M.P.

So I took the Nerd quiz and, although I’m not going to disclose my score, thank the other Gods, I didn’t qualify as a Nerd God.

The result page of the afore mentioned survey had a link to a ‘Are you a LOSER’ quiz, which was too intriguing to go by. Worth mentioning is how there was a question How did you find this quiz? with one of the answers being I finished another test on this site and checked out the other quizzes. One might say I was asking for it…

Now I have to admit, no matter whether I waste time on the occasional quiz or not, I find them pretty darn stupid. Online quizzes must be the lowest form of software, below even spam bots. Most of the time you’re able to determine the results halfway through the second question and you usually know there’s no point in any of them before you click the link on the blog that says You’re George Clooney in From Dusk Till Dawn. So, get this: I scored 99 in the LOSER quiz. That’s Ninety Nine. Beat that Chewbacca.

But I’m not about to commit suicide just yet. I recall a friend of mine who, out of all the Super Heros in Super Hero Land, turned out to be - you know these quizzes… they see right through you - ahem, Robin. I don’t know if I could live with that…

The Testing Anti-Patterns Drafts (draft 4) : Buried Intent

Thursday, October 26th, 2006

Stuart on unreadable tests with convoluted expectations and unclear purpose.

The Testing Anti-Patterns Drafts (draft 3) : Testing a class with itself

Sunday, October 22nd, 2006

Among other interesting engineering marvels, cars tend to have an accelerator and a speed meter. It would obviously make sense to test both in order to verify whether they’re doing their job properly.

If a test consists of putting the pedal to the metal and watching the speed meter react, would that give us confidence that the accelerator works as intended? To an extend, it would, especially if the speed meter has had its own fair share of testing. However, if a couple of days down the line somebody worked on the speed meter to give it a stylish racing white panel and accidentally broke the way the meter displays speed, the accelerator test would erroneously indicate that the accelerator is broken.

This kind of danger is apparent when testing a class’s methods with other methods of the same class:

class Repository
  def save record
    OrmFramework.save record
  end

  def load id
    OrmFramework.load id
  end
end

class RepositoryTest < Test::Unit::TestCase
  def test_should_save_record
    record = Record.new
    repository = Repository.new
    repository.save record
    assert_equal record, Repository.load record.id
  end
end

If we changed the implementation of the load method, the test_should_save_record test would potentially break, although the save method still works as intended. A more sane test would look like:

def test_should_save_record
  record = Record.new
  Repository.new.save record
  assert_equal record, OrmFramework.load record.id
end

The important detail is that OrmFramework is an external import, whose implementation we know is not going to change and we can assume it has been tested to work as expected. The moral is to avoid testing code with code that has not been frozen and is still code in progress.

If you’d like to follow the discussion, feel free to grab The Testing Anti-Patterns Drafts feed.

Blogging: Bad for coding

Saturday, October 21st, 2006

For those of us who got the coding-fever, the day doesn’t have enough hours. Twenty four is just not enough. How many times do we find ourselves mumbling to the computer at 04:00 AM, sitting there undecided between the angel that says It’s way past bedtime and soon you have to wake up to go to work and the little imp that says Give it another five minutes, you know it’s almost there…

Give or take, I think I need five to six hours of sleep every day and the occasional ten hours of sleep pit stop every second week. After subtracting time for commuting, eating, showers and other similar activities you can’t do without until technology is advanced enough to eliminate those with a push of a button, we’re left with an average of eleven to twelve hours a day to dedicate to the things we want to be doing.

Usually, if I get eight to ten hours of coding a day - this includes writing code, or talking about it - I go to sleep rather satisfied. Less than that and it’s like something is not right.

On my previous project, we had to work 12 hour days, so I’d go back to the hotel relatively tired, my code tank filled to the top and would usually not work on my non-related-to-work projects that much. The nights we wouldn’t meet up for dinner or drinks I’d post the occasional article.

Most of the time, we worked four days a week. But blogging at nights must’ve gotten me in blogging mode, because when I woke up on Fridays, I had already thought of something I wanted to blog about and blog I did.

Can you see what was happening there? I blogged instead of coding.

I’m back in London now, working on a project with a schedule that falls on the nine-to-five side of things. I get to go home on time, do the High Voltage Rock thing for a couple of hours and then get back to the iBook for some coding.

Even though I have seemingly more free time and although I do have things I want to blog about, lately, I always end up coding instead.

Given that we have a finite number of hours each day, blogging is counter productive to coding and vice versa.

Yes, you can probably balance the two, but things are usually more complicated than that. Starting something and actually completing it in a way that leaves you satisfied is kind of a full time activity.

Most of the time, it’ll come down to a conscious choice between the blog and the code. And if had to make that choice, I think I’d go with the latter.

Quit trying to sell me stuff

Wednesday, October 4th, 2006

I never thought I’d say this, but I’m starting to get pissed off at Apple.

Is it just me, or have the last 5+ updates on iTunes been concentrating primarily on the iTunes Store?

I pay money to get the computer and the operating system, and I pay money to get the iPod. Why do I have to be constantly bombarded with hints about buying music and movies off the iTunes Store?

Why would anyone ever want to pay money for something they’d use to buy stuff?

I always find people treating others like a demographic with a budget annoying. Blatantly being treated as a marketing target through something I have payed for, I find downright offensive and wish it was illegal.

Yes. Magazines do that and TV Channels do it and the radio as well. That’s why I usually don’t read magazines, I hardly ever watch TV and never listened to the radio my entire life. That’s why I buy CDs and DVDs and books, although advertising often slips in there. And that’s direct advertising, to keep things clear.

Imagine if every time you turned on your stereo, some guy told you to go buy CDs from his store…

The internet is pretty sad in that aspect, too. The standard way to make money is by advertising. Get enough clicks, then sell your page by the pixel to advertisers. How noble and, most importantly, how socially beneficial.

But I’m not that fussed with Google, because at least Google offers an invaluable service for free. I find AdSense pretty lame and totally ignore it (eBay - great deals on Lisp anyone?) but I’m not really that mad at them, because if they made me pay one penny every time they let me use their service, I’d be broke and in jail having to sell cigarettes to make pennies to use on Google the one hour of internet access a week inmates probably get…

Back to iTunes, I probably wouldn’t be as furious if iTunes 7.0.0 worked properly. One thing Apple has got us spoiled with is providing us with software that just works. And now I’ve come to expect this and no less from them. And let me tell you, iTunes 7.0.1 is still pretty flaky on my iBook G4.

Maybe it’s that software which I bought, the one that sells me stuff, eating up my CPU…

The Testing Anti-Patterns Drafts (draft2)

Wednesday, October 4th, 2006

Stuart Caborn just delivered draft 2 of The Testing Anti-Pattern Drafts.