Re: [PHP] Cleaning up my messy code

2003-10-08 Thread Geoff Hankerson
Here is what I would do (this advice and a buck will buy you a cup of coffee): First, I'd take my existing code, look over it and ask, Where am I doing the same thing over and over? Code that is repetitive is a prime candidate for using functions or objects. Objects are easier to maintain for

Re: [PHP] Cleaning up my messy code

2003-09-30 Thread Cristian Lavaque
olinux wrote: Try out smarty (its quite simple). You will get some ideas on how to structure. I learned that its *ok* to have some *display logic* in your templates (i.e. repeating rows). (yes, some will adamantly disagree) Another thing i learned when using smarty is I like using arrays to

RE: [PHP] Cleaning up my messy code

2003-09-30 Thread Didier McGillis
in to help you wont have to spend much time babysitting them. From: Chris [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: [PHP] Cleaning up my messy code Date: 29 Sep 2003 21:49:45 - [EMAIL PROTECTED] (Warren Vail) wrote in news:[EMAIL PROTECTED]: My own experience has shown that separation

[PHP] Cleaning up my messy code

2003-09-29 Thread Chris
I am working on a fairly large scale (for myself anyway) project using PHP and MySQL. I am victim of teaching myself to program, not separating presentation from my code-- all the things that lead to masses of spaghetti code so atrocious even I can't figure out what I was doing an hour ago.

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread Burhan Khalid
Chris wrote: I am working on a fairly large scale (for myself anyway) project using PHP and MySQL. I am victim of teaching myself to program, not separating presentation from my code-- all the things that lead to masses of spaghetti code so atrocious even I can't figure out what I was doing an

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread Brent Baisley
You should search the web for articles on MVC, Model View Controller. This is a standard technique for separating your presentation from your logic from your database. The concept can be applied to any programming or scripting language since it actually falls under the much bigger realm of

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Jay Blanchard
[snip] I'm not looking for an IDE or code generator so much as some practical advice for organization and framework when developing a larger app. I know of PHP Fusebox, having programmed with Cold Fusion fusebox for a while, but it seems like that might be too much. Maybe I just need a

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread CPT John W. Holmes
From: Brent Baisley [EMAIL PROTECTED] I looked into the templating systems at first, but really wanted to try what they were doing myself. It ends up being very easy to implement using output buffering. Just look into the ob_start() command. Here is an example of how I load a template file

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread andu
On 29 Sep 2003 19:22:54 - Chris [EMAIL PROTECTED] wrote: I am working on a fairly large scale (for myself anyway) project using PHP and MySQL. I am victim of teaching myself to program, not separating presentation from my code-- all the things that lead to masses of spaghetti code so

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread Robert Cummings
On Mon, 2003-09-29 at 15:22, Chris wrote: I am working on a fairly large scale (for myself anyway) project using PHP and MySQL. I am victim of teaching myself to program, not separating presentation from my code-- all the things that lead to masses of spaghetti code so atrocious even I

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Vail, Warren
-Original Message- From: andu [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 1:38 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Cleaning up my messy code On 29 Sep 2003 19:22:54 - Chris [EMAIL PROTECTED] wrote: I am working on a fairly large scale (for myself anyway) project

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Robert Cummings
On Mon, 2003-09-29 at 17:12, Vail, Warren wrote: IMHO, the first test of any code, is does it do what is should accurately, and speedily (in that order), after that what you have left is a programmer's best effort at producing something that others can read. Adding cpu cycles so that it can

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Vail, Warren
No argument from me. Warren -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 2:21 PM To: Vail, Warren Cc: andu; PHP-General Subject: RE: [PHP] Cleaning up my messy code On Mon, 2003-09-29 at 17:12, Vail, Warren wrote: IMHO

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Chris
[EMAIL PROTECTED] (Warren Vail) wrote in news:[EMAIL PROTECTED]: My own experience has shown that separation of a presentation layer from an application layer, doesn't occur where we think it should. HTML as a language has no capability to be dynamic, and if we are going to ask that the

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Robert Cummings
On Mon, 2003-09-29 at 17:49, Chris wrote: Certainly. This is not a theoretical exercise but frustration with dealing with my own code, trying to implement revisions, and basically feeling like I need a map of some kind to know where I am. That's why I'm interested in what other people

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Vail, Warren
] Sent: Monday, September 29, 2003 2:50 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Cleaning up my messy code [EMAIL PROTECTED] (Warren Vail) wrote in news:[EMAIL PROTECTED]: My own experience has shown that separation of a presentation layer from an application layer, doesn't occur where we think

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]): From: Brent Baisley [EMAIL PROTECTED] I looked into the templating systems at first, but really wanted to try what they were doing myself. It ends up being very easy to implement using output buffering. Just look into the ob_start()

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Chris L
[EMAIL PROTECTED] (Robert Cummings) wrote in news:[EMAIL PROTECTED]: Regardless of the framework or library or whatever you choose, you WILL have to adapt to it to some degree. Whether that be style-wise or just learning the the API. The more power, and flexibility you want, the more you

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Robert Cummings
On Mon, 2003-09-29 at 19:10, Chris L wrote: [EMAIL PROTECTED] (Robert Cummings) wrote in news:[EMAIL PROTECTED]: Regardless of the framework or library or whatever you choose, you WILL have to adapt to it to some degree. Whether that be style-wise or just learning the the API. The more

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Chris L
[EMAIL PROTECTED] (Robert Cummings) wrote in news:[EMAIL PROTECTED]: *heh* I like being able to look at project 2 and say to myself, hmm needs an authentication just like project 1, but with a different look. Or wants a news feed, like project 1, buyt the data source is different, I'll

RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Robert Cummings
On Mon, 2003-09-29 at 20:27, Chris L wrote: [EMAIL PROTECTED] (Robert Cummings) wrote in news:[EMAIL PROTECTED]: *heh* I like being able to look at project 2 and say to myself, hmm needs an authentication just like project 1, but with a different look. Or wants a news feed, like

[PHP] Templating system (was Re: [PHP] Cleaning up my messy code)

2003-09-29 Thread Brad Pauly
On Mon, 2003-09-29 at 17:07, Curt Zirzow wrote: I wonder if now is a place to introduce my new templating system. Definitely! I'd be interested in seeing it. I have the same difficulties in letting just joe blow executing php code within templates, sometimes smarty is just to smart for

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread andu
On 29 Sep 2003 21:08:40 -0400 Robert Cummings [EMAIL PROTECTED] wrote: I like that idea too-- I just don't like having to learn what amounts to a third language to do it. Does one have to have a templating engine in order to achieve this? I find reusability to be, largely, a

Re: [PHP] Cleaning up my messy code

2003-09-29 Thread olinux
Try out smarty (its quite simple). You will get some ideas on how to structure. I learned that its *ok* to have some *display logic* in your templates (i.e. repeating rows). (yes, some will adamantly disagree) Another thing i learned when using smarty is I like using arrays to keep things