Archive for the ‘Software Development’ Category

What Your 16-Hour Workday Says About You!

Friday, February 4th, 2011

I came across this link many times over the past week.

As a software developer, I’ve worked my share of 16-hour days. I’ll admit that I can’t argue everything on that list (I struggle with time management, for example), but I believe that long workdays often say a different set of things about someone. For me and many people I know, the list looks more like this:

  • You love what you do.
  • You’re not just in it for the money.
  • Your life is full of supportive people.
  • You’re learning a lot.
  • You follow through.
  • You’ll never be unemployed.
  • You’re doing work that matters.

The Golden Rule of Web Design Implementation, Part 2

Wednesday, January 26th, 2011

This is part two of The Golden Rule of Web Design Implementation. In part one, we learned that pages aren’t views, and that thinking in terms of views is much more beneficial. Today we’ll wrap up our analysis by looking into development.

As you may recall from Monday’s post, the Golden Rule is:

The time it takes to implement a web design will always average out to one view per day.

Our first corollary was related to views. The second is about development. Or more specifically, developers.

There’s a reason I put that always in there. It’s to remind myself (and you) that this rule can stand up to a lot of variables. As I’ve mentioned already, the technologies being used and the platforms being targeted are irrelevant. Plenty of other things are too. But what I found most interesting was this:

The developer’s skill level doesn’t matter.

This is counter-intuitive. If a weak developer needs an average of one day to implement each view, then shouldn’t a more experienced developer be able to get those same views done faster? The answer is no. In fact, it will take a strong front-end developer and a weak front-end developer about the same amount of time to implement any given design. We’ll get to why in a moment, but first let’s clear up some definitions:

  • By weak front-end developer, I mean someone that knows the basics of front-end development in the technologies being used. That statement above is obviously false for someone with zero experience.
  • By strong front-end developer, I mean a real ace. Someone that can put “HTML/CSS Expert” or “Adobe Certified Flex Expert” on their resumé without exaggerating.

All set? So how is it that a below-average developer and a bonafide expert will require the same amount of time to implement the same design? It all comes down to the perceived level of what constitutes a correct implementation. In other words:

Better developers don’t code faster, they code better.

Picture a standard HTML/CSS implementation. The design is there, and you hand it off to your weak developer and your strong developer, and tell them each to get to work. After X days (where X is the number of views, of course), you get both implementations back. Here’s what you can expect:

The weak developer will have done exactly what you asked. The pages will look just like the mock-ups, pixel for pixel, and work as intended. There will be nothing wrong with the design from a typical user’s point of view.

The strong developer will deliver an implementation that looks about the same. Surprised? Don’t be. That’s all these two implementations will have in common. Let’s look at some things the guru probably did that our weak developer didn’t even consider:

  • The HTML and CSS both validate, with no errors.
  • Each page has a proper doctype.
  • There is a clear separation of structure and presentation.
  • Accessibility has been accounted for wherever possible.
  • The HTML is semantically clear, and would be easy to restyle.
  • The CSS is beautifully minimal, and optimized for maintainability.
  • There are <noscript> blocks for users that don’t have javascript enabled.

Do you see the difference here? On the surface, it’s barely noticeable. But just beneath that surface is a trove of quality that goes far and beyond what was asked. To the guru, this isn’t even extra work. This is just how HTML and CSS are used.

Don’t blame the developer.

You may be thinking: “The guru shouldn’t waste time doing what wasn’t asked of him; he should be able to translate that extra time into finishing the implementation faster.”

Please don’t ever ask this of your developers.

Would you ask a master carpenter to build a simple chair as quickly as possible, and not “waste” time without worrying about quality, durability, ethics, or craftsmanship? Of course you wouldn’t. That’s simply not how experts work.

The solution to this problem is simple: choose the best developer for the job. If you don’t care about the internals of a deliverable, assign a developer that has lots of room to learn. If the project requires some baseline level of quality, consider a developer that is better versed in the fine art of building interfaces. Only call in the guru when the project requires an unmatched level of care.

And remember that no matter how hard you push, and no matter which developer you choose, you’ll never beat one view per day.

The Golden Rule of Web Design Implementation, Part 1

Monday, January 24th, 2011

Hi folks! Today’s post was so full of awesome that I had to split it in two. This is part one, about views. Part two is about development.

Estimating is hard, and I hate doing it. But I have a trick.

Specifically, I’m going to talk about how to estimate the implementation of a web front-end project. Maybe it’s a UI refresh for an existing web site, maybe it’s a new take on e-commerce, maybe it’s one of those new-fangled web-apps… it doesn’t matter. As long as you’re implementing a relatively well-spec’d-out design, this rule will work every time.

Oh, and the technology doesn’t matter either. It can be HTML/CSS, with or without JavaScript. It can be Flex, it can be JSP or ASP or anything else. As long as you’re not doing any significant back-end work, this truth still holds.

This is really important so I’m going to write it in a really big font:

The time it takes to implement a web design will always average out to one view per day.

So if the design has 16 views, the implementation will take 16 days.

There are two interesting facets to this rule. Today we’re going to talk about the first one, the significance of the term “view”.

Views != Pages

This is an important distinction: it’s not about pages anymore. We’re past that. We have bigger monitors, and that means we can have more elaborate pages. In fact, we often put several views on the same page, just because we can.

Imagine you have a page in a standard two-column layout. The main content is one view, that’s obvious. What about the sidebar? These days, if it’s anything other than nav, it’s probably also an independent view. Even the main content can be more than one view, if it separates logically and especially if part of it will be re-used on another page.

Of course, not all views are created equal. Maybe the sidebar view in our example is a lot less work than the main content view. That’s bound to happen, and it’s fine. The rule states that this will average out, and believe me, it will. For every super-easy “only took an hour and a half” view you find, you’ll get stuck with one that takes nearly twice as long as it should because you hit some silly browser compatibility issue.

Get used to thinking in terms of views.

There’s another reason for looking at the design in terms of views: That’s how implementation works. You start with the overall page architecture, build out a grid or column structure, and then tackle each distinct view one at a time. The developer’s standard divide-and-conquer approach.

Doesn’t it make sense to estimate the same way? By considering the design in terms of views at scheduling time, you’re estimating the same chunks you’ll be implementing. This will lead to more accurate estimates.

It will also make your estimates easier to defend if they seem too high. Write out a list of all the views in the design, and say “this is a breakdown of the implementation in one-day chunks”. If there are 12 chunks, that’s 12 days. You don’t even have to use the term “view”.

By throwing away the pages metaphor and instead thinking in terms of views, you’ll get better estimates that are more accurate and easier to track, and easier to explain to others.

There’s still more to learn!

We’ve only looked at the first interesting corollary from the Golden Rule. In part two, we dig even further to reveal the secrets of development.

Should You Support Classic Features or Should You Innovate?

Monday, January 3rd, 2011

A few months ago, the Internet Explorer team did a Q&A about IE9 via Reddit. While there were a few interesting items discussed, I almost did a spit-take when I saw this one:

Why doesn’t IE have a built-in spellchecker?

Are you kidding me? IE9 is going to ship without spellcheck? Ludicrous!

I immediately thought of all the typing I do in my browser every day, and how awful it would be to do it all sans spellcheck. I write my blog posts in WordPress. I comment on blogs. I consider proper spelling a necessity in my writing, and I simply can’t achieve it without a little help from my browser.

And it’s not just me.

Regular users are writing important emails, posting thoughts on Facebook, filling in online forms… How can anyone survive without spellcheck? What was the Internet Explorer team thinking?

I was really disappointed. Then I read the reply from the IE team:

Like any software project, developing IE is a trade off between features, quality and schedule. A built-in spellchecker would be a great feature that simply didn’t make the cut this time in favor of other things like <CANVAS>, <SVG> and other platform features.

Suddenly, I’m conflicted.

The SVG support coming in IE9 is a truly cutting-edge feature that really pushes what we can do inside a modern browser. And Canvas is no small feat either; people like me have scolded the IE team left and right for over a decade for not supporting open standards. These new features really are important to me both as a web developer, and as a browser-technology enthusiast.

So which is more important?

On the one hand, I really don’t think I can use a browser day-to-day that doesn’t have built-in spellcheck. On the other, I’m ecstatic that the Internet Explorer team is finally choosing to innovate and support new standards. I’m really not sure which side to take on this debate.

What do you think? Is it more important to support old, tried and truly-important features, or is it better to spend that time pushing the envelope and coming up with something new?

Don’t be a NAMCO

Monday, August 16th, 2010

I noticed a disappointing post via Slashdot the other day; apparently Namco has decided to force MIT to remove a PacMan clone made in Scratch. At face value, that probably doesn’t sound like a big deal to you, but that’s probably because you’ve never heard of Scratch. Allow me to explain.

Scratch is the future of programming education.

I’ve been teaching kids to program using Scratch for years (through OCRI). The reason we often choose Scratch is that it was made by MIT with the express goal of introducing students to programming and programming concepts (check out the About Scratch page if you’d like to learn more). The idea is that students who have never programmed before can create real, working software applications and share them online for other students to gain inspiration and learn from.

This is very similar to how real software development works. These students pour their heart and soul into creating something they care about, and proudly share it with a community that reacts to their ideas — adding features, remixing concepts, pushing the boundaries of what can and can’t be done. This is exactly how the web works. This is how kids learn.

Of course, if you’re Namco, that’s less important than preserving the copyright of a game that is older than almost everyone that uses Scratch (myself included).

Why is a Pac-Man clone important?

Several reasons:

First and foremost, it’s something kids recognize and can relate to. The tutorials for Scratch make some pretty bland applications, so to really push them to create something incredible, it’s important to show the students something they find impressive. The go-to applications for this are game remakes like Pac-Man and Tetris. Why? Because these games are instantly recognizable, and get students hooked on the idea of Scratch. They realize that with a bit of hard work, they can make something really cool.

Second, game remakes help the creative process. When you start with a blank slate, the idea of making something fun or interesting can be very daunting. Where do you even begin? For students, this can lead to frustration. Encouraging them to draw from other things they like helps narrow their focus without robbing them of choice. They can make something that they want to make, focus on solving the programming problems for that specific game, and make whatever creative changes they see fit along the way.

Finally, polished games are extremely difficult to write in Scratch (even something as basic as Pac-Man). These examples always contain interesting techniques and approaches to problem solving that show some really neat aspects of Scratch that I’ve never seen done any other way.

What does NAMCO get out of this?

You tell me. Do they really think people were lining up to play a Scratch version of Pac-Man? Are any of these (likely non-existent) people going to go out and buy a copy of Pac-Man from Namco now that the Scratch version has been removed? Other than ruining something that means almost-nothing to them and a whole hell of a lot to people like me, what exactly does Namco expect to accomplish?

What if they took the opposite approach. What if they decided that, copyright be damned, it’s awesome that 30 years later people still find the original Pac-Man fun. What if instead of being appalled, they were honoured that someone chose to learn to program by reproducing one of their games. Can you imagine a world where rights holders and every-day people with no intention of ripping anyone off worked together to promote culture and innovation? Because that’s not what I see here. I see a company that has its priorities so ass-backwards that it’s targeting a platform whose sole purpose is to help children learn.

Don’t they have better things to do?

How Much Longer will it Take?

Monday, July 26th, 2010

Let’s talk about re-estimating software projects. Here is a situation I find myself in every now and then:

Say I’m the lead/best/only developer on a project, and partway through that project, we realize that we’re going to miss an important deadline. My manager will come to me with a question that I absolutely dread:

How much longer will it take?

It’s a perfectly fair question. Since I’m the lead/best/only developer, I’m in the best position to estimate how much more time is necessary, and my manager needs this information to make important decisions (add more people? talk to the client? etc). But it’s extremely difficult to answer! If the initial estimates (which I either came up with or approved) are wrong, how am I supposed to magically come up with better, more accurate ones?

The most important thing is to not answer on the spot; a great manager once told me that the best answer any time anyone asks you for an estimate is always “I’ll get back to you” and he’s completely right — there is absolutely no way you can put together a sensible estimate off the top of your head. Ever. You’ll always have to do a bit of math and take a few things into consideration, so give yourself time to do those things.

Now, let’s talk specifics. There are three main approaches I’ve seen myself and others use to re-estimate a project. For the following examples, let’s pretend that you’re in charge of a project that was initially estimated at 10 weeks, and after 5 weeks of work you find yourself 1 week behind schedule. How much longer will it take?

The Naive Method

The knee-jerk reaction that you might even say out loud if you answer on the spot is that you’ll need 1 extra week for a total of 11 weeks. The naive thinking here is along the lines of: “hey, we’re 1 week late, so give us 1 extra week to make up that work and everything will be fine”. The problem here, of course, is that if you have been late on your initial estimates for the first 5 weeks, you’re probably going to be late on your initial estimates for the next 5 weeks as well. We need to account for more than just the time missing so far. This brings us to:

The Logical Method

You may be thinking that the correct answer is 2 extra weeks for a total of 12 weeks, since if you need 1 extra week after the first 5 weeks you’ll probably need 1 more extra week on the 5 remaining weeks. That’s no longer a naive answer (it’s indeed logical) but your math is flawed and we can do a bit better.

Look at it this way: it took 5 weeks to do 4 weeks’ worth of work. So after 10 weeks, we’ll have done 8 weeks’ worth of work. Historically, if 4 weeks’ worth of work takes 5 weeks, then that last 2 weeks’ worth of work will actually take 2.5 weeks. So what you should be asking for is an extra 2 weeks and 3 days (always round up) for a total of 12 weeks and 3 days.

Now we have an entirely logical answer, and by all accounts you should be able to tell your manager with confidence that the project will be done after 12 weeks and 3 days. But here’s the thing — you’re probably still wrong. The fault lies in the very concept of estimates: you’re assigning a logical, mathematical number to the actions of real people with real lives and real feelings. If your team was entirely composed of robots, then yes, the logical answer is probably a great estimate, but that’s not how teams work. There are a number of estimate-affecting factors that the team dynamic adds:

  • Some people will work longer days, evenings or weekends.
  • Some people will “speed things up” by skipping test cases or code review.
  • Missing milestones affects team morale.

None of these are always going to be good or bad for the project schedule, but it is foolhardy to ignore them outright. That’s why I believe in:

The Human Method

This is where it pays to know your team.

The idea is to take the proper logical answer, 12 weeks and 3 days for our running example, and tweak it based on the team dynamic. Does one of your fellow developers step up her game when the project falls behind schedule? Knock a day or two off the re-estimate. Do you have a teammate that gets easily overwhelmed? Add a day just in case. Is a stakeholder in the project going to want to have frequent meetings about why the project is late? That’s another day or two as well. You might be surprised at how things stack up: maybe it’s not as bad as you thought, maybe it’s much worse. But at least now you know.

Of course, you can’t always predict everything about your team, so sometimes you have to ballpark the team-dynamic chunk of the re-estimate. The best thing to do in this case is to err on the side of caution and add a buffer — something in the 20~30% range. For our example, that means adding another 25-ish% of the 2 weeks and 3 days that we’ve already added, call it 3 more days, bringing us to 3 weeks and 1 day. This means that our originally-estimated 10 week project is actually going to take a little over 13 weeks. Probably longer than what your manager was hoping for, but at least now we have some numbers to back it up.

And what’s your alternative, really? Make something up off the top of your head?

Motivation Overflow

Monday, June 14th, 2010

Let’s talk about motivation.

I recently joined Stack Overflow (here’s my profile) and one of the things I noticed right away is how easy it is to spend time there. I think I’ve checked in every day since I joined, and in ten days I’ve already answered fifteen questions. Now, before we discuss whether or not I’m developing an unhealthy addiction to social networks, I’m sure some of you are wondering what Stack Overflow is — let’s sort that out first:

Stack Overflow is a place where people can ask highly technical questions about computer programming and related topics, and get answers from a community of well-qualified geeks such as myself. When I log on, for example, I scan over a few dozen questions and answer any that I feel qualified to weigh in on. It’s free, self-organized, and completely voluntary.

Now, back to the issue at hand: why would I choose to volunteer my valuable free time answering other people’s questions? Or more specifically:

How does Stack Overflow motivate its community of users?

We’ll get to the answer in a moment, but before we do I’d like to take a moment to mention that I recently read Dan Pink’s Drive, a fantastic book about modern theories of motivation. I highly recommend this book. It’s an easy read that’s full of all kinds of useful information, and I’ll borrow a lot of its concepts and jargon in the remainder of this post.

Stack Overflow implements a wide variety of motivational techniques. For starters, all users have a “reputation” score which is basically a fuzzy measure of how well the Stack Overflow community trusts you. You earn reputation by asking and answering questions, so users that participate more actively in the community will get more reputation. Already that’s a form of motivation right there; the more you do for the community, the more reputation you build up.

Specifically, you gain reputation when you do positive work for the community. Users can vote on each others’ posts, so a good answer that gets a lot of votes will grant more reputation than a mediocre or weak answer (and likewise for questions). It’s very encouraging to see your answers get a lot of votes, and this sort of now-that reward (now that you’ve provided a good answer, we’ll boost your reputation) has been proven to be a repeatable tactic to motivate good behavior.

Similarly, good behavior is occasionally rewarded with badges. For example, if you answer a question and your answer is up-voted by ten different users, you earn the “Nice Answer” badge. This is known as an if-then reward (if your answer is accepted by many of your peers, then you get this badge added to your profile) and is historically a very effective technique for short-term motivation. Stack Overflow does a couple of things to keep badges relevant in the long term:

  • Some badges are extremely hard to earn — I’ve seen a few that have only ever been awarded a few dozen times.
  • Some badges can be awarded multiple times.

These conditions mean longtime users still have something tangible to strive for, so the motivational boost generated by badges doesn’t dwindle over time.

But rewards aren’t the only things that motivate us.

So far we’ve looked at the measurable ways that Stack Overflow motivates its users, but there are a number of non-measurable motivators as well. For example, the higher purpose of helping others and contributing to a database of valuable knowledge is a strong intrinsic motivator, and studies have shown this type of motivation to be the most powerful. On a basic, human level, we like to help each other out and do good work. Stack Overflow is an outlet for these tendencies.

Likewise, we enjoy pushing ourselves to master various skills. Like the carpenter who perfects his craft over years of experience, it’s rewarding for geeks like myself to hone the technical and communicative skills required to answer challenging technical questions. Not only do I learn something new every time I log on to Stack Overflow, I teach something new as well — this knowledge-transfer cycle is something I simply crave.

Let’s discuss this a little more.

If you’ve spent any time on Stack Overflow, I’d love to hear your take on this. Do you find yourself motivated by the factors above? Did I miss an important motivator that really drives you to contribute to the community?

Better yet, did you stop visiting Stack Overflow because you found it boring or uninteresting? What motivated you to leave?

Ottawa High School Technology Program Winter 2010 Wrap-up

Friday, June 11th, 2010

As some of you may recall, I volunteer with the Ottawa Centre for Research and Innovation in a program that aims to teach high school students how to develop real, working software. I’ve mentioned this before (in fact, I have an entire page dedicated to what I do with OCRI), but I haven’t really been blogging about it much (read: at all) this semester.

Fortunately, my co-mentor for the past twelve weeks has. I present to you:

I’m not sure why I didn’t even check in once over the course of three months, but I’ll try to actively post about it next time around. This is something I like to talk about.

Finally, this season’s program ended last night with the annual showcase. This event allows students to demonstrate their final product, (hopefully) running on a real XO Laptop, to friends, family, mentors such as myself, students from other schools, and various representatives from OCRI. It was a fun time, and as always, the ability of students that are often being exposed programming for the first time to crank out creative, engaging applications is absolutely stunning. I couldn’t be more proud of the students I’ve worked with and the software we’ve created.

What Photography and Programming have in Common

Monday, May 31st, 2010

Ladies and gentlemen, allow me to share with you a tale of two photographers.

My fiancée and I were featured in a piece for our local newspaper a couple of weeks ago. The columnist wanted an image to accompany her content, so a photographer was sent to my apartment to take a photo of me and my bride-to-be.

This went down about the same way I expected. Some nondescript dude with a camera walked in, looked around the room for all of about six seconds, arranged a semi-interesting shot involving a mirror, snapped a few pictures and left. This took around ten minutes.

A few days later, the writer for the aforementioned article called back and asked if she could send over another photographer. Apparently the shot the first guy had lined up was too similar to a shot the newspaper was running on another article, on the same day, in the same section, so they needed a new one.

The second photographer was Christopher Pike.

Christopher ran things a bit differently. After introducing himself, he spent a few minutes looking around my humble abode and the surrounding area. He then asked my fiancée and I what we thought of a few potential shots, and started taking pictures. A lot of pictures. We posed on our balcony, on a bench, near a wall, next to a fence, under a tree, and probably in other places that I’ve since forgotten about. Every time Christopher noticed something that might make for a cool photo, he asked if we wouldn’t mind posing for it. In total, this process took over an hour.

It’s important to note here that the first photographer and Christopher were both freelancers hired by the newspaper. They were probably both paid the same amount. But while the first guy spent ten minutes taking a picture he had decided upon in advance, Christopher spent about seven times that long experimenting and looking for the perfect shot.

What does this have to do with programming?

Just like photography, programming is a craft.

That first photographer, the one whose name I can’t remember, was just in it for the job. The editor wanted a cute photo of a cute couple, so our unremarkable photographer took one and took off.

This is how a lot of equally unremarkable coders look at programming. You need a function that converts X inputs into Y outputs? Sure. Let me whip up a quick algorithm that does that. Done. What’s next?

Christopher, on the other hand, was there to take great pictures. He was passionate. He approached photography as a craft. Yes, the output was a photo that he could sell to a newspaper, but believe me when I tell you that’s not why Christopher is a photographer.

This is how I look at coding (and hopefully how you do too). You need a function that converts X inputs into Y outputs? Ok, let me consider the context, ask a few questions, then create a solution. Functionally, it will be the same as Joe-first-photographer’s solution, but as a programmer that cares about his craft, I took the time to:

  • Verify that yes, a single function is the best solution.
  • Keep future maintenance and extensibility in mind.
  • Write clear, reusable code.
  • Add useful comments where necessary.
  • Refactor my function to be as simple as possible.
  • Change all my spaces to tabs to match the existing code-base.

Which photographer would you rather hire? Which programmer would you rather have on your team?

Software Bundles, Independent Developers, and More!

Monday, May 10th, 2010

Over the weekend, I picked up the Humble Indie Bundle, a pay-what-you-want download for five six games created by independent developers. I love these bundles! I get a bunch of cool software, the developers get a lot of blog coverage/followers/supporters/fans (let’s just call it social capital), and a cut of the proceeds go to a pair of great causes (Child’s Play and the EFF). It’s win-win-win. And it shows one of my favourite things about software:

Software is different.

No other industry can really get away with something like this. Can you imagine if those had been board games instead of computer games? Think of the logistics involved! Impossible. But software can get away with it, because once software has been developed, it costs almost nothing to make copies of and distribute. Different. Which reminds me:

Independent developers are special.

You don’t really see major publishers do this. You could make a case for Valve, because they really have this online-distribution thing figured out, but you’d never see EA partner with Blizzard for a heavily-subsidized package including Dragon Age and Starcraft 2, let alone see them donate the majority of it to charity. Independent developers can do this because they don’t operate under the same rules as major publishers, and they’ve found a loophole in traditional business beliefs that allows them to do something awesome that benefits them, their users and anyone touched by the charities they support. Special.

Now bear with me for a second, and let’s try to think of a market that sells and distributes software with a lot of support for, or even a huge bias towards, independent developers. Wouldn’t that be an ideal platform for more of these bundles? (Don’t cheat and say Valve; I know they’re cool, but that’s praise for another day and we’ve already singled them out above).

The App Store.

Apple’s App Store for iPhone/iPod/iPad contains around 200 000 applications* and is very popular among independent developers (I couldn’t find numbers for this, but polling my iPhone I’m going to wager it’s certainly a majority). With that many applications, developers could really use some extra exposure, and the visibility Apple is able to provide through the App Store is surreal. How long would it take for most iProduct users to hear about a group of independent App Store developers packaging a few apps together for the sake of charity if it was promoted directly through the App Store and/or Apple’s marketing team? Days? It would be a sure-hit.

Users would get more great software in a convenient, affordable, socially-rewarding package. Developers would get more copies of their app out there, and a compounding amount of exposure (word of mouth is big on iProducts). Apple would get some much needed love from their developers and their users (if anyone is hurting for karma right now, it’s Apple). And just think of the fantastic interface Apple’s brilliant designers could craft by integrating bundle-purchasing straight into the App Store!

There is a huge opportunity here.

Am I the only one that sees this? Tell me I’m not crazy.

* They announced at the iPhone OS 4 event back in April that they were over 185 000, so if 200 000 hasn’t been reached yet it’s not far off.