Questions tagged [whitespace]

For questions on the validity or implementation of whitespace or similar formatting, such as tabs, line breaks. Do not use for questions purely about visual layout not within source code.

Filter by
Sorted by
Tagged with
8 votes
7 answers
1k views

Pros and cons of whitespace or comments being included as tokens

What are the pros and cons of including whitespace and comments as tokens in the tokenizer output? For example: value= 6+ 7 // A comment Would result in these ...
MarcellPerger's user avatar
9 votes
3 answers
240 views

What vertical whitespace should be supported?

As a followup to PLDI's first question, about horizontal whitespace, what vertical whitespace (newlines) should be supported? I know of at least the following: Line feed (...
Rydwolf Programs's user avatar
27 votes
13 answers
2k views

What are the drawbacks of using indentation for code blocks?

I'm not aware of any language other than Python that uses indentation to denote code blocks. To me, it seems like the simplest way to indicate blocks, and it also encourages proper formatting by ...
Someone's user avatar
  • 379
20 votes
3 answers
561 views

Which horizontal whitespace should be supported?

There seems to be three approaches to horizontal whitespace for separating tokens: Only tab and space: Bash, C, D, Dart, Go, Java, Lua, OCaml, Python, PHP, Perl, Ruby, Rust, Scala, Swift (also ...
Adám's user avatar
  • 3,138