11 Sep 2004 prozac   » (Journeyer)

Anatomy Of Style

I was working on part of my latest pet project in PHP and, obsessive that I am, I wrote four different versions using various programing design strategies.

I have documented and summarized my findings. Here is an excerpt:

"This text documents four different PHP programming styles. My meaning of "style" here is less to do with brace alignment and whitespace than with program structure or orientation. (I am aware of other definitions of these words and purposely am being slightly vague.) I have endeavored to portray some of the very basic yet different styles by providing working examples.

...

I offer four versions of an example program that I came up with which will stress (but not too much) the mixture of PHP and HTML: the use of an array of data to be displayed in a TABLE. Minor perhaps in the overall scheme of things, but important enough for what I want to demonstrate. It is a working example; it provides a list of all files in the current directory and three functions: open the file, delete the file, and to create a new file. (The code to actually perform those particular actions has been left out but everything else works and it will be easy to add those features.)"

Read more here: Anatomy of Style

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!