Saturday, May 15, 2010

Simplicity Drives the Net's Most Popular Framework

Do you know which framework is dominant on the web? Have a look at this chart to see which frameworks are hot, and which are not.



You can check the current stats whenever you want here:

I was somewhat surprised to read those statistics. I would've thought some of the less popular frameworks would've done better, and I would've thought some of the most popular wouldn't be doing so well. I started thinking about why PHP is doing so well, and I've drawn the conclusion that it's the amazing simplicity. (To be sure, the made-for-the-web functionality has a large part to do with it, but other frameworks offer that, too.) Here are a few of the things I think make PHP easy to use:

- No compiles or compiled artifacts to shuffle around
- No complicated configurations to master, no lengthy XML files to edit
- As simple and procedural as you want it to be
- Plenty of power, if you need it. If you don't, only blissful simplicity
- Easy language syntax. To me, it reads something like plain old C.
- Everything's in one place -- You can just mix Server-side scripting right there with your HTML pages (Wow, that flies right in the face of the justification for JSPs and ASPs, doesn't it?)
- Fantastic iterative cycle-- you make a directory and edit scripts with GEdit/Notepad/Vim/etc, then check it in the browser. Nothing could be simpler!

Here's an example:

<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>


What could be more simple than that?

If you haven't tried PHP, I'd urge you to do it. It really can be fun.

How do you get started?

1) Get a web server that's PHP enabled. (You can search the web for any of the pre-packaged stacks. I use the excellent EnterpriseDB PostGres/Apache/PHP stack found here)

2) Find the web root for your web server. For my Apache installation, it's called 'www'. Put a new directory under that one, and add a simple PHP script to that directory. (Maybe the hello world above. Put it in a file called 'Hello.php' or something like that.)

3) Point your browser to http://localhost://Hello.php Maybe something like http://localhost:8080/HelloExperiment/Hello.php

4) Edit the file to add more PHP and watch the results change in your browser as you refresh. That's it!

The web is full of great sites on PHP, including the excellent www.php.net. Read/Edit/Watch the change!

I love this simplicity, don't you? That's something we could all use more of.

Happy Coding!

7 comments:

Anonymous said...

PHP is not a framework it is a programming/scripting language. http://en.wikipedia.org/wiki/PHP

Rick said...

Thanks for checking in. Note that it's BuiltWith that is calling PHP a framework, though. I can see it both ways.

Thanks,

Rick

Andrea said...

PHP is certainly not a framework. But it is indeed the most popular client-side language on the web: Usage of server-side programming languages for websites

workmad3 said...

I wonder what the percentages would look like if the definition of 'framework' was brought in line with the rest of the world, and PHP was split into Zend, CakePHP, PHP on Trax, etc. (and the same for the thousands of java web frameworks) :)

Crias said...

@RIck - You can see it both ways? Really?

Visit www.php.net - "PHP is a widely-used general-purpose scripting language"

J2EE - the Java Platform, Enterprise Edition. Frameworks for it would include things such as Spring MVC, Struts, etc.

Besides the complete misuse of the term "framework", the screenshot actually explicitly says that many sites may report "PHP" even when they don't use it. WTF?!?!

Credibility fail.

Anonymous said...

It seems your are arguing based on a faulty statistic.

LearnPHP said...

To learn php,html,javascript,ajax,mysql,jquery with advanced concepts, you can visit http://advancedphptutorial.blogspot.com