Watching:

Properly Use white space Programming


show more Like most of today's programming languages, JavaScript does not pay attention to white space. If you put more than one blank space between characters or numbers, the program will simply ignore them. Using white space in your code, however, can make it easier for you and other people to read the instructions. In this Lynda.com online video, you will learn how properly using white space can allow humans and Web browsers to understand programs easily. show less
please wait ...

Properly using white space

JavaScript, like virtually all modern programming languages, does not care about whitespace, and by whitespace I mean spaces, tabs, line breaks. These are all regarded as insignificant, they are ignored. So if I have a file of JavaScript here with multiple statements in it, it doesn't matter if I start putting line breaks in between the lines whether at the start or the end or in the middle. This has no impact on behavior whatsoever. In the same way I've been starting every statement on the first character, but if I decided to put in a few tabs or a few spaces that doesn't matter at all.

The language just doesn't care. It's ignoring the white space and just reading the characters that do occur. It's ignoring the line breaks because we use the semicolon to tell JavaScript where the statement ends. In fact, because we do it this way, if I wanted to, I could actually combine multiple statements onto one line. There is no problem with doing this in JavaScript. It does mak...

Properly using white space
Video duration: 6m 46s 4h 47m Beginner

Viewers:

Like most of today's programming languages, JavaScript does not pay attention to white space. If you put more than one blank space between characters or numbers, the program will simply ignore them. Using white space in your code, however, can make it easier for you and other people to read the instructions. In this Lynda.com online video, you will learn how properly using white space can allow humans and Web browsers to understand programs easily.

Subjects:
Developer Web
Author:
please wait ...