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?

    Dont forget to add that PHP is completely "OPEN SOURCE" and FREE! Unlike the Microsuck alternatives.

    My 1/2 cent.

    John

      I'm interested in how you ran your tests and what you used to act as a benchmark. Did you make sure that the COM is as true to the PHP script you wrote as possible? An older COM always has fat, hell, older scripts in any language are always clunky when viewed a few weeks later when you are all the wiser to whats going on. I use PHP for all my private business work and ASP at my 9 to 5 job, and I haven't met such disparities such as what you mention. I do know that PHP talks directly to the database and ADO may either talk directly to the database (through OLE DšŸ˜Ž or via ODBC. Anyways, contact me off line if you will so I can run the same tests here, perhaps to at least get them to let me load up PHP for testing.

      As for the .NET, I don't know, I would love to have the ability to use PHP at work so I wouldn't have to go through this every few years, but I can only recommend. I will remain with ASP 3.0 there and PHP 4.0.6 here and hope that someday someone will see the light.

      Jim

        5 months later

        I'm just plain interested. I'm still a student and I took a huge interest in Java, OOP/OOD for the purpose of dynamic web development, company intranets. Then a student teacher of mine(Data Structures and Algorithms using Java)suggested if I want to go somewhere with programming to also know C++ which is fine and dandy I've been tinkering with C++ Builder 5. But then I started to research php/apache and mysql for web. Anyways I do have a question here and that is are there any huge diadvantages with php over say servlets or jsp?

          Write a Reply...