Home > Projects/Reports > Pros and Cons of Different Scripting Languages

Pros and Cons of Different Scripting Languages

Introduction

Not so long ago, the Internet was mostly the province of academics and programmers, and the World Wide Web was a vague idea in the minds of a few researchers. Today both are witnessing unprecedented interest and explosive growth. Web pages are produced at an amazing rate. The fundamental challenge of designing Web pages is that while producing a Web page is simple, creating an enticing and exciting one is more challenging.

HTML, the markup language that defines a page’s appearance, is easy to learn and does not require programming history. To order to meet the increasing needs of Web page writers, HTML has undergone many revisions. What can be done within HTML, however, is restricted. The Java programming language has been implemented to greatly extend the set of tools of the Web developer, but is more complex than HTML. Java is very easy to learn, but it’s not easy to master like most programming languages. More and more scripting languages have arisen around the WWW in this sense. Some of this report’s most common scripting languages are: JavaScript, CSS, XML, XHTML, and PHP. As emerging technologies, this report will also address XSL.

Pros and Cons of Different Scripting Languages

Pros and Cons of JavaScript

JavaScript offers a new level of sophistication to the web page writer without needing him to become a developer. JavaScript brings dynamic and powerful capabilities to Web pages, yet JavaScript is no more difficult to learn than HTML. JavaScript can be used to solve common problems, such as input form validation, and can also be used to construct dramatic and visually appealing content that is impossible with HTML.

The Pros

  • JavaScript is an object-based programming language oriented on design frameworks such as Visual Basic and C.
  • JavaScript has a C-like syntax so if a programmer already know C, which is the introductory computer language for beginners in most cases, if would be very easy to learn JavaScript.
  • JavaScript extends the capabilities of an HTML web page.
  • JavaScipt can be used to write functions that are embedded in an HTML pages, which interacts with the Document Object Model (DOM) of the page. DOM is an API that represents an XML document as a tree. That tree node is a part of the XML file. Through these interactions, tasks that can not be performed in static HTML such as opening a new window, checking input values, changing images as the mouse cursor moves over, and many other web interactions.
  • Client side input validation, computation and processing through JavaScript can minimise the load on the web server’s processing and thus affects the overall performance of the website.

The Cons

  •  Interfaces in different browsers vary and do not always meet DOM specifications in W3C (World Wide Web Consortium) and different browsers expose different objects and methods to the script.  This means that JavaScript functions will not run in other browsers different from where the script is written. The most likely and appropriate solution is to write for the different browsers different variants of a JavaScript feature, which in this case takes a lot of time. Another solution is to extend the capability of the browser with plug-ins, Java applets, or other external applications. Such programs may or may not provide JavaScript with their artifacts.
  • Unlike a complete pledge language such as Java and C, debugging (finding and tracking errors) in JavaScript is extremely difficult because JavaScript errors only occur in runtime, and since JavaScript is interpreted as the site by the web browser. In this case, it is common to spend a great deal of time debugging the code.

Pros and Cons of Cascading Stylesheets (CSS)

CSS (Cascading Style Sheets) is used to define many aspects of web page presentation. Is is designed to separate presentation to structure, as writen in HTML or other similar markup language. Styles in a CSS are nomarlly stored in style sheets externally. These external style sheets saves a lot of work to web programmers for making a nice and clean look web page presentation.

The Pros

  •  CSS  lets developers  control the style and layout of multiple Web pages all at once. A web developer can define a style for each HTML element and extend it to as many web pages as possible and make a global change, simply change the style, and all web elements are automatically updated. This is impossible in standard HTML where you have to define each style and layout for every HTML element in every page. This makes CSS an innovation in web programming.
  • The FONT tag in HTML is said to be a barrier to communication over the World Wide Web because it makes too many assumptions about the user’s system, browser, and configuration. (Steel, W. 2003) This is resolve through Cascading Style Sheets. It collaborates between author and user to create a carefully designed appearance that is accessible to all.

The Cons

Below are the limitations of CSS as taken from W3C Specification:

  • CSS does not offer a way to pick a component parent or ancestor that meets those requirements. A more sophisticated selector scheme (such as XPath) will require more sophisticated stylesheets.
  • Although horizontal positioning of elements is typically easy to control, vertical positioning is often unintuitive, complicated or impossible. Simple tasks, such as centering an element vertically or getting a footer to be placed no higher than bottom of viewport, require complicated and unintuitive code.
  • There is no ability to specify property values as simple expressions (such as height: 100% – 3em + 4px;).
  • Multiple properties often end up doing the same job. For instance, position, display and float specify the placement model, and most of the time they can’t be combined meaningfully. A display: table-cell element cannot be floated or given position: relative, and an element with float: left should not react to changes of display.
  • Margin collapsing is frequently not expected by authors, and no simple side effect-free way is available to control it.
  • CSS does not give any property specifically that would force a float-containing element. Several properties provide this feature as a side effect, but in all cases none of them is entirely appropriate.

However, although it claims to support all major browsers, W3C estimates that Microsoft Internet Explorer version 6 lacks support for about 30 percent of CSS2 specification properties and, more importantly, misinterprets a large number of important properties such as “length,” “height,” and “float.”

Pros and Cons of XML

Another important and popular technology when it comes to scripting is XML. XML is a markup language for standardized data-containing files. Norman Walsh describes organized information as:

“Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.). Almost all documents have some structure.”  (Walsh, 1997)

A markup language is a mechanism to identify structures in a document. The XML specification defines a standard way to add markup to documents. XML is used primarily for data storage, and for data transfer.

XML document consists of two sections Document Type Declaration (DTD) and the Document Data. The DTD begins with DOCTYPE <document_type_name>       XML documents could be Type-valid if the document conforms to its DTD or Well-formed and not be type-valid, because it violates the structure of its DTD or it has no DTD at all.

DTD can be stored externally in order to validate other documents against the same DTD

The Pros

XML gained its strengths in data transfer and document storage and processing, which are well represented with the following features:

  • XML is said a data which is said to be readable both human and machine simultaneously.
  • It supports Unicode, which allows any information to be communicated in any human language.
  • It has the ability to represent the most general data structures in computer science, which are records, lists, and trees.
  • It has a self documented format which describes its structure and field names, as well as specified values.
  • It is robust, logically-verifiable format is based on international standards.
  • For most (but not all) types of documents, the hierarchical structure is sufficient
  • It is independent of the system and therefore largely resilient to technological changes.

The Cons

XML also has the following weaknesses:

  • Its syntax is fairly wordly and partially redundant which hurt human readability and application efficiency, and yields higher storage costs.
  • XML is difficult to apply in cases where bandwidth is limited, which is particularly true for multimedia applications running on cell phones and PDAs which want to use XML to describe images and video.
  • The basic parsing requirements do not support a very wide array of data types, so interpretation sometimes involves additional work in order to process the desired data from a document. For example, XML does not provide that “3.14159” is a floating-point number rather than a string of seven characters. XML Schema Languages add this feature.
  • Modelling overlapping (non-hierarchical) data structures requires extra effort.
  • Some have argued that XML can be used as a data storage only if the file is of low volume, but this is only true given particular assumptions about architecture, data, implementation, and other issues.
  • XML goes directly against the rules the W3C laid down for web content and authoring tools accessible to disabled users as written in Priority 1 General issues. (W3C, 1999)

Pros and Cons of XHTML

XHTML stands for EXtensible HyperText Markup Language which aims to replace HTML. It is almost identical to HTML 4.01 and is a stricter and cleaner version of HTML

The Pros

  • XHTML is extendable. User can create its own tags and add onto it.
  • New tags that have been created are done in such a way that all can understand it.
  • There is a basic template or rule for everyone that must be followed. XHTML promotes what is and is not acceptable coding

The Cons

  • XHTML unlike HTML is not easy to learn. Its is very difficult for beginners  because of its strictness and complexity.
  • Like XML, it also goes directly against the rules the W3C laid down for web content and authoring tools accessible to disabled users as written in Priority 1 General issues. (W3C, 1999)

Pros and Cons of PHP

‘ PHP, short for ‘ PHP: Hypertext Preprocessor, ‘ is an open-source, reflective programming language used primarily for server-side applications and dynamic web content, and more recently for other software applications.” (Wikipedia, 2005). Unlike the other types of scripting discussed above, which are considered client-side scripting, server-side scripting is a web server technology wherein the user’request are processed and fulfilled in the web server to create a dynamic HTML pages.

The Pros

  •  With server side scripting, you can do almost anything like collecting data, creating dynamic content on the site or sending and receiving cookies.
  • Server side scripting such as PHP allows user to interact with relational database management system such as MySQL, Oracle, IBM DB2, Microsoft SQL Server, PostgreSQL and SQLite.
  • PHP supports almost all major operating systems including Linux , Unix and its variants, Microsoft Windows, Mac OS X, RISC OS, etc. It also supports most of today’s web servers. It includes Apache, Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet Server, Caudium, Xitami, OmniHTTPd, Oreilly Website Pro Server. With this at hand, PHP is very portable and cost efficient way in developing and maintaining a full-pledge web application.
  • Using a PHP parser, developers can create and run PHP scripts without the use of a web server or a browser. This is very useful in testing and debugging scripts before it is embedded in HTML pages, which is not present in JavaScript and any other client-side scripting language.
  • PHP has the abilities to output text, XML, XHTML, images, PDF files and even Flash movies (using libswf and Ming) generated on the fly.

The Cons

PHP as a scripting language earned criticisms generally for its syntax, built-in functions, and security, as taken from wikipedia.com. These can be summed up in the following:

  • PHP does not enforce the declaration of variables, and variables that have not been initialized can have operations (such as concatenation) performed on them.
  • Within sections of the built-in function selection there is little or no consistency regarding argument
  • Built-in function names have no standard form, with some employing underscores
  • The number of built-in functions is said to be too numerous, with many functions performing the same actions, but with just slightly different data, results, etc. This is said to make programming in the language difficult without regular reference work consultation.
  • There are over 3,000 functions, sharing the same global namespace. Most functions are not enabled by default, but become available when PHP is linked against the required libraries. To mitigate this, function names are usually prefixed with their library name.
  • Other languages, such as ASP.NET, include functionality to detect and clean harmful cross-site scripting or other malicious code automatically, whereas PHP does not.
  • In the majority of cases, Linux and Unix webservers with PHP installed (using mod_php) typically run PHP scripts as “nobody”, which can make file security in a shared hosting environment difficult.
  • PHP has no variable tainting mechanism. Variable tainting is useful for a language designed to accept and process untrusted input (i.e. a website).
  • Error messages are said to be confusing, although this is a common criticism levelled at many programming languages.
  • There is no native support for Unicode or multibyte, as opposed to XML where Unicode is used to translate information to different languages.

Pros and Cons of XSL as Emerging Technology

XSL is a collection of guidelines for describing and addressing XML file transformation. It consists of three sections: XSL Transformations (XSLT), a language for XML transformation; XML Path Language (XPath), an expression language used by XSLT to access or refer to parts of an XML document; and XSL Formatting Objects (XSL-FO), an XML formatting semiconductor vocabulary.

The Pros

  • XSL can be used to translate XML information to Web server HTML / CSS documents. This way, the two languages complement each other and can be used together.

This cannot be done with CSS which only allows to style HTML and XML.

  • The Extensible Stylesheet Language (XSL) is a “stylesheet language”. Because of a class of arbitrarily structured XML documents or data files, designers use an XSL stylesheet to communicate their thoughts on how structured content should be presented; that is, how the source material should be designed, laid out, and paginated to some form of presentation, such as a web browser window or handheld device, or a collection of physical pages in a catalogue, study, pamphlet, or book”  (W3C, 2000)

The Cons

  • XSL cannot be used in HTML documents.
  • “HTML can cause unpredictable results when printing, even when combined with Cascading Style Sheets (CSS). Another drawback is that programmers need to know the inner workings of the expected outputformat(s) (e.g., HTML, WML) and code XSL stylesheets for each expected output format. In theory (and partially in practice), XSL Formatting Objects can overcome these shortcomings because the language is a kind of “general” markup language with extensive formatting capabilities without being output format-specific. It may eventually be positioned as the ultimate language for expressing the output format of XML documents across software (e.g., Web browsers, word processors) and hardware (e.g., printers, cell phones) boundaries. Admittedly this speculation is a bit optimistic – the result of the promise brought about by the growing maturity and capability of XSL-FO processors. Currently, a number of maturing XSL-FO processors are capable of rendering such formats as Portable Document Format (PDF), Rich Text Format (RTF), and plaintext, among others… In this article I’ll use a demo version of one such processor, RenderX’s (www.renderx.com ) XEP, to demonstrate how XSL-FOs work in the hopes of providing you with the same “enlightenment” I experienced when I first started using XSL-FO…” (Neugebauer, 2002)

Conclusion

Web based scripting languages offer a variety of features and advantages when building a dynamic and rich website. It creates highly presentable pages that interacts with the user and is relatively robust and useful, and adds a new dimension of interactivity to the Web.

It is within the best interest of the web author to make their work accessible to all. Whether they have something to say, information to provide, a message to preach, feelings to express, or a product to sell, using these wide ranges of script functionalities and capabilities can be used to convey these valuable information.

As we keep up with the rapid pace of change that has been the norm for the past few years in the software and Internet development world, web sites will probably become more like full-blown applications-instead of their current relatively static nature as new specifications and new versions are released for the benefit of the connected world.
References:
  1. Neugebauer, F 2002, “XSL Formatting Objects: Here Today, Huge Tomorrow. XML-Journal Volume 3, Issue 01
  2. Walsh, N 1997, “A Technical Introduction to XML” Accessed December 23, 2005 from https://www.xml.com/pub/a/98/10/guide0.html
  3. What is CSS? Accessed December 23, 2005 from https://www.w3schools.com
  4. W3C, 1999, Checklist of Checkpoints for Web Content Accessibility Guidelines 1.0 Retrieved December 26, 2005 from https://www.w3.org/TR/1999/WAI-WEBCONTENT-19990505/full-checklist.txt
  5. Wikipedia, 2005, XML Accessed December 23 2005 from https://en.wikipedia.org/wiki/XML
  6. Wikipedia, 2005, CSS Accessed December 23 2005 from https://en.wikipedia.org/wiki/CSS
  7. Wikipedia, 2005, JavaScriptAccessed December 23 2005 from https://en.wikipedia.org/wiki/JavaScript
  8. Wikipedia, 2005, XSL Accessed December 23 2005 from https://en.wikipedia.org/wiki/XSL
  9. Wikipedia, 2005, XHTML Accessed December 23 2005 from https://en.wikipedia.org/wiki/XHML
  10. Wikipedia, 2005, PHP Accessed December 26 2005 from https://en.wikipedia.org/wiki/PHP
  11. What is XHTML, Accessed December 23, 2005 from https://www.w3schools.com
  12. W3C Working Draft, 2000, Extensible Stylesheet Language (XSL) Version 1.0. Accessed December 26, 2005 from https://www.w3.org/TR/2000/WD-xsl-20001018/
  13. Hakon Wium, L ,2005 Cascading Style Sheets: Designing for the Web, 3rd Edition, Addison Wesley Professional
  14. Steel, W. What’s wrong with the FONT element? 2003 Accessed December 23, 2005 from https://www.mcsr.olemiss.edu/~mudws/font.html
  15. NetContoret, CSS Introduction: Advantages 2002 Accessed December 23, 2005 https://www.echoecho.com/cssintroduction01.htm
  16. Oasis, Core Standards: Extensible Stylesheet Language Accessed December 26, 2005 from https://xml.coverpages.org/xsl.html
  17. The PHP Group, What Can PHP Do?, Accessed December 26, 2005 from https://uk.php.net/manual/en/index.php

Related Posts

Leave a Comment

seventeen − one =