Page 1 of 1

Before the Code - A discussion of best practices

Posted: Mon Jul 07, 2003 4:56 pm
by mk
Hello All...

What steps do you guys take before beginning a complex web app... before beginning the actual code?

Do you draw out your db designs using something like SmartDraw or do you draw them on paper by hand or do you not draw them at all?

Do you outline our code before jumping into it?

Basically, I want to see the steps you guys take before actually coding complex projects. Hopefully with everyone sharing their methods, we can all takeaway something from this thread.

Posted: Mon Jul 07, 2003 5:01 pm
by mk
Here's my methodology before beginning the code:

- Write down all of the functionality/features the app should include. Either get this list from the client or, if its my own project idea, brainstorm. Also, I've found that brainstorming with a client is extremely helpful because it opens the doors to future phases and therefore $.

- Layout the database on a whiteboard or paper. Pass this to another trusted developer to get feedback

- Outline the project files.
Example:
search.php
---> Check if user is logged in
---> If no search term is set, show search form
---> If search term is set, query db
---> If there are results, show them
---> If not, show no results

- Write the code

Posted: Mon Jul 07, 2003 5:03 pm
by m3rajk
before you can make the db, you need to figure out what you want to have stored there. before you can code the php, you need tofigure out what to display/collect on what pages.

Posted: Mon Jul 07, 2003 5:08 pm
by mk
Understood... I'm trying to figure out specifically what other developers do.

Do you guys use some neat flowcharting/database visualization software or do you write out the table structure by hand like i do?

Do you guys know of some powerful tool that has made the pre-Code phase of the project more efficient?

Just trying to get an understanding of how other developers get their work done.

Posted: Mon Jul 07, 2003 5:14 pm
by m3rajk
i sit down with whoever i'm working with and figure out the pages. once we havethe info on the pages we decide what should be db and what should be calculated by php on the fly and ow. once you have that it's a matter of getting the best db types

i'm rather new to all this so i've asked for help in that (in the db forum) but i seem to be ignored

Posted: Mon Jul 07, 2003 5:39 pm
by McGruff
I always start by considering the user interface in detail. I'd say that an excellent interface with middling (but functional) scripting makes a better program than excellent scripting & db design with a middling interface. The user doesn't care what's under the bonnet as long as it works - co-workers might though if your scripts are hard to follow!

I'll draw up a list of all the html pages I need to draw and what will go on each page in terms of text content, graphical elements or clickable links which launch scripts to perform tasks.

This leads to a html nav plan - maybe a php one as well to show how the main scripts will interact (although if you write modular scripts everything just seems to fall into place without too much planning). I'll try and use Freehand rather than scribbling things down: the diagrams can then be added to any other documentation, if needed.

Once I have a list of tasks to be performed by scripts, I'll have a clearer picture of the vars and db columns required and start planning a db structure.

Then it's time to launch editPlus.

Posted: Mon Jul 07, 2003 10:04 pm
by nielsene
I take a relaxed/loose UML-based approach to most projects:

Start off with a textual description of the project; and then try to diagram the common use-cases in terms of abstract steps (not web pages/forms/php pages)

This will help flesh out my textual description a little more which then evolves seperately into both the persistent data model (DB) and the "functional" data model (class structure). My class/db models tend to be very different because I design them for different goals and I have a decent class->db abstraction base class.

Then I'll work on the web/nav model diagramming out first the page flow, then the individual page layout.

Next I go back to the use cases using the more concrete designs I've come up with to "test" the design.

Finally I try to come up with several "extensions" to the base project and see how the design would deal with them.

As to tools, I've tried variously UML design tools such as Posedion, it helps with some of the diagramming, and can create template code for C++/Java, but not for PHP :(

I haven't found a good E-R modelling tool that I like.

Posted: Mon Jul 07, 2003 10:18 pm
by DuFF
I typically write down on the paper a quick outline of what the page will need to contain and a rough idea of how I will accomplish it. Then I do a quick sketch of what the page will look like just for fun :) . Other than that I'm pretty much on the fly, whatever comes to mind. Later, especially when I'm bored, I'll write down any extra features or ideas I come up with and later implement them.