Monday, June 28, 2004

Why I like PHP / MySQL

How many of you know that Yahoo is running on PHP? They started out with a proprietary CGI (Common Gateway Interface) program, and switched to PHP, I can't remember when they did, but they did switch to PHP. DirectNIC, one of the best domain name registration companies is also running on PHP and their database is very large, and their domain linguatron runs pretty fast. Who does not have a Friendster account? If you do have one, who was not irritated by their service that sometimes testimonials are missing, messages are missing, messages cannot be read, friends are missing and even runs so slow. They were running on JSP before. Now who has noticed the faster running Friendster site today? Have you noticed the filename extensions .php on the URLs today and before it used to be .jsp? What's so nice about PHP and why they like it? Why I like it?

This article is mainly for the web developers out there. But I also know that people that visit my site are also novices in web development so I will keep my language plain and simple, easy enough for my dog to understand.

First of all I want to differentiate Web Design and Web Development. Designing is mainly for aesthetics, so you should be proficient enough in several graphic software's, at least one vector graphics software and one raster graphics software. Development is targeted more on function of a website, thus programming is needed.

And here are the different web developing programming languages commonly used:

O Perl
One of the first server-side programming languages for website development, opensource, code syntax very much like C/C++
Official Website: http://www.perl.org
O ASP
Active Server Pages, now improved to ASP.net which uses the .net technology. Since it is from Microsoft, expect work to be done real fast. Expect this to be the easiest to learn. And expect this to have the most vulnerabilities from hackers, viruses, spyware, malware, etc. And expect it to have regular downloadable patches to it.
Official Website: http://msdn.microsoft.com/asp.net/
O JSP
Java Server Pages, since it is Java, it is made by Sun Microsystems. Not opensource but openstandard. Just the same way HTML is also an open standard, and there are tons of browsers that have to comply with the standard. Which gives rise to problems that browsers do not display 100% the same. The openstadardness of JSP gives the same problems. The JSP engines I am aware of are Resin, Tomcat and JRun. Although they is a majority of code is common among them, I've experienced problems when working on a project for Studios USA / Universal in the past in code syntax in connecting to databases. When it is from Java, it is also known to be secure.
Official Website: http://java.sun.com/products/jsp
O Miva
One of the first server side languages I learned and had several client websites made on Miva before like The Heritage Hotel Manila; Meganomics Specialist International, Inc.; Simon Harrison Design Corporation; CCME Homemade Foodstuff; American Home Appliances (CMTC); Kenstar Travel Corporation; Novelty Entertainment Inc.; Penguin Computing Asia; Linux Consultants Asia Support; Office of Miriam Defensor Santiago; Expocraft Industries, Inc.; Waters Philippines; HatchAsia; P & J Agricultural Trading, Inc. and Philippine Council for NGO Certification. The more I learned, the more I didn't want Miva due to it's limitations compared to it's competitors..
Official Website: http://www.miva.com
O ColdFusion
ColdFusion is one of the best products invented by Allaire Corporation, who also made my favorite HTML editor HomeSite. ColdFusion came with it's own HTML editor and IDE (Integrated Development Environment) where it's IDE look very much like their HomeSite software. It was the top competitor of Macromedia Dreamweaver in terms of market share, so Macromedia bought Allaire Corporation and ColdFusion today is now Macromedia ColdFusion MX.
Official Website: http://www.macromedia.com/software/coldfusion
O PHP
PHP, an opensource server side programming language just like perl, python, tcl, and others. Its growth was relatively fast considering it is opensource, and there is no corporate advertising, marketing and promotion involved. Just word-of-click and a lot of friendly people in the opensource community promoting the language(Just as I am promoting PHP now). I'll tell you more about it later.
Official Website: http://www.php.net
O Others
There are still a lot more languages out there, maybe one is being created right now. But if ever I am going to mention a few that I know, we have TCL and you could learn more about TCL at http://www.tcl.tk and Python, which you could read more about it on http://www.python.org. If you still want to work through the CGI-Bin, Aside from Perl, you could also use Java, C/C++ and even Turbo Pascal!
Now that I have mentioned all of them, why did I choose PHP over the other languages? Here are my reasons:
O Easy to Program
If you are used to Visual Basic, you still might find PHP hard to program with, but if you program in C/C++, here is where you will appreciate the easiness of PHP. No variable declarations needed, just use variables when you need them. No variable type mismatches, just use them how you want to use them, they will act as how they are being used, so integer, float, string, interchange them and you get no errors.
O HTTP Authentication
Making Login and Password scripts for various purposes is always a common task in server side programming. Making a web-based login page is always time-consuming, HTTP Authentication is always easy to work with.
O Works with compressed files
PHP can read the contents of a ZIP file (.zip extension), and it could read and compress in GZIP (.gz extension)and BZIP2 (.bz2 extension) as well. So file compression could be done on-the-fly at real-time.
O Time and Date Functions
PHP can work in Gregorian, Julian, French Republican and Jewish calendars, who knows one day we'll have the Chinese calendar as well? So conversion tools or programming is not required. Time formats can be in GMT or UMT, adjusting the timezones like using EST, MDT. Applying Daylight Savings Time. Date and time functions in PHP as so powerful, there is a pre-defined function for almost any time/date task, so there is no much conversion knowing that there are 60 seconds in a minute, 60 minutes in an hour, etc.
O Connects to any Database on the Planet
PHP supports the following databases: Adabas D, Ingres, Oracle(OCI7 and OCI8), dBase, InterBase, Ovrimos, Empress, FrontBase, PostgreSQL, FilePro(read-only), mSQL, Solid, Hyperwave, Direct MS-SQL, Sybase, IBM DB2, MySQL, Velocis, Informix, ODBC, Unix dbm. Since I listed ODBC above, so MS Access users would have no problems using it with PHP. Aside from that, there is the DBX database abstraction extension allowing you to transparently use any database supported by that extension.
O Able to FTP
PHP can connect to any FTP (File Transfer Protocol) server with its so many FTP functions, connecting, uploading, downloading, navigating, creating directories and even changing file security permissions.
O Able to use other protocols
PHP can also connect to NNTP, IMAP, POP3, SMTP, LDAP OpenSSL, SNMP servers. It can connect to IRC Gateways.
O Integration Options with other Languages
PHP integrates well with Java, Perl, XML, XLST. with specially made functions for integration alone.
O Encryption Algoritms
PHP supports the following encryption algoritms: DES, TripleDES, Blowfish (default), 3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 and GOST in CBC, OFB, CFB and ECB cipher modes.
O On-the-fly functions
Creation of Macromedia Flash, Adobe Acrobat, JPEG/GIF/PNG image files at real-time.
O Instant Search Engine
Using the free mnoGoSearch search engine software, a website search engine could be created with ease.

My PHP Prediction of the future will be having more functions. Today, support for DOM XML, .Net Functions, Lotus Notes Functions are already in experimental stages, and I believe there is more to come. It is opensource and there is always one crazy person who will add more functions to PHP and make it even more powerful. But even if PHP gets more powerful, I do not see it getting easier to use in the near future, maybe sometime but not soon. Since every programmer seems to be busy with their own business going on in their life, they do not seem to have enough time to improve the user-friendliness of PHP in terms of programming in PHP, but are more concerned on what PHP can do. So IDEs similar to ASP's .Net IDE will not come soon and these opensource programmers would rather concentrate on the functions that PHP cannot do. So people concentrated on RAD (Rapid Application Development), they might still stick with Microsoft's ASP. But PHP purist will always have saved classes in their work that they could always re-use so they will have their own version of their RAD.

If you want to learn more about PHP, you might want to check these out:

O PHP Website
O PHP Builder Advanced Tutorial Site
O PHP Hosting on YDS Web Solution. They also offer custom programming in PHP.

2 Comments:

At 9:23 AM, Blogger Andre said...

well I take exception to the "HTTP Authentication" part. I think it's a double edged sword. First the pros: 1) you leave the authentication dirty work to the web server, so you have a lot less to worry about. 2) And because you do, there's less chances of bugs creeping about thru your code (since you don't reinvent stuff).

But for the cons: 1) there's no way to log out of HTTP authentication short of restarting your browser, 2) Basic HTTP authentication is passing your password in the clear (or encoded in base64 format, which is still basically unencrypted) and 3) you'll have to make do with whatever resources your web server allows you to use for storing username/passwords like htpasswd files, or LDAP or IMAP (if there's mod_ldap or mod_imap with Apache).

 
At 4:23 PM, Blogger Benj Arriola said...

Thanks Andre for the insight. With all work I am just one lazy programmer. LOL :D So I use the HTTP-Authentication. I guess the best way to do it, security-wise and speed-wise is just create objects that I could reuse over and over again. That is one good habit I lack right now. I have tons of work on 'commentless' spagetti code. Anyway, thanks again.

 

Post a Comment

<< Home