I am into PHP in a big way lately after having discovered it recently. Up to now I've been a ASP/VB/COM/COM+ guy. In other words a die hard Microsoft'er.
I'm now having some deep philosophical problems with Microsoft's new .NET strategy and have been researching what technology would be best for the applications I'm developing. I love the concept of natively compiled components in COM but there is a very high overhead for using them. I developed a script in PHP recently as a test to run against one of my VB components called from ASP. I made sure the DLL was loaded into memory prior to execution so I wouldn't have to factor in the significant load time of the VB Runtime and MTS container.
Results: PHP blew the components doors off. I perform a significant number calculations and open and update a few MSSQL recordsets in the script(PHP) or component(V. The VB Component takes about 12-13 seconds to post the form (including sever SQL statements being executed to MSSQL). PHP performed the same tasks in less than 1 second. I think there is some major performance loss in the COM components in connecting to the database or something - not sure yet. Perhaps there is a major price paid by using ADO as it adds another abstract layer over OLEDB. Still, we're talking a young scripting language(PHP) versus natively compiled language(V
and optimized components(ADO) developed for high-speed data access by Microsoft.
Anyway, I was so impressed that I began to really dig in. That's when I found the Zend engine that allows me encode my code so I can actually sell it and keep it confidential. Another big breakthrough for scripting in my opinion and one of the primary reasons I was using components to start with (other than their ability to pool database connections).
I have looked, am I'm still looking, at JAVA but (maybe I'm missing something here and could use your help). JAVA just doesn't seem to hold any advantages that I can see for Web development over a language like PHP. I can see Java being used for cross platform standalone compiled applications but I can't see it being very effective in web development. It also has a much longer development and debug cycle and is particular to various web servers. Although JAVA is supposed to be platform independent I find that it is actually very particular to specific web server implementations and comes with a barrel of quirks per server).
The problem I have with .NET is that, to me, it is just Java done Microsoft style and it is still limited to just the Microsoft platform for the foreseeable future. I just can't see how they can convince developers to learn an entirely new way of programming when they are still limiting us to just the Microsoft platform. If I could use C# everywhere like PHP then I wouldn't bat an eye, I'd be there yesterday. Therefore, what are they really adding other than just more change (something I can find enough without their help). I think that if I'm going to spend a hefty amount of time learning a JAVA-simulator like .NET, move away from my VB comfort zone, why not just focus on pure JAVA? Yes, I know, Microsoft is offering a VB.NET but have you looked at it? It's not VB anymore and they're telling everyone that they really want people to migrate to C# anyway so you know you'll be a second class citizen to Microsoft if you don't make the move to C# from VB6.
And all of this .NET effort for what? So I can use SOAP and XML to pass data? I can do that now without migrating. I'm not sure I will want to do that anyway in many instances. There is a high overhead to pay for using SOAP and XML. Don't get me wrong, the concept is good but its going to kill any transaction throughput parsing every request as XML. What do you people think, am I being narrow minded or am I missing something that is obvious to everyone but me?
For years I have been told and told about the benefits of natively compiled languages (COM/COM+ components) and after all these years I finally put it to the test only to find PHP, faster, easier to work with (no compiling every few minutes for simple go/no-go tests I want to run), it can be encrypted for commercial code release, and, low and behold, I copy it from my Linux box to my NT server and it runs without modification.
So why hasn't the whole world moved to PHP for web apps? And why does this all give me a bloody headache?
I'm curious what you opinion is about comparing COM components, JavaBeans and PHP?