Why Choose PHP?

Posted by: Sean

Tagged in: Programming , PHP , Coding

Sean

Wow it has been a fair bit since my last blog post on Adrian's wonderful site.PHP Post Image (Sorry about that everyone. Adrian and I have been very very busy as of late.)  But today I would like to cover why use PHP instead of other scripting languages.  Because its the Best and every other language sucks! Of course I am just kidding! But on a serious note, why should you choose PHP over Perl, Ruby on Rails or ASP? 

Simplicity and ease of coding. PHP for all its power is a fairly simple scripting language.  It's basics can be learned in one weekend with a text viewer and a server.  A simple cross platform server is brought to us by Apache Friends called  XAMPP.  It contains PHP, Apache, MySQL and many other useful plugins which allow you to run a server in any environment.  

Programing in PHP is very simple, the code blocks must be encased within tags.  This allows the web serve to identify a PHP code block and run the PHP compiler on the fly. 

Unlike many programming languages PHP code does not need to be compiled it is compiled at run time by the web server, generally Apache.

To display text all you use the echo tag and put your text within quotes.  See example below:

echo "Hello World";

This will display in a web browser as Hello World when run by the web server.

Another very cool ability of PHP is its ability to hold any data in variables which can be declared at any time.  While very useful this is also very dangerous so proper coding structure is recommended. (Dont want to cause an infinite loop!)

$variable = "Hello World";
echo $variable;
$variable = 2;
echo $variable;

This will display "Hello World2" in your browser when run.

There are many more bonuses to PHP programming, it can access command line and MySQL through built in support.  It can even integrate into MSSQL!

 Community

PHP has one of the largest online communities, this is mainly due to its ease of use and being open source.  PHP is covered under the GNU license.  The PHP website itself contains all the resources and documentation required for programming with PHP.  Unlike Microsoft its easy to follow and understand!  It is used in Joomla!, Wordpress, phpBB and many other community building applications.  

 Summary

Well this is all based on my personal beliefs and some facts.  PHP is a powerful tool for web developers.  It can be used to make scalable applications to preform any task. 

I will be posting coding examples down the road which hopefully others will find helpful!  If you would like me to cover a problem or a solution please email me and I will do my best to help!   Also please email me questions about HTML, CSS or Javascript and I will be happy to cover them as well.

 

 

About the Author

Sean Habing is a web developer, project manager and general IT geek (B. Sc. Comp Sci, A+ Certified, Business Analyst Certificate). Sean currently works as a Client Support Analyst for a Canadian software company. He also runs his own company Oncall Software. It is his goal to inform people about technology while providing industry insight into common issues and problems. He also likes muscle cars. 

 

RSS Subscribe to our RSS Feed!       Twitter Follow Sean on Twitter!

Trackback(0)
Comments (8)add comment

Adrian said:

Adrian
;)
Great post Sean! Someone had to update this site eh?

I will write a new post soon as well! Maybe finish off that free Wordpress theme.
 
June 02, 2009 | url
Votes: +2

Robert said:

0
:)
Nice article! I completely agree with you, PHP is one of the best programming languages and one of the easiest to learn, for me it took 3 months from 0 to a complete CMS (of course, I've had past experience with C++)
 
June 02, 2009 | url
Votes: +1

Murray said:

0
Good to see you back.
Great to see you back, been wondering when a new post was gonna happen smilies/smiley.gif

Good timing as well, I happen to be using a lot more PHP lately.

I'd love to see those tutorials be about things such as querying and CMS(ing?).

Peace
 
June 02, 2009 | url
Votes: +1

PaulHenri said:

0
Tutorial ?
Good to see a new article but unfortunately it's still one article in one month smilies/sad.gif

Keep writting articles for BFB, could be a reference smilies/sad.gif
 
June 22, 2009
Votes: +0

NickG said:

0
Biased?
Obviously everyone is entitled to their opinion, but come on. ASP.Net has been proven to be many times faster than PHP-- even when PHP is using Zend. I've got nothing agains MySQL-- I use it almost as much as MS SQL, but let's be honest... PHP is a slow mess that compares more with classic ASP is form and speed.
 
June 28, 2009
Votes: +0

Sean said:

Sean
...
in my experience with a few minor tweaks to PHP and Apache it can handle a significantly higher load on less hardware then IIS and ASP. I am not saying ASP is evil or the wrong solution, it also has many benefits which PHP cannot match. I work in a .NET shop so I don't think I am biased smilies/wink.gif
 
July 14, 2009
Votes: +1

Gil said:

0
You can't compare PHP to Perl
You can't compare PHP to Perl or say one is better then another because these two are used for different purpose and are completely different scale languages. Perl uses mostly regular expressions and that is the reason it is quite difficult to learn. In PHP you only use Regs when you need to verify a string such as email address. In perl you can create much more scalable applications then in PHP. In PHP you basically can return mixed values or anything from a function (string, bool, int) and in Perl, C++, JAVA for that matter you only return what you described when started the function. And last but not least perl is not a scripting language.
 
July 23, 2009 | url
Votes: +0

Sean said:

Sean
@Gil
Thank you for your comment. I am very pleased that my post has gotten such a wide variety of responses!

To reply to your PHP comments smilies/smiley.gif

PHP is very scalable it can be used to run enterprise grade applications. Scalability comes down to programming and design more then the programming language itself.

PHP also makes use of regular expressions through function calls and use as a Boolean operator.

PHP allows for mixed values yes. I believe this is a positive feature and not a negative. It does mean its less strict then other traditional languages which you have mentioned. However again this comes down to programming practices and not the language itself. While not specifically specifying that $foobar is an int you can just go and say $intfoobar.

Hope that helps smilies/smiley.gif
 
July 23, 2009
Votes: -1

Write comment

busy