Overtime the internet has evolved and the capabilities have been enhanced and extended from basic HTML for static content to include other programming languages which give the user a more dynamic and interactive experience. When writing web applications there are two types of programming languages that enable the interactive experience. These are client-side scripting languages and server-side programming languages. The client side script enables code to run on the client without posting back data to the server for processing giving the user a more performing experience. The server-side code processes input from the client like storing the data into a database for further processing or reporting.
The two Web applications choices that this report covers are PHP and Asp.net. Both of these have their good points and can be used to write small internet applications or enterprise intranet applications. After analysing the differences ASP.net is a better choice for enterprise intranet applications where PHP is the better choice for internet web applications.
2 Terms of Reference
On February 26 2010 Tony Assadi, Internet Application Development tutor, requested a report on Programming languages used to develop web applications.
This report is due on 22 March 2010.
Read and researched various websites, academic journals, and books containing information on programming languages used to develop web applications
Overtime the internet has evolved and the capabilities have been enhanced and extended from basic HTML for static content to include other programming languages which give the user a more dynamic and interactive experience. These programming languages are being modified all the time to increase usability and to provide a better end user experience.
This paper will discuss two server side Web languages and two client side Web languages.
4.2 Characteristics of web programming languages
There is a diversity of programming languages available for writing web applications and web services that can be used on the internet. Some of these languages are based on languages also used for conventional programming tasks. It is not likely that one particular language will completely dominate the web programming scene, although the suitability and availability may make particular languages more preferable than others. Even though Java is generally available and suitable it is not always the language of choice especially when an alternative is available and similar to the language they currently use. In the case of non-programmers the preference will more likely to be using higher level languages and tools as. This is tolerable because there is no real motive why we must diverge on a particular programming language for the Web any more than we must diverge on a single programming language in any other domain.
However when developing applications for the web the following constraints must be addressed when making a language choice:
The ability to deal with a variety of protocols, programming tasks and formats (e.g. graphics)
Performance (both speed and size)
Protection of intellectual property
The ability to deal with other web tools and languages
VBScript is a client-based scripting language that has been developed by Microsoft also known as Active Scripting Language. A scripting language is a programming language which falls under the class of light weight programming language suitable for web applications. As you can gather from its name, VBScript inherits the features of Microsoft's Visual Basic which is why VBScript is also called Visual Basic Scripting Edition or in other words, you could say that VBScript is a light version of Microsoft's Visual Basic.
Today you are no longer required to install VBScript on your system as every release of Microsoft Windows now comes with VBScript installed by default. Microsoft started to incorporate VBScript in their operating system since the introduction of Microsoft Windows 98.
VBScript was released in 1996 as one of the Microsoft Windows Script Technologies and was aimed at web developers only. Within a couple of years, VBScript and Jscript evolved from version 1 to version 2.0. In the latest version of VBScript, version 5, Microsoft has incorporated many new features including regular expressions, with statements, global functions, classes and much more. Currently, VBScript is managed and maintained by a team at Microsoft called the Microsoft Sustaining Engineering Team. This team is responsible for fixing all bugs and taking care of various security features.
4.5 Comparison between VBScript and Java Script
There are various subtypes in VBScript, which make it a more appealing choice when writing business applications. These include:
Multi-dimensional and resizable Arrays - Java Script allows for adaptable management of arrays but VBscript allows arrays to be resized
There are many more reserved words in VBScript that make it much more capable of developing useful business applications without requiring a lot of work.
4.6 ASP.net - Active Server Pages
ASP.net is a set of web application technologies that can be used to build dynamic websites, web applications and XML web services. ASP.net is built on Microsoft's original web application technology ASP and its underlying code base is the .net framework. Because ASP.net is built on the common language runtime, applications can be built in most common .net-compatible languages such as Visual Basic, C# and J#.
ASP.net can be developed using notepad or any text editor but is recommended to be developed using an integrated development toolset such as Visual Studio or Visual Web Developer.
ASP.net is a relatively easy move from windows desktop application development as the controls function similarly in both. ASP.net adds more functionality to web pages. In 2007 Microsoft released ASP.net Ajax, which is a set of extensions for ASP.net which implements Ajax interactive web functionality.
Hypertext Preprocessor, or PHP is an open-source server-side scripting language that is combined with HTML, either by embedding it within a web document or by using at as a file processed alongside it, on the server side. PHP is well suited to web development and is used to build dynamic websites and e-businesses. PHP has the ability to allow dynamic interaction with a web page, building it up as real-time data is processed such as input from the user, database material and date information. PHP Powers nearly 10 million Web domains and is used by more than 500,000 developers worldwide. Recent surveys indicate that it has just outranked Microsoft's Active Server Pages (ASP) for having the highest amount of server installations on the internet.
PHP was written in the C programming language by Rasmus Lerdorf in 1994 and was designed for monitoring his online resume and personal information. PHP/FI better known as PHP 2.0 was released on June 8, 1995. Lerdorf had combined PHP with his own Form Interpreter. In 1997 programmers, Zeev Suraski and Andi Gutmans rebuilt the core of PHP, releasing the updated version as PHP/FI 2. PHP 3 was the first widely used version and was released in 1998. PHP 4 was later released in May 2000, with the Zend Engine 1.0. PHP 4 included many new features such as improved speed and reliability over PHP 3. In July 2004 PHP 5 was with the updated Zend Engine 2.0. New features of PHP 5 included improved object-oriented programming, embedded SQLite, support for new MySQL features, exception handling using a try catch structure, integrated SOAP support, the Filter library (in PHP 5.1) and better xml tools. PHP6 has been in development since late 2006. Although PHP is most commonly used for server-side generation of web pages, it can also be used to perform command line script.
4.8 Comparison between ASP.net and PHP
Both ASP.net and PHP have different qualities which make them attractive to different developers. The differences are discussed below:
Object oriented - ASP.net programming languages are pure object oriented (supports inheritance, abstract class and function overloading and overriding, private public and protected variables). PHP 5 supports object oriented programming but it's not a pure object oriented language like ASP.net. In ASP.net variables used within the class require declaration but in PHP any value can be assigned to the variable.
Multi-tier Programming -In ASP.net the presentation code can be separated from the business logic code and server code. This is done by holding the code in a code-behind file. This approach can enable a designer or HTML to work on the look and feel while another developer works on the business logic. In PHP the PHP code is located within the HTML and enclosed in server side tags. This code can be held in a different file on the server but is still referenced from within the HTML. This can make it difficult to find PHP code in amongst the HTML code.
Integrated Development Environment - ASP.net has a strongly supported Integrated Development Environment (IDE) called visual studio. This IDE enables programmers to work faster as it offers intellisense and integrated library support. Microsoft has developed plug-in tools for Visual Studio for managing the code development from requirements management to management of test cases. PHP has a number of available IDE's and it is up to the developer to look for the best one.
Reporting with Asp.net - In PHP there is no such tool for web application reports. ASP.net has several options for report writing including Crystal Reports and Reporting Services.
Licensing costs - ASP.net is a proprietary product of Microsoft and therefore requires a licensing cost. In contrast PHP is open source and therefore free of cost without any licensing fees.
Web Server - ASP.net supports Internet Information Server (IIS) and PHP supports Apache, Internet information server.
Support & Documentation -ASP.net developers can refer to MSDN for documentation and support which is a centralized and genuine source. PHP documentation and support is widely available with different implementation, this makes it hard for the developer to identify the best source.
Database Connectivity - PHP is extremely flexible and can connect to various databases, the most commonly used being MySQL which is freely available. ASP mainly uses MS-SQL which is a product of Microsoft and needs to be purchased separately. However there is a free version of MS-SQL which can be used in a small capacity.
Speed - PHP code runs faster than ASP.net. ASP.net is built on COM based architecture, which is an overhead for the server whereas PHP code actually runs in its own memory space.
Base Language - PHP is based on the C++ language and the syntax used in PHP is quite similar. Alternatively ASP.net is built on the common language runtime and supports multiple programming languages with the most common being Visual Basic and C#.
5 Conclusions and Recommendations
5.2 ASP.net and PHP
Both languages have their advantages specific to developers. If you are developing enterprise applications for an Intranet then ASP.net is the better language to choose. In this scenario, the development tools, and ability to reuse business logic components with other non web applications coupled with the accountable support available for ASP.net makes it a better choice. While ASP.net programs are currently only able to be hosted on windows servers in an Intranet environment, this is less likely to be an issue.
If you are developing simple web applications for the internet where speed of delivery is more important than nicely structured code then PHP is the better choice. Another important consideration in this scenario is the cheaper cost of hosting PHP applications and the ability to take advantage of the open source community.