Looking back, PHP is actually a framework.

Source: Internet
Author: User
Tags drupal mediawiki
(Original question: Lastwechecked, PHPisaframework. ByAkashMehta. June8th, 2008) Whenitcomestowebprogramminglanguages, forbidden. Comparisonswithalternativessucha

(Original question: Last we checked, PHP is a framework. by Akash Mehta. june 8th, 2008) When it comes to web programming languages, PHP probably holds the record for copping criticism from the community at large. comparisons with alternatives such

(Original question: "Last we checked, PHP is a framework". By Akash Mehta. June 8th, 2008)



When it comes to web programming languages, PHP probably holds the record for copping criticism from the community at large. comparisons with alternatives such as Ruby on Rails and Python/Django are common; defenders of PHP are quick to criticise the comparison of a language and a framework. but at the end of the day, developers work with Ruby on Rails, and with Python/Django, and with PHP. just PHP. for most of the PHP applications out there, the language is just perfect, because PHP, to an extent, IsThe framework.


When talking about web programming languages, PHP may be the language most criticized by the community. It is often compared with other similar languages such as Ruby on Rails and Python/Django. PHP defenders often criticize these comparisons of languages and frameworks. But at the end, developers who use Ruby on Rails, Python/Django, and PHP will all use PHP. For most existing PHP applications, the language is really good, because PHP is a framework to some extent.

PHP is designed for the web. you cocould plug vanilla Ruby or Python into a web server and get up and running pretty quickly. but, at least at a basic level, you 'd want a framework to deal with common issues of web development. in PHP, you just get started. PHP and Apache work out request data, output handling and more, right out of the box. (PHP also masters deployment .) david Heinemeier Hanson, the creator of the Ruby on Rails framework, callthis the immediacy of PHP.


PHP is designed for the web. Users can also put Pure Ruby and Python applications on web servers and run well. However, at least at the basic level, users still want to use the Framework to handle the problems that usually occur in web development. When using PHP, you just need to do it. PHP and Apache process the required data and output internally. David Heinemeier Hanson, creator of the Ruby on Rails framework, described it as the directness of PHP.


Now, consider the "average" PHP frameworks. they help you handle request data, manage your output, control app flow-essential, extending PHP's inbuilt functionality. they are, therefore, PHP frameworks on the PHP framework. PHP provides a vast array (pardon the pun) of functionality out of the box. but when you want to do things your way, it gets out of the way, and this is really important when building anything beyond a simple database frontend.


Now, let's analyze the "common" PHP framework. The framework can be used to process the required data, manage the output, and control the application process. Basically, it extends the built-in functions of PHP. Therefore, we can also say that they are only based on the PHP framework. PHP provides helper functions, but it is not enough if you want to act in your own way, but sometimes, the latter is very important when you want to do something more complex than simply extracting data on a web page.

How many PHP applications in wide distribution are built on a third-party framework? MediaWiki? No framework here. Wordpress? Not here either. Drupal? You get the idea. each of these applications have their own framework, inasfar that the developers built a structure for their code that suited what they were trying to create. these three, and the countless others, clearly did something right-MediaWiki even powers one of the world's top 10 websites. and when building these "frameworks", PHP helped them along the way.


How many widely distributed PHP applications are built on third-party public frameworks? MediaWiki? These frameworks are useless. Wordpress? These frameworks are useless. What about Drupal? Here, you should understand. Each application here has its own framework, where developers create a proper structure for their applications. These three applications are exactly the same as countless other applications-MediaWiki has even become one of the top 10 websites in the world. When building these "frameworks", PHP naturally does its own thing.


Sure, Cake, Symfony, CI-they all help you build PHP applications. but unlike a Ruby framework or a Python framework, coding is perfectly tolerable without them. of course, most developers tend to create their own framework as they go along-I call this PHP'sDIY frameworkMentality, where you build the last level in your stack, and by extension you know exactly what's going on under the hood.


That's right, Cake, Symfony, CI (Codelgniter) -- can help you develop PHP applications. But unlike the Ruby or Python frameworks, even if these PHP frameworks are not used, the program can be well written. Of course, many developers tend to create their own frameworks-self-built frameworks I call PHP in spirit, where they can be developed based on their own needs, and expand the most clear internal system functions.


This comes back to the oft-cited "best tool for the job" argument-but by being a "half framework" of sorts, PHP simply helps you within a web context. i'm sure Rails is great for countless applications; Ruby syntax helps a little too. but beyond the basics, the language becomes increasingly irrelevant, and a framework will force you to build your app according to design decisions made by the original developers. on the other hand, PHP allows you to quickly put together your application the way you want, helping you with the web-based aspect, and without having to break the language/framework to achieve your goals. essentially,PHP is the web layer without the framework baggage.


Twitter recently had some downtime that cocould be attributed to its use of Ruby on Rails. now, there's nothing wrong with Ruby, or Rails. but Twitter is a messaging system, RoR is an application framework. cocould Rails be worked around to suit Twitter? Maybe. cocould Twitter have avoided these problems if they 'd used PHP? Probably. twitter's developers have noted they weren't quite expecting the site to be so succesful. if they had built it in PHP, they wowould probably have encountered other (similar) problems earlier on, rewritten the entire app while it was still feasible, and built a powerful system that cocould scale just fine (likely with the messaging platform in C ). using PHP cocould have helped, not as a language with syntax and libraries as such, but as a web development platform that gives developers the freedom to define ect their systems as they want. (They cocould also have tried Erlang .)


So the next time you're on the lookout for a PHP framework to build your killer app on, consider using the best framework of them all: PHP. it will give you the freedom to achieve what you want, how you want, with results. A quick hack? Check the manual, it cocould be a one-liner. A massive distributed messaging platform? Full steam ahead, build it your way. For everything in between, there's a multitude of options, but if you have the time, PHP is all the framework you need.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.