views:

569

answers:

13

When first approaching a project is best to step back and think through everything or just dive in and start coding and polish at a later date? Essentially, do you design first or try to rapidly prototype?

I have been burned by both methods, sometimes I try and think everything through but when I actually get down to the nitty gritty I encounter problems that I didn't take in consideration, and sometimes when I code first I end with code that needs to redone to fit in with a better overall design. Alot of my problems stem from inexperience, but any advice is welcome.

+5  A: 

It is always safer to design first, but this does not mean prototyping does not work. The real problem with prototyping is resisting the urge to keep the code you already wrote instead of throwing it away when the time comes to do the design.

Or the management urge to say "Well this works, why do you need more time?"
wonderchook
Agreed! Similar to when you show off the prototype to the clients, and you can't make them understand that just because they see it doesn't mean it's working.
+1  A: 

You must have some idea of a cohesive architecture before you start working. This is especially true of large scale systems.

Prototyping could be used for particular aspects of the design, e.g. presentation layer.

Rob Wells
A: 

Design first, unless you're willing to take the risk of throwing out all the work put into your prototype when you find it can't do what you need it to do. At a minimum, you should make some high level designs for your project that can help you make some decisions about how you're going to build your prototype so that you will have a minimum of wasted effort.

Elie
+27  A: 

Go incrementally and iteratively.

Design a bit, implement a bit.

Starting with a design you can suffer from a tunnel effect where you cannot have any real feedback before you actually implement something.

Starting without design, you can take decisions you'll regret.

The ideal situation is to be able to implement a very skeletal end-to-end version of your system that can be tested, and demonstrated to the customer.

philippe
+1: Experience and common sense, buzzwords notwithstanding.
Adam Liss
+3  A: 

See Gall's Law. The key is to iterate: design a little, implement a little, test a little, then repeat until you (or your customers) are satisfied. This is the essence of the new breed of "agile" methodologies.

florin
+1  A: 

I think it depends on what kind of business requirements you have up-front. If they are (relatively) detailed and complete, then I'd design based on those requirements. If you have barely anything to work with in the beginning, then prototype out and show your customer what you got, to receive further requirement info.

Kon
+1  A: 

You should develop using Agile Methodologies. Simply put, you design has you go. The team together with the product owner define a list of topics to develop, order them by importance, and split the development in iterations. Each iteration as features to be developed and on the start of the iteration is design each feature.

See more here.

Bruno Shine
+1 for not linking to your website in the answer ;-)
Steven A. Lowe
+1  A: 

It depends.

Prototyping is most useful when the requirements or a solution aren't necessarily clear. As an example, I am doing a data warehousing project in an environment (large commercial insurance) where financial reconciliation is a big deal. This project has involved a large prototyping exercise to get a system that will reconcile to the financials. As the business rules surrounding this were not well documented, the prototype was instrumental in exposing all of the corner cases.

In other cases, a design-first approach might be more appropriate. This is most applicable where requirements and a sensible solution architecture are reasonably obvious.

ConcernedOfTunbridgeWells
+4  A: 

There is no silver bullet. It seems like design first is the preferred approach. But you will not be able to predict all complications that can arise while implementing your design. Some of them could potentially be show stoppers. Plus, if you're writing for a client, it's good to be able to show something just to make sure that you're on the same page.

At my workplace we do both - we do a rapid prototype, just to get feedback and get an idea of any potential problems. Then we do a formal design and formal implementation. In most cases we are able to salvage a lot of code from the prototyping stage. I like this approach, since we usually end up with clean, maintainable code.

Filip
A: 

If I know what I want to build, I just go right to design.

If I'm building something for a client, then I prototype to ease out more specific requirements from the users.

John MacIntyre
A: 

Maybe not an answer but a suggestion from my experience.

In most cases I'd be better off if I had started coding earlier. You can design until the cow comes home, but if the cows are on the horizon when you start coding, you might find your careful design hard to implement in time.

John at CashCommons
+1  A: 

When first approaching a project, prototype. But don't prototype everything. Prototype one important thing (one "use case" if that means anything) and "turn the inner eye to follow its path" - keep an eye out for the practical problems you encounter in trying to get that one thing done.

Now that you have some idea what it takes to do an important thing, you can design from more than just first principles.

Of course, this assumes you're working in an environment where you can turn out prototypes at minimal cost to ongoing development efforts. But if you're working in such an environment, pepper your design discussions liberally with prototypes. With any luck you may get to keep some of them.

Glazius
+1  A: 

note that agile methods are not an excuse to avoid designing, they just encourage testing of the design more frequently, and in smaller increments

i like to sketch the design and break its elements down until reasonably sure that there are no obvious unknowns or risks; unknowns and risks are highlighted for 'spike' projects, with a time-box for determining feasibility and notes on possible alternatives if the preferred methods prove unworkable

once comfortable with the overall architecture, jump into the features bottom-up (or in priority order) to complete the design, write the initial tests, then implement

EDIT: note that the question "design or prototype first" is making a bad assumption, i.e. that it is possible to prototype without doing any design, which of course is not the case (unless you are using the million-monkeys methodology)

Steven A. Lowe