.NET versus PHP versus Java
In case you need to decide which technology to use for webapplications, there are a number of considerations. Roughly, while I write this in 2005, Microsoft .NET, Java (J2EE) and PHP are the main choices. All of these technologies generate (X)HTML.
I have worked with these 3 technologies. At the moment only .NET and PHP have "survived" my considerations. Some some of the considerations are:
- Cross-platform: Java and PHP are available on all major platforms. .NET only on Windows. At the moment there is a project in progress to make .NET available on Linux
- Portability: Java and .NET can be used for office and webapplications. PHP only on the web. But, it is possible to run Java code from within PHP. If reusing code of office applications on the web is required, PHP is no option (unless you want to rewrite functionality or use Java integration. However, Java integration requires the Java JRE to be installed on the webserver)
- Hosting availability: Depending on platform. When the webserver is a Windows server, it doesn't mean the .NET framework is installed. In general, it is difficult to find a ISP who can host .NET applications. Also, not all ISP's have a webserver plugin for Java servlets installed, meaning that Java servlets are equally difficult to host as .NET. In most cases, PHP is available without extra costs.
- Hosting prices: PHP hosting under Linux is usually cheaper (and more available) then Windows hosting. Also, for the usage of MS SQL Server on Windows hosting, one usually pays additional fees. Linux ISP's at the contrary usually include MySql database usage standard without extra charges. Database usage enlarges the financial gap between Windows and Linux.
- Database connectivity: Java and PHP work the best with a MySql database. .NET usually works with MS Access or MS SQL Server. There is a .NET connector for MySql, but using Microsoft databases gives the minimum of issues to solve (in webservices).
- Performance: Java servlets are very fast, but I was not impressed by the stability of database access (in 2002). PHP has a very stable and fast database connectivity, the general performance of PHP is also quite fast. .NET promises good performance, but is only fast after the first request. Starting the - compiled - application on the webserver takes quite some time and server workload.
- Code: Java servlets are compiled classes. JSP (Java Server Pages) pages are compiled just-in-time. PHP is an interpreted script language. .NET is a compiled application. Java servlet and .NET code can be decompiled. PHP and JSP script code is embedded in the page. Zend (www.zend.com) delivers a package to protect PHP code. However, to run this, the webserver must have a extension installed (which can be a problem if the ISP doesn't cooperate).
- Security: .NET has a good security mechanism in the .NET framework. This saves a lot of programming. In other languages, security is a concept which needs thorough attention and programming.
- Webservices: .NET has good features for building webservices. Java needs a toolkit to accomplish that. In PHP webservices requires the highest investement of programming, while it is not really stable yet.
- Mobile applications: .NET has anticipated on mobile applications. Meaning that the generated code automatically adapts to the requesting client and in this way adapts for normal webbrowsers or mobile devices. However, this only works if you use the standard components. In other languages, it needs more programming.
- IDE: All languages can be programmed in a text editor. However, it needs a substantial financial investment to have a good IDE for .NET and in that way have a efficient productivity. For Java and PHP are a number of open source IDE's available. In order to have a productive IDE, it needs some investment. Example: Approx. $ 250.00 for PHP (Zend Studio Professional, www.zend.com). These investments quite are cheap in comparison to .NET.