Click to See Complete Forum and Search --> : If you fail to plan then you plan to fail!


abc123
02-22-2007, 03:31 PM
Hello all,
Thought I would share my story in the hope that it might help people out in future projects.

I am currently a student doing my last year at University (anyone got spare change?). Anyway... I have a big project to do for my final year and I decided to do a project using PHP. I figured that I have a good understanding of the language so there should be no problems.

I spent a little bit of time on the design of the database and how I wanted it to look. I should have spent a lot more time on this design.

As I dived into coding I found myself staying up for hours just typing away making it all work. I've not got a fair bit done and to be honest it is working just fine.

Only problem is the code is a mess and I have no idea what my weird and wonderful variables are doing!

After struggling with a particular problem I've decided to strip it apart and go for some good old Object Orientate Design. This is easier said than done. I'm looking at my pages of code wondering what exactly it does! Well to be more precise I know what it does but not how it does it.

Take my advice and no doubt the advice of many others. Design it from the start and not as you go along. It'll save you major headaches for the future.

I feel I must apologise to those in the community who keep preaching about design and standards. I should have listened.

No point in learning the easy way I suppose.

Wish me luck on the redesign! :queasy:

NogDog
02-22-2007, 05:03 PM
Wish me luck on the redesign!
We call it "refactoring". That makes it sound like we meant to do it. ;)

abc123
02-22-2007, 05:06 PM
Thanks for that.

I'll be sure to mention "refactoring" in my design document I've to hand in. Sounds much better than redesign.

greenie2600
03-01-2007, 02:37 PM
Amen to this, abc123. Whenever I start a new project, I spent hours or even days (depending on the scale of the project) considering different approaches before I write a single line of code. Once I decide on an approach, I'll sometimes write a simplified test case to make sure the key elements are really viable.

I also comment my code liberally, even if I don't expect anyone else to ever see it. I learned that the hard way - I've often looked at code that I wrote six months or a year ago and had absolutely no idea what it was doing.

As a project grows, I often spend a fair amount of time refactoring the existing codebase to be more scalable and robust, if I was lazy about that in the beginning. It's easier to just add more kludgey code, but that just creates more code that will have to be rewritten at some point. Better to fix things earlier, when the codebase is still relatively small.

Anyone have any other tips on planning and managing projects?

madwormer2
03-01-2007, 04:22 PM
If it, or something similar has been done before, see how it's been done.

A bit of research can go a long way to helping you plan your project out.

:D