Re: [PHP] [Q] Development Best Practices

2003-11-18 Thread Chris Hayes
At 04:20 18-11-03, you wrote:
Adam wrote:

My question, how do you guys build your pages? Do your scripts generate 
all the HTML? I'm looking for tips and resources. Remember for my first 
site I've embarked on a fairly large site. Code maintenance will be an 
issue for me as I need to enhance and fix it later on.
My mistake in coding is that I always start with the parts I know I can do, 
then slowly add the other functionality. I would call this an organic way 
of coding, and the more additions I make, the more little changes i need to 
make to the existing code until it is full of extra conditions. This is 
partly because my chef keeps inventing new functionality, but mostly 
because I did not know how to write a proper plan (i did try).
I tried my own way, i tried Unified Modeling Language (UML) , but that was 
a bit too heavy for a one-person coding project.

Right now I am rigourously reorganising the whole mess, which would not 
have been necessary had I made better plan.
The most simple rule is: divide functionality. Do not mix logic with 
presentation. Have your SQL part, your logic part and your presentation part.
And of course add loads of comment while you are working. Best for the 
thinking process is to first make comments of the steps you want to make, 
and only then add the code. I noticed that while writing the comments, I 
would adjust my plans.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] [Q] Development Best Practices

2003-11-18 Thread Luis Lebron
Before considering using templates you may want to take a look at 

http://www.phppatterns.com/index.php/article/articleview/4/1/1/


Luis


-Original Message-
From: Adam [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 7:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] [Q] Development Best Practices


All,

I'm not new to programing or web development but I am new to creating 
dynamic pages.

I've read through a couple books. I've worked through problems and 
exercises. Installed and configured the software a few different times 
in Win32 and OS X. At this point, I feel I have a good handle on the 
environment and lexical structure. What I don't have is a grasp on best 
practices. For real sites I'm a little confused on how to implement all 
this new knowledge. For example, I've got a site that was static with 
bits of CGI to PHP. I was going to generate all the HTML from a PHP 
script, but that turned into a mess. So I tried creating the pages is 
mostly HTML with little bits of PHP. Placing the logic in another file 
and linking the two pages. I'm not really sure if that is the best 
approach.

My question, how do you guys build your pages? Do your scripts generate 
all the HTML? I'm looking for tips and resources. Remember for my first 
site I've embarked on a fairly large site. Code maintenance will be an 
issue for me as I need to enhance and fix it later on.

Thanks guys!

Regards,
Adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [Q] Development Best Practices

2003-11-17 Thread Adam
All,

I'm not new to programing or web development but I am new to creating 
dynamic pages.

I've read through a couple books. I've worked through problems and 
exercises. Installed and configured the software a few different times 
in Win32 and OS X. At this point, I feel I have a good handle on the 
environment and lexical structure. What I don't have is a grasp on best 
practices. For real sites I'm a little confused on how to implement all 
this new knowledge. For example, I've got a site that was static with 
bits of CGI to PHP. I was going to generate all the HTML from a PHP 
script, but that turned into a mess. So I tried creating the pages is 
mostly HTML with little bits of PHP. Placing the logic in another file 
and linking the two pages. I'm not really sure if that is the best 
approach.

My question, how do you guys build your pages? Do your scripts generate 
all the HTML? I'm looking for tips and resources. Remember for my first 
site I've embarked on a fairly large site. Code maintenance will be an 
issue for me as I need to enhance and fix it later on.

Thanks guys!

Regards,
Adam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Jason Godesky
There's certainly nothing wrong with putting bits of PHP into a primarily 
HTML document, but for very large, complicated sites (and you mention that 
yours is), you'll probably want to use templates to separate out 
presentation and logic.

http://smarty.php.net/
http://sourceforge.net/projects/xtpl/
--
Jason Godesky
[EMAIL PROTECTED]
http://www.tribaldawn.com/jason/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Robert Cummings
On Mon, 2003-11-17 at 20:47, Jason Godesky wrote:
 
 There's certainly nothing wrong with putting bits of PHP into a primarily 
 HTML document, but for very large, complicated sites (and you mention that 
 yours is), you'll probably want to use templates to separate out 
 presentation and logic.
 
 http://smarty.php.net/
 http://sourceforge.net/projects/xtpl/

And there also:

http://www.interjinn.com

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Rob Burris
Adam wrote:

My question, how do you guys build your pages? Do your scripts 
generate all the HTML? I'm looking for tips and resources. Remember 
for my first site I've embarked on a fairly large site. Code 
maintenance will be an issue for me as I need to enhance and fix it 
later on.

The practice I would recommend is to remember to use functions for any 
code that is reusable. I create a separate file that encapsulates all my 
functions and include that file in all my scripts. That way every 
function is available anywhere in the project, and you can always add to 
that list. This is just one way you can break down your projects into 
more manageable pieces.

- rob
http://www.phpexamples.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php