Friday, December 14, 2012

Making Use of JavaScript

ELLS Book Talking About JavaScript

While I was reading some of the pages in the chapter 11 'Enhancing Saas With Beautiful JavaScript' of Engineering Long Lasting Software, I learned several ways of how JavaScript is used nowadays by developers, not only the way I had thought in my mind.

I am also currently watching Edx course that mainly teaches JavaScript, but I have not finished watching all of them(hopefully will finish watching by tonight), so if I have some revisions to make in this post, I will do so and notify here as well.

JavaScript

JavaScript, the language itself, was developed by Bendan Eich, an employee of NetScape at that time, and was named firstly as 'LiveScript'. However, Java, the language developed by Sun Microsystems, was getting popular and popular, and since both Sun Microsystems and NetScape was doing tie-up enterprises at that time, the developers of LiveScript thought it would be better for LiveScirpt to be named somewhat similar to Java.

Thus, eventually LiveScript changed its name to JavaScript as it is known nowadays.

How JavaScript Could Be Used

According to chapter 11 of ELLS book, JavaScript is used mainly in three ways when development of SaaS(Software As a Service):

  1. Creating client-side applications such as Google Docs, comparable in complexity to desktop apps and possibly able to operate while disconnected from the Internet.
  2. Creating server-side apps similar to those we've been building using Rails, but using JavaScript frameworks such as Node.js.
  3. Using JavaScript to enhance the user experience of server-conyric SaaS apps that follow the Model-View-Controller architectural pattern.
To be honest, I did not know until I read the book that JavaScript is used as 1 or 2; I only somewhat knew that JavaScript could add visual movements to Web so that improve user experience on the web.. so I was surprised while I was reading the chapter.

Although the book drives into more about how JavaScript could be used for SaaS development and focuses on 3, and jQuery, which is one of the JavaScript libraries that enhances the power of JavaScript a lot, I would like to write specifically about 2, server-side JavaScript, which is Node.js. (If you are interested in more about JavaScript for SaaS development and jQuery, click the book image on the top-right side and please read the actual book :))

Introducing Server Side JavaScript - Node.js

Since I have briefly researched Node.js in Data Communications course, I thought here is somewhat appropriate place to share what I was impressed about Node.js through the research. As JavaScript could be used for creating server-side apps, I hope it will help anyone interested in Node.js or creating server-side apps.

According to the official website,

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Impressive Scalability

What it impressed me was how simple the 'Hello World' code on the official website and what it does. It basically creates the new server and allows user to set how it respond when the request comes in. The code is available from the official website of Node.js

Basically what it does is that it creates new server at http://127.0.0.1:1337/, so and if any request comes in, then it will display 'Hello World'. If you are interested in, install Node.js from the official website and try code using Terminal or command prompt. What you have to do is just copy and paste the code to whatever the Text Editor, save it as a javascript file, run it by typing: on your console and then type the url of the server on your browser's url tab.

What I was impressed about Node.js is that although it just looks like a small normal javaScript codes, it actually allows developers to create a new server and decide what server does when requests come, which I thought was just amazing..

I have actually made slides for Data Com's presentation, and fearfully uploaded on slideshare, so if you are interested in please take a look at it, and give me some feedback if you have any! :)

No comments:

Post a Comment