Hi Guys, I am expecting more comments from you (as a reader, as a PHP developer, or any other technology person). I have listed few misconceptions about PHP which I am aware of, you guys can add in more comments to this. I saw in many blogs, programmers are getting into arguement pointing out their technology is the best and other technologies are bad,which should not happen. If you know something which can’t be handled using PHP or which is handled properly in PHP, please post as a comment, we will discuss futher over that.
1. PHP is slow, since it is not a compiled language
PHP became a compiled language in the year 2000, when PHP 4 was released for the first time. Until version 3, PHP source code was parsed and executed right away by the PHP interpreter.
PHP 4 introduced the Zend engine. This engine splits the processing of PHP code into several phases. The first phase parses PHP source code and generates a binary representation of the PHP code known as Zend opcodes. Opcodes are sets of instructions similar to Java bytecodes. These opcodes are stored in memory. The second phase of Zend engine processing consists in executing the generated opcodes.
The Zend engine was built in such way that right after the first phase, the opcodes may be stored in the server shared memory space. This is done by special PHP extensions known as opcode caching extensions. There are several PHP caching extensions also known as PHP accelerator extensions.
Solution: Install a PHP accelerator which will skip the initial compilation step if a PHP script was previously compiled and stored in shared memory.
2. PHP is a Weakly typed language. Leads to more bugs and bad code.
Ya I do accept this. PHP has given this option for the ease of learning. But most of the times it leads to bad code.
Solution: As a Good PHP developer, while working in development environment just make error_reporting=E_ALL
E_ALL includes E_STRICT also, it will provide us run-time notices, suggest changes to your code which will ensure the best interoperability
3. PHP won’t support ORM
Many open source ORM’s are available for PHP and which are best too.
These ORM’s are inbuilt inside most of the MVC frameworks like Symfony, Zend, CakePHP, etc
Use a proper ORM in your projects, it will reduce lot of complexity related to DB.
4. PHP always mingle with MySQL
Its not, since PHP & MySQL are open source technologies, most of the users are going for this combination
PHP supports various DBs (dBase, DB++, FrontBase, filePro, Firebird/InterBase, Informix, IBM DB2, Ingres, MaxDB, Mongo, mSQL, Mssql, MySQL, Mysqli, Mysqlnd, Oracle OCI8, Ovrimos SQL, Paradox, PostgreSQL, SQLite, SQLite3, Sybase, tokyo_ tyrant)
5. The mixture of PHP code with HTML markup tends to make code difficult to read
Ya its absolutely true. It again depends on developers. PHP allows you to write structured code as well as OOPS like C++. So its our responsibility to choose the best.
Use a good MVC framework for your project which reduces developer’s burden as well. It reduces the cycle and recoding. Many MVC frameworks are available like Symfony, Zend, CakePHP, CodeIgnitor. Get a best framework which satisfy your purpose (http://www.phpframeworks.com/). Initially it will be difficult to move to MVC, but once you started it, you won’t move back to your traditional (structured) way of coding.
6. PHP won’t support Webservices
PHP gives full support to webservices. It has inbuilt support for webservices like SOAP, XML-RPC, OAuth, SCA.
7. PHP codes are not unit tested by developers
Ya, this is also true most of time but not always. Its because of developer and client. Most of the clients expect fast delivery, speed development while using PHP. So developers are not getting time to unit test, this is the major reason according to me. But PHP supports Unit test through PHPUnit.
8. Not matured applications are developed using PHP
Hmmmmm…. If we see in general, most of the companies are giving a second thought to jump into PHP for bigger applications. But PHP powers some of the most popular Web sites in the world, such as Yahoo!, Lufthansa, Wikipedia and Disney Online. Facebook is currently the busiest site in the world that is developed mostly in PHP.