Archives
- Newer posts
- November 2024
- April 2024
- November 2023
- October 2023
- August 2023
- May 2023
- February 2023
- October 2022
- August 2022
- July 2022
- May 2022
- April 2022
- March 2022
- February 2022
- June 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- August 2016
- June 2016
- April 2016
- March 2016
- February 2016
- January 2016
- July 2015
- June 2015
- Older posts
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.