View Single Post
Mr Beardsley
Member
 
Join Date: Jul 2004
Location: Colorado Springs
Send a message via AIM to Mr Beardsley  
2006-06-27, 15:45

Quote:
Originally Posted by nassau
ok, but when you say it's too easy to mix interface with business logic - that only implies "poor" coding, not that PHP itself is a lesser language. and what does "OO" mean?
That's true, if you where smart you would try to separate your interface from you business code. If you plan on doing much PHP work, this would for sure be a good practice. However, when PHP was released it was not designed for this. The closest PHP comes to "code behind" functionality is grouping functions in a separate, includable file. This is helpful, but is nowhere near as powerful a system as "code behind".

Another huge difference between PHP and other web app frameworks is the way in which they are run. PHPs script based nature is much simpler and limiting. PHP is designed to parse then execute your script when requested by the client. You don't have your web app always running with PHP. Your code resides in separate script files that more or less match up with each page you want to display. When a script is requested that is when it is run. That is great for getting something up and working quickly, but is very archaic compared to the other web app frameworks. Having the app constantly running on the server means that you can easily maintain state on the server between pages, requests, and even different client sessions. With PHP you have to jump through all sorts of hoops to maintain state between scripts, and client requests. I believe they use cookies that bounce back and forth between the client and server to maintain a session.

A good read is Jon Rentzsch's intro to WebObjects. Read the section half way down called "WebObjects' Design".

http://rentzsch.com/webobjects/introTo5

"Slow vehicle speeds with frequent stops would signal traffic congestion, for instance."

uh... it could also signal that my Mom is at the wheel...
  quote