Professional Documents
Culture Documents
Pangan
BSIT 4-2
1. Compare JSON and XML. What are their advantages and disadvantages?
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
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.