Adapted from Science Adventures
http://sciventures.theroguenews.com/PHP_Dead.html
PHP is old and clunky. It's like that old hag that lives next door -- you know she's wrong, boring, and agitating, utterly useless, but she won't just die. PHP stands for Hypertext Preprocessing. When it first emerged, it was one of the first server-side scripts to be embedded in HTML (hypertext markup language). However, because it is interpreted line-by-line, it’s slow. It also is not very object oriented. While other technologies are constantly being developed and improved at light speed (also compiled to run that fast), PHP has lingered behind, and no longer suits the general needs of the web. It’s time for PHP to die.
First, before we continue, let’s discuss a few of the terms. HTML is the common language of the web. It uses tags to display elements, and the tags define whether the element is merely text, a hyperlink, or an image. HTML is a client-side language, meaning is rendered by the web browser. PHP is a server-side script. It is interpreted (read line-by-line) by the server, and rendered as HTML before being returned to the browser. The browser nor the end user never sees the PHP code; just the HTML. Therefore, it may seem that PHP is necessary for dynamic web content. It is not, and the alternatives far surpass it.
For the remainder of this article, I will discuss some of the more prominent advantages ASP.NET MVC and RoR have to PHP.
REST stands for RepresentationalState Transfer. This is a unique routing system to access certain functions and methods. It drops using URIs as URLs and opts instead to translate routing to specific functions. For example, the first level would be a controller, and the second level would be a function. The third functional would be an ID, often the ID (primary key) used to identify the item in a database.
Controller
Function
ID (as int, but it could also be a string, Boolean, etc.)
Additional parameters
http://localhost:53129/Movies/Details/23?clearData=YES&sendEmail=NO
This is uniquely better because it beats PHP’s routing $_GET function because it makes more intuitive URIs.
Don’t Repeat Yourself
This is another principal that drives RoR and ASP.NET MVC is that it ensures that by loosely coupling data, one can only change a property in one place and all functions and objects inherit the values defined once in the appropriate place. For example, if one wanted to add validation, I could simply define the parameters of an object in the model (data) part of the application. Using smooth client-side JS validation, ASP.NET will not allow the form to even be submitted without using appropriate values. If the end-user as Javascript disabled, in the controller function, one can simply check with the logic gate:
if(ModelState.IsValid)
, which returns a boolean. All validation is conducted through the model properties. This means no change is needed to the view or the controller. It also allows client-side validation to be effortless.
If one wanted to delete a method, in PHP, one would need to call it via URI or some advanced function. With the controller, one can simply call methods via a HTTP-POST signature. This maintains that GET is 100% secure, mitigating hackers.
To get started learning an MVC-architectural web platform, simply head over to http://asp.net/mvc or http://rubyonrails.org
Good luck!
http://sciventures.theroguenews.com/PHP_Dead.html
PHP is old and clunky. It's like that old hag that lives next door -- you know she's wrong, boring, and agitating, utterly useless, but she won't just die. PHP stands for Hypertext Preprocessing. When it first emerged, it was one of the first server-side scripts to be embedded in HTML (hypertext markup language). However, because it is interpreted line-by-line, it’s slow. It also is not very object oriented. While other technologies are constantly being developed and improved at light speed (also compiled to run that fast), PHP has lingered behind, and no longer suits the general needs of the web. It’s time for PHP to die.
First, before we continue, let’s discuss a few of the terms. HTML is the common language of the web. It uses tags to display elements, and the tags define whether the element is merely text, a hyperlink, or an image. HTML is a client-side language, meaning is rendered by the web browser. PHP is a server-side script. It is interpreted (read line-by-line) by the server, and rendered as HTML before being returned to the browser. The browser nor the end user never sees the PHP code; just the HTML. Therefore, it may seem that PHP is necessary for dynamic web content. It is not, and the alternatives far surpass it.
For the remainder of this article, I will discuss some of the more prominent advantages ASP.NET MVC and RoR have to PHP.
REST
REST stands for RepresentationalState Transfer. This is a unique routing system to access certain functions and methods. It drops using URIs as URLs and opts instead to translate routing to specific functions. For example, the first level would be a controller, and the second level would be a function. The third functional would be an ID, often the ID (primary key) used to identify the item in a database.
Example
Controller
Function
ID (as int, but it could also be a string, Boolean, etc.)
Additional parameters
http://localhost:53129/Movies/Details/23?clearData=YES&sendEmail=NO
This is uniquely better because it beats PHP’s routing $_GET function because it makes more intuitive URIs.
DRY
Don’t Repeat Yourself
This is another principal that drives RoR and ASP.NET MVC is that it ensures that by loosely coupling data, one can only change a property in one place and all functions and objects inherit the values defined once in the appropriate place. For example, if one wanted to add validation, I could simply define the parameters of an object in the model (data) part of the application. Using smooth client-side JS validation, ASP.NET will not allow the form to even be submitted without using appropriate values. If the end-user as Javascript disabled, in the controller function, one can simply check with the logic gate:
if(ModelState.IsValid)
, which returns a boolean. All validation is conducted through the model properties. This means no change is needed to the view or the controller. It also allows client-side validation to be effortless.
MISC
If one wanted to delete a method, in PHP, one would need to call it via URI or some advanced function. With the controller, one can simply call methods via a HTTP-POST signature. This maintains that GET is 100% secure, mitigating hackers.
Where to start
To get started learning an MVC-architectural web platform, simply head over to http://asp.net/mvc or http://rubyonrails.org
Good luck!
No comments:
Post a Comment
This blog is meant to educate and inspire greater development and learning. Please do not post any derogatory comments that may risk harming the ethos of this blog.