yield thought

it's not as hard as you think

Archive for May 2010

A Song Is Worth 1093 Words

leave a comment »

Natural programmer. Ended up a rock star. Pity.

If someone had sent me this earlier in the week I could’ve saved us all 1093 words. Much love to Craig Lyons and some random youtuber for the developer anthem of the week.

Don’t stop listening until you’ve heard my personal message around 1:44 😉 In fact, it keeps on getting better!

If anyone makes a nice cut summarizing the software development sections (or just a loop ending at 1:16) send me a link!

Anyone know of any more songs secretly about programming and startups out there?

Written by coderoom

May 20, 2010 at 8:51 am

Start In The Middle

with 59 comments

I start in the middle of a sentence and move both directions at once.
— John Coltrane

Newspaper reporters are taught to write fractal articles: summarize the entire article in the title. Elaborate a little in the first sentence, then fill out the most important details in the first paragraph. A reader should be able to stop at any point without having missed any important details. We should approach programming projects in the same way.

As a child – after some experimentation and a lot of thought – I decided the best way to eat cornflakes was as follows:

Cornflakes, by Mike Haufe

  1. Pour the cool milk over the golden roasted flakes
  2. Sprinkle the one allowed teaspoon of sugar over the top
  3. Start eating around the edges, saving the sugary middle section for one last big spoonful of joy at the end

I stand by that decision. In fact, I’ve noticed I do similar things in other areas of my life. I’m sure a psychologist would talk for hours on the subject. Luckily for you I’m not a psychologist, I’m a programmer. And it turns out that this is an awful way to work on software projects.

Has this ever happened to you? You wake up one day with a great new idea for applying bayesian filtering to twitter streams to filter out the pictures of Joel’s new puppy spam. You’re totally convinced it’s what the world needs. It’s the startup that’s finally going to help you to break out of your day job maintaining PHP payroll software stock supermarket shelf stockers. So what do you do? You do this:

  1. Fire up your IDE and start a new website project
  2. Whip up a login page and get the user account basics set up
  3. Decide OpenID’s really where it’s at these days and hit stackoverflow for a good OpenID provider plugin
  4. Run into problems getting it to accept Google accounts and spend half the night debugging it

Wait, what? How did this happen? Getting OpenID working isn’t fun. It’s almost the definition of not fun.

I didn’t want to do all this, I just wanted to make an awesome bayesian twitter filter, but somehow there’s all this stuff I have to get through first.
— Me (swear words redacted)

My hard disk is littered with projects that I started, got half way through setting up without ever really getting to the good bit, then abandoned. I suspect yours is, too.

The right way to start a bayesian twitter filter is to apply a bayesian filter to content from a twitter stream. I know. It looks like this:

  1. Google for some bayesian filter code
  2. Dump whatever’s in your twitter client logs to a file and write three lines of python to parse it into a form the bayesian filter can work with
  3. Train the filter and see what happens

Compared to the original approach it looks awesome, right? So what stops us approaching all projects like this? Well, there’s something beguiling about wanting to get the framework right from the start this time. It’s more comfortable starting with something we already know how to solve. Sometimes we have a clear vision of how it should end up in our heads and simply start to create that vision from the beginning through to the end.

Start in the middle
— Paul Graham (lightly paraphrased)

Lean startups and the Minimum Viable Product are all about starting in the middle. Paul Graham’s advice for startups can be summed up as ‘first solve the interesting part of the problem, then build the business around it’, but the process is also fractal – starting in the middle applies right down to the level of writing a new class, or a single function. First write some code that solves the problem even if it’s imperfect or partial, then expand it out with your favourite blend of accessors, inheritance and polymorphism (Note: don’t even bother with that bit unless you hate yourself).

I’ve seen four key benefits to starting in the middle:

Benefit 1: Ideas that turn out to be impossible or just plain bad are discovered early. This is classic lean startup advice: fail early.
Benefit 2: Spend most of your the time solving interesting problems and not fine-tuning framework skills. Which would you rather get better at?
Benefit 3: Discover interesting things while your project is still young and flexible enough to adapt to them.
Benefit 4: Once you’ve solved a problem, you’re so motivated to use it that you finish up the surrounding areas in no time. You add extra users because you want to show it to your friends; you add keyboard shortcuts because you’re getting tired of using the mouse all the time. This is programming the right way around – first the need, the desire, and then the solution.

I’ve recently seen all of these benefits while working on my own side-project-turned-startup. Ages ago I had this great little idea for making profiling so simple that it just told you which line of code was slowest in a nice little report and I whipped up some C# code to do just that. The results weren’t making much sense, so I tried plotting the data to a canvas to see what was going on. Pretty soon I was looking at a poor man’s sketch of this:

Visualizing a program's execution

Instantly I knew I’d been working on the wrong thing; seeing the execution of a program laid out before me in all its glory was so rich and so interesting; something I had no hope of summarizing in a small table of figures. I just had to explore it – I added function names, colour, a breakdown of time spent in each and over time it grew into such a valuable part of my toolkit that I’ve started sharing it with the rest of the world.

Would I have changed direction if I had already created a website, a login system, a messaging layer, a database schema all geared around the original idea? No. I’d have reached the interesting part of the problem with a half-finished framework and close to zero energy and enthusiasm. The discouragement at seeing the futility of my cherished profiling-via-pdf idea would’ve seen me put the whole thing back on the shelf and go play Altitude to forget about it.

So start in the middle, start with the interesting, challenging, core of the problem you’re trying to solve. Cut down everything else to ridiculous minima and see what happens; you may create something fascinating.

Note: Yield Thought has moved to http://yieldthought.com – check there for the latest posts!

Written by coderoom

May 18, 2010 at 9:26 am

Chicken Little and 3.3.1’s Great Big Loophole

with 10 comments

I thought someone else would say this, but either they haven’t or they didn’t say it loud enough and now I can’t take the waiting any more, so here goes:

Chicken Little

Oh noes, my pythons iz banned!

On April 8th, Apple added some onerous conditions to section 3.3.1 of their iPhone Developer Agreement, explicitly prohibiting interpreters, translation layers and cross-platform toolkits from the Apple Store. It set off a wave of discussion that still echoes around to this day, and it pretty much killed Flash dead.

Much as I hate Flash, that’s not what I want to talk about. I want to talk about the reaction from most of the programming community:

The sky is falling, the sky is falling!
— Pretty much everyone

Some bloggers even complained that kids wouldn’t be able to grow up learning how to program in Apple’s Brave New World. What?

You can write in any language you want so long as it compiles to Javascript and runs in the browser, or runs on a server somewhere online
— The oddly-overlooked truth

Local applications are already dead. Whether they’re on the desktop or on the phone, their days are numbered. The resurgence in phone apps for the iPhone / iPad is a temporary blip. The future is in the cloud, in the browser and on servers.

Where will kids learn to program in Apple’s new world? On programming sites, interpreting their code in the browser, pulling in web services they way you and I learned to pull in local APIs. You don’t like Javascript? Don’t worry – You have options and they’re only going to keep getting better. Suddenly Bespin doesn’t look so dumb any more, does it? Mix in Github and free online hosting services like Google App Engine and you can see the parts are already assembling.

In fact, with 3.3.1 Apple has shot itself in the foot by ensuring that all the best developers are going to work extra hard to get their applications running in the browser; a bit of a home goal for iAd and a gift to Google – and the rest of us. After all, web apps are fundamentally easier to develop and support.

So here’s to Apple’s 3.3.1 clause and all its consequences: Thanks, Steve!

Written by coderoom

May 7, 2010 at 7:45 am

Posted in Business, Programming

Tagged with , , ,

Looking for Beta Testers

with 3 comments

My startup – codechart – has recently started looking for beta testers.

I haven’t said much about the startup here, but our thinking is as follows: developers deserve just as much love as everyone else, yet typical development tools are awful, or at best bearable once you’ve learned how to use them. We want to change that, starting with a profiler that actually makes sense. We’re prioritizing .NET first, with other platforms (such as my beloved python) to follow.

So if you work or play in .NET and want to help us find out how we can love you and not our code then go sign up and we’ll set you up with an account and explain what it’s all about in the next week or so!

Written by coderoom

May 4, 2010 at 3:37 pm

Posted in Business

Tagged with ,