Programming for the Web

With tools currently appearing, everything let us believe that programming of scripts and applications for the Web will be soon as easy as local programming.
This is permitted by platforms that allow to run these programs designed for the Web, but the actual growing trend, is the possibility to let Web applications running offline too.
To answer several essential questions about programming of the Web and the future which one can foresee, this article confronts the new needs for companies and users with current solutions, and their future developments.

Which language, which formats, which interface, and which framework, before starting an application, a complete choice of technologies has to be made.
An application would be perfect if it can run both on the Web, without anything to install, but moreover if it is frequently used, it should run also offline without the need to be connected to the Net.
Editors of environment try to create the perfect system which will allow all that, which places us in front of a plethora of solutions.
Then which to choose? Perhaps this article and the links which it provides will help to solve the dilemma!

Domains of applications and needs

Web and mobile programming are now the main part of the activity of the programmers henceforth.
The domains of applications are very varied:

Net surfers expect in the Web a space of entertainment and leisure, a space of exchanges, some time even a virtual world. That supposes more advanced sites, simplified, interactive and fast.
Enterprises use the Web to promote their products and activities, but also like tool for their personnel and their customers. That supposes the transposition on Internet of professional software, with connection to databases in particular.
Administrations use the Web to replace the wickets. The majority have moved to the Web 2.0 and they save so a lot of money.

Formats and techniques of the Web

Pages become dynamic

After HTML 4, supplemented by style sheets, one could think that XHTML a more generic version being recognized by all recent browsers, was going to become the standard.
But one realizes that the W3C seems to want on the contrary to continue with the HTML format, with a whole of specifications dedicated to applications, including HTML 5 and various form formats which extend the list of current components.

They integrate JavaScript code which allows an user interaction, and can modify the contents and the appearance of the page.
If one wants to add also an interaction with the server, to retrieve data to display or for updating the page, Ajax will be used, that is still Javascript, but supplemented by the XMLHttpRequest object for exchanges with the server.
Many frameworks are available which offers graphic components to create online applications. They suffer from an extreme slowness. The release of a compiled solution in XAML should solve the problem of the graphic user interface, see below.

Data formats

To store data freely, except in databases, the JSON format supplements well JavaScript which recognizes it natively, while XML, safer, bases of many specialized formats as RSS, is used with Ajax. A comparison of XML and JSON may help to choose between these two formats according to the application in project.

Interfaces of applications

It is now designed in HTML 5 with the generalized use of tags to describe the interface: XUL, XAML, MXML, XForm. Android has also its XML format, and Java too with JavaFX.
With the XAML format and the environment that Microsoft is deploying, the company has taken an option on the future of markup interfaces.
While XUL is not able to provide a complete documentation on a very difficult to implement system, and that after years of existence it has no serious development tool, Microsoft attacks on all fronts with HTML 5 and XAML, universal format usable for data and code. The environments of development for XAML is Visual Studio or the free Express version.

About other formats, XForm is not very popular and specialized in online forms, MXML is confined to Web applications. Difficult to implement, open source tools are promised by the editor, for the future. Glade, the development tool of Linux has also its own markup language.

Ajax is a means of communication with the server, in the purpose of using data from the same site to create dynamic pages, possibly applications and in this case one will use a framework.
The goal of Ajax frameworks is to create the interface of applications with limited resources. They are written purely in Javascript or are supplemented with server-side scripts, to provide processing or to access a database.

Languages of the server

On the server, one uses scripting languages for a simpler programming, as they use few resource and offer a huge library of functions. These programs are embedded in the pages, their displays become part of the page and they access its contents by the Document Object Model. The code is executed on the server before the sending of the HTML page and then it disappears from it.
The main languages are PHP, running on all platforms and provided by all shared Web hostings, ASP under .NET, and JSP in Java. But they have now an alternative with Node.js that use JavaScript on the server (see the JavaScript section).

Web services

They are intended to let computers interoperables on a network. They are actually programs installed on a server and usable by Web pages. They imply a system of data storage and a protocol of communications between the server and the pages.

The MySQL databases are popular because they are free and run on all servers in combination with the PHP language in particular. A simplified and faster version, SQLite offers the means of using the database in a personal file, transferable from a site to another.
Alternatively, one can use XML as data format, it powers some content management systems.

The base of a service is the RPC (Remote Procedure Call). The exchange of documents on the Web is done with the SOAP protocol or REST architecture .
SOAP is a standard XML format. REST makes use of XML or JSON, it is often preferred to SOAP considered to be too heavy and complex.
Yahoo offers a quantity of Web services in the REST architecture, concerning search, traffic, cartography and that uses JSON code.
When a Web service returns a JSON document, that simplifies the programming because the data are then usable directly in Javascript. This is why PostgreSQL added JSON as another type of data.

Mashup is an emergent trend of the Web which consists in combining several Web services to create new applications. The service of cartography of Google is the more often used, it makes it possible to locate on a map, possibly in 3D, any kind of economic activities, in particular hiring of housing.
Google has created a space for users, MyMaps, which allows each one to create maps and to supplement them with texts and images.

See also Building a CMS, how to create its own content management system.