In my experience, it is useful to spend a little while sketching plans for a project before getting into code. Such planning usually includes choosing frameworks/tools, writing requirements and expectations, and doing mockups.

I usually only do this for serious projects though, not so much for one-off or short-lived attempts.

I'd be interested to hear how much time you spend on planning/designing projects before starting to do the coding. Do you do it for every project, or just the "serious" ones?

As Much As It Takes

Disagree. Even the best plans usually don't survive first contact with Other People's Code. There's nothing wrong with up-front planning, but there are lots of things that happen over the course of a real project that you can't plan for. I think it's important to get your hands dirty. Learn those quirks while you still have time to deal with them.
–
KristoDec 4 '10 at 2:27

@Kristo: I agree, which is why I said 'as much as it takes'. When you reach the point that you know what you don't know, and you have identied the major risks, it's time to start prototyping.
–
Steven A. LoweDec 4 '10 at 4:29

We use Scrum at my job, so I would say at a minimum you have to give enough design thought to break down your user stories into tasks. You need a pretty good idea of what's needed to write tasks. Remember that the key is to write them so someone else could theoretically do the implementation. I usually fold the little details (e.g., which algorithm to use) into the time estimate for my tasks. If I need to do some no-kidding research, I'll make that its own task.

When dealing with an Epic (a project that lasts multiple sprints), I'm a lot freer with what I call "design." Design in that case usually involves a rough sketch of the basic architecture and a handful of user stories that I expect to do. It's not cowboy coding, but it's not a rigorous design process (think traditional waterfall model) either. Something will come up (a requirements change or an a-ha moment) that changes the game somewhere down the road. I try not to invest too much time in something that will likely get thrown out or heavily modified.

The famous Jamie Zawinski said in the book "Coders at Work" something along the lines of...
It's better to spend just enough time in order to be able to code something we can use, then go from there. Depending on the project and competition, if you spend TOO much time planning and thinking of THE best way to do something and don't have a working product in a given time frame, your competitors will be ahead of the game and it will be a huge loss.

I don't necessarily agree with it though, but you've got to give him credit for what he's accomplished.