22 Mar 2016
Rediscovering JavaScript

Rediscovering JavaScript

JavaScript is presumably the most hated and misconstrued programming language, yet the most far reaching, and can be one of the fun languages to code with.

Language highlights
To me coding in JavaScript is significantly more fun than most languages – JavaScript is more like Python than Java or C#. I guess this is on account of it being an extremely interactive language that helps you write code straight into an interpreter, and partly in light of the fact that it has capable elements that give you a chance to complete a considerable measure of code which is next to standard code.

As a language, JavaScript is more advanced than many people give it acknowledgment for. Like Java, it has object-orientation, garbage collection, exception handling, and regular expression support. On the other hand, it likewise has capable elements that are not accessible in Java, for example, support for first class objects, higher order functions, closures, continuations, and direct backing for making and querying XML.

Following are a few things that shouldn’t turn this blog into a book whilst making my point:-

● JavaScript must be not obtrusive and this can be achieved by using a good framework such as Prototype
● JavaScript is a dynamic interpreted language. Therefore, we should develop it interactively using a JavaScript shell, rather than treating it as a static, compiled, Java-like language.
● JavaScript functions are first-class objects. Which means you can pass them around, store them in a hash table, assign them to variables, etc.
● JavaScript supports higher-order functions, and using them, lets you write small, simple, orthogonal functions and then compose them into a larger whole.
● JavaScript functions are closures – they can always refer to variables that were available within the scope in which they were defined, even if they’re being called from outside that scope.
● It’s possible to add functions to any object, including the built-in ones such as Array and String, and doing so, often makes code more readable.
● A good logging framework is essential for debugging – and allows you to develop for the Firefox browser initially and then easily see what’s broken when you switch to Internet Explorer.
● With Ajax to call web services and Java 6 including Rhino, JavaScript is becoming even more relevant to server-side Java developers.

– Anita Salgaonkar

Post Comments

* marked fields are mandatory.