Forum Moderators: LifeinAsia

Message Too Old, No Replies

Planning before coding

         

moltar

2:00 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know that planning solves a lot issues in a long term. If you plan ahead, before writing any code, you will write the code twice, if not much, faster. In college I was taught to do a lot of planning, which included:
  • Problem statement
  • Problem Solving
  • Pseudo-code (aka PDL)
  • Test plans
  • Sample outputs
  • etc... depending on the specifics of a project

In reality, I do plan, but not as much as I would like to, or had to do in college. Mostly because of tight deadlines and fast pace environment, and of course, laziness.

  • How much planning do you do, before you start to code?
  • What is the approximate time ratio of planning vs. coding?
  • What tools help you to get the most out of yourself?
  • Any strategies of your own?

Lets assume we are talking about medium sized projects (under 5k lines), that include database interaction.

photon

2:30 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One place to start would be with the techniques mentioned in tedster's posts about Information Architecture for the Small Site - part 1 [webmasterworld.com] and ...part 2 [webmasterworld.com].

moltar

2:59 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you photon. I was speaking of programming side of things, rather than GUI design and site structure. Which is, of course, as important (if not more) as back-end of sites.

I guess I should've pointed that out.

drbrain

3:29 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



None.

Here's what I do. First I get an idea. Then I pick a name for it, then I write a test-case using a unit-testing library, run it, and watch it fail (no tests).

Then I figure out what I need to write first. So I write a test for it, watch it fail, write the code for it, run the tests until the work, and repeat.

When I don't have a good-enough picture of what I want, I don't need to throw everything away. I have a good library of tests that can be refactored even if I have to totally scrap the implementation.

The other benefits of having a test suite is that when you discover a bug not covered by your test suite, you write a new test for it, watch it fail, then fix it. You don't have to worry about breaking other code.

Easy_Coder

7:06 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How much planning do you do, before you start to code?
A ton! Interviewing, white board sessions with other devs, non devs & pm's, gap analysis if your upgrading, uml models...

What is the approximate time ratio of planning vs. coding?
60 to 80% planning vs. 40 to 20% coding

What tools help you to get the most out of yourself?
Oddly enough, Visio. It plays a large part of the deisgn side of things. At least for me it does. I wish the co. I work for had us using Rational Tools but they are pricey as heck.

Any strategies of your own?
I'm a big believer in spending the bulk of my time in design because bugs caught there can be fixed w/o much of an economical impact.

There's a book written by Stephen McConnel titled "Code Complete" that should be on your hit list of "books to read" if your a dev. It's an amazing read that will change the way you look at software development.

moltar

9:08 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the suggestion Easy_Coder, I just purchased it :)

drbrain

9:14 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add "The Pragmatic Programmer: From Journeyman to Master" to your reading list as well.