views:

120

answers:

4

Which languages allow whitespace in identifiers?

Example:

int current index = 5
string body = fetch article(current index)
A: 

The problem with whitespace, is that it's often used as separator between tokens. So if you allow whitespace you have to combine several tokens to one.

But it is not impossible. Two identifiers without another token are rare so you can adopt the compiler to accept this.

On the other hand, you can get hard to read code:

int current index = 5
int current /* in between comment */ index = 5
int current 

    index = 5

So I don't think the advantages beat the disadvantages.

Gamecat
+2  A: 

MSSQL, MSAccess, and Oracle, if you quote identifiers correctly (using [] or "" respectively)

devio
+2  A: 

Whitespace!

http://compsoc.dur.ac.uk/whitespace/

upsidedowncreature
+1  A: 

FORTRAN, and it was a bad design decision.

For example, replacing a , by a . can transform a DO loop into an assignment.

starblue
We just talked about this famous bug in one of my classeshttp://en.wikipedia.org/wiki/Mariner_1#Or_was_it_the_most_expensive_decimal_point.3F
Jason M