You are on page 1of 2

Khrisna Nicole Z.

Pangan

BSIT 4-2

Take Home Activity for JSON

1. Compare JSON and XML. What are their advantages and disadvantages?

JSON (JavaScript Object Notation) is a lightweight data-interchange format and it completely


language independent. It is based on the JavaScript programming language and easy to understand
and generate. On the other hand, XML (Extensible markup language) was designed to carry data, not
to display data. It is a W3C recommendation. Extensible Markup Language (XML) is a markup
language that defines a set of rules for encoding documents in a format that is both human-readable
and machine-readable. The design goals of XML focus on simplicity, generality, and usability across
the Internet. It is a textual data format with strong support via Unicode for different human
languages. Although the design of XML focuses on documents, the language is widely used for the
representation of arbitrary data structures such as those used in web services.

There are several advantages that XML has over JSON. One of the biggest differences
between the two is that in XML you can put metadata into the tags in the form of attributes. With
JSON, the programmer could accomplish the same goal that metadata achieves by making the entity
an object and adding the attributes as members of the object. However, the way XML does it may
often be preferable, given the slightly misleading nature of turning something into an object that is
not one in the client program. Another advantage of XML is that most browsers render it in a highly
readable and organized way. The tree structure of XML lends itself well to this formatting, and
allows for browsers to let users to naturally collapse individual tree elements. This feature would be
particularly useful in debugging. One of the most significant advantages that XML has over JSON is
its ability to communicate mixed content, i.e. strings that contain structured markup. In order to
handle this with XML, the programmer need only put the marked-up text within a child tag of the
parent in which it belongs. Similar to the metadata situation, since JSON only contains data, there is
no such simple way to indicate markup. It would again require storing metadata as data, which
could be considered an abuse of the format.

JSON syntax is very easy to use. We have to use only -> as a syntax which provides us an
easy parsing of the data and faster execution of the data. Since its syntax is very small and light
weighted that’s the reason that it executes the response in the faster way. It has the wide range of
supported browser compatibility with the operating systems so the applications made with the
coding of JSON doesn’t require much effort to make it all browser compatible. During development,
the developer thinks for the different browsers but JSON provides that functionality. JSON is the
best tool for the sharing data of any size even audio, video etc. This is because JSON stores the data
in the arrays so data transfer makes easier. For this reason, JSON is a superior file format for web
APIs and for web development.
Take Home Activity for Node.js

1. What are the features of Node.js?

Node.js is an open-source platform. It means that the copyright holder has given various
rights of studying, editing and distributing the software to anyone for any purpose. Since it uses
an event mechanism, Node.js is highly scalable and helps the server in a non-blocking response.
As Node.js is built on Google Chrome’s V8 JavaScript engine, its libraries are highly advanced and
hence able to run the code at a faster speed. Node.js is blessed with a special feature and that
is, it does not buffer any data. As it uses a process of event looping, Node.js is able to follow the
single-threaded model. It helps a single user to handle more than one requests. Node.js has
asynchronous libraries. It is quite helpful as Node.js servers need not wait for an API to send the
response and move on to the next API. Node.js can be easily created and deployed on several
platforms like Windows, Mac, and Linux.

2. What are the advantages of using Node.js?

Since Node.js operates on Google’s V8 engine, it is quite faster as compared to other


technologies. Google’s V8 engine is the fastest javascript engine right now. Moreover, another
reason for Node.js to fast relies on the fact that Node.js uses NPM (Node Package Manager).
NPM is an online repository that consists of several useful libraries and tools. Anyone with little
knowledge of JavaScript can easily learn to code in Node.js. It is because Node.js is a framework
of JavaScript. And when we talk about the learning curve of Node.js, it is quite shallow and it is
less complicated to learn and use several libraries and toolkits available with it. Node.js
applications can be deployed easily. The cause lies in access to several hosting platforms such as
PaaS (Platform as a Service) and Heroku. Web applications that are developed using Node.js are
easy to scale. Moreover, with Node.js, it is quite simple to add extra resources to it at the time
of scaling an app.

3. What is the definition of Module in relationship to Node.js?

Module in Node.js is a simple or complex functionality organized in single or multiple


JavaScript files which can be reused throughout the Node.js application. Each module in Node.js
has its own context, so it cannot interfere with other modules or pollute global scope. Also, each
module can be placed in a separate .js file under a separate folder.Node.js implements
CommonJS modules standard. CommonJS is a group of volunteers who define JavaScript
standards for web server, desktop, and console application.

You might also like