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:
-
The Lifecycle Model
-
The Waterfall Model
-
The Incremental Model
-
The Spiral Model
-
The Component Assembly Model
-
The Concurrent Development Model
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:
-
Programmers work in pairs
-
Testing (of all kinds) is very important. In fact, write tests for all code, and do that first!
-
Refactor often
-
Work no more than 40 hours per week
-
Anyone can change anyone else's work
-
Release versions early and often --- don't wait until it is done because it never will be, and the feedback from users is critical
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:
-
HTML - document structure
-
Javascript - browser (client-side) functions
-
SQL - database connection
-
PHP - server functions, which mostly produces all of the above
-
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:
