UserPreferences

PHPDemo


1. Doug's PHP Demo

1.1. New Software Engineering

The old method of software design taught us to plan, plan, plan, until we couldn't plan anymore. Then code as quickly as you could because we were already past deadline. Well, it was something like that. Examples:

Because Object-oriented programming (OOP) was so successful, newer strategies are more flexible and encourage writing code earlier in the process. Like right now! One of the most radical is Extreme Programming (XP). Some components of XP:

See http://www.xprogramming.com/xpmag/whatisxp.htm for more details.

In a nutshell, it all boils down to:

If you find yourself doing the same thing over and over, you're doing something wrong. Reorganize until it feels better.

1.2. Web Applications

Programming is an art. It involves the science of computation, a host of practical concerns (like security, speed of processing), esthetics, interface design, etc. It is hard. But also very rewarding. Like all arts.

1.2.1. PHP

Built into the server (usually Apache, but works on many platforms). Fast. Faster than Common Gateway Interface (CGI) which must start a process for each connection.

Web programming is hard partly because of the number of languages involved:

  1. HTML - document structure

  2. Javascript - browser (client-side) functions

  3. SQL - database connection

  4. PHP - server functions, which mostly produces all of the above

  5. Cascading Style Sheets (CSS) - formatting (static and dynamic)

There is nothing to prevent you from mixing these up, and, in fact, PHP allows you to!

Goal: try to keep each language independent. That will help keep it straight in your head, but also will help when you want to add another language to the mix. For example, what if you want to take the web page that you just created and make a PDF printout? If you do this right, it should be easy.

A working full-blown example: http://edventure.brynmawr.edu/

1.2.1.1. Examples
<?
  phpinfo();
?>
1.2.1.2. The Demo

What do you think of this:

2. Links