+ 1

What is whitespace?

Give me answer

20th Sep 2017, 4:13 PM
mohit verma
mohit verma - avatar
4 Answers
+ 7
Whitespace is just a space. It's called a whitespace, because although to us it's "empty space," it's really not empty space. Just space, which is why you can highlight it. Its technical name is whitespace. Spacing includes tabs and other such things, https://en.wikipedia.org/wiki/Whitespace_character "In computer programming, white space is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area on a page. For example, the common whitespace symbol U+0020 SPACE (HTML  ), also ASCII 32, represents a blank space punctuation character in text, used as a word divider in Western scripts."
20th Sep 2017, 4:31 PM
AgentSmith
+ 4
spaces inbetween your code
20th Sep 2017, 4:21 PM
D_Stark
D_Stark - avatar
0
Think of whitespace as just gaps in your code. It's simply used to make your code easier for a human to read. Consider the following two HTML examples, both work but I'd much prefer to work with the second one: Example without whitespace: <!DOCTYPE html><html><head><title>Page Title</title></head><body>No white space. Horrible to maintain</body></html> Example with whitespace: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> Whitespace - Nice to maintain </body> </html>
20th Sep 2017, 7:18 PM
Duncan
Duncan - avatar