This is the first of a series of posts about PHP, including some history and the basics.
It is expected that you know a little bit of HTML and programming syntax.
My name is Thiago, and I and a second year IT student in SAIT, in Calgary – Canada.I think most of you might have wondered why all web pages are HTML but does not carry the html (or htm) extension. Some of them are .asp, others are .php, and as I learned on third semester of my Software Development College, some are .jsp.
These are all extensions of files that produces an html page, but customized for each user. For all the cases I mentioned above, this process happens on the server, making it easier to be accessed no matter what unit is on the front end.
So why should I worry about it? Users with a weaker machine are used to wait, right? Wrong.
Wrong, by the way, for more reasons that I can think of. I’ll start talking about the competition. No one likes to wait 10 minutes to purchase something IRL, so why would it be different online? If your website is still being processed while another is faster, guess which tab is going to be closed?
Then we have this huge variety of devices accessing the internet. Desktops and laptops computers, tablets, phones, video games, watches, cameras, cars, etc… There is no way all of them will have enough processing power to do all the work in your website. Nor do the network, depending on how many lines your code has.
Not to mention security. If most of the secure data traffic is on the server, we have less to worry. The only thing that needs to leave the server is the final html text file, that can be encrypted between the web server and the user.
Ok… now that I explained why use the back end processing, why chose PHP over all other ones?
There is no absolute better one in here, only a better option for each scenario. I’ll briefly explain all of them:
- JSP: Also known as Java Server Pages, it uses the Java API. Developed by Sun and currently owned by Oracle.
- Pros: Easier to use for Java programmers. Really Object Oriented (with its own classes)
- Cons: Needs a JVM on the server, which makes it slower than the other options
- ASP: Stands for Active Server Pages, usually called ASP.NET. Developed and owned by Microsoft.
- Pros: Works with Microsoft languages (C# and VB.NET), better security
- Cons: Higher licensing and startup costs
- PHP: Originally called Personal Home Page, now holds an recursive acronym of PHP Hypertext Processor. Open source.
- Pros: Fast to run, easy and small installation, huge community
- Cons: Limited library, no classes for Objects
For us, developers, the best option will always be the one we feel better using and the one our jobs require us to use.
My program in SAIT focus on Java as a main programming language. Yet, I decided to learn PHP and I will share with you the reasons why.
I will start with curiosity. A few years ago I met a guy who loved PHP and he is very active in it’s community. I have this imprinted in my mind that it must be so good that I have to learn it!
I also saw a lot of job opportunities asking for PHP, along with ASP.NET, which is also very popular. I could include that this is another downfall for JSP, since I couldn’t find positions here in my region.
Here is a list of big companies/websites that uses PHP:
And last but not least, I want to learn it by myself. Researching, playing with, and even inserting it on my Raspberry Pi server. It is part of an assignment for this last semester, but also is something I enjoy doing. I will soon have to do a couple of presentations about this topic, and I am excited about it!
Well… that’s it for today’s post. I’ll soon talk about the syntax, and go through the basics the coding, but also on how to install PHP on your server (virtual or web).
Thank you very much and I hope to see you soon.