Hacker News new | past | comments | ask | show | jobs | submit login

Would allowing spaces in identifiers even introduce any ambiguity in most languages? I think the only languages I've seen where it would matter are functional languages. e.g. I think it'd be possible to write a Python program using spaces instead of underscores, and be able to unambiguously parse it with a slightly modified parser?



The classic example of why whitespace in identifiers arguably causes more problems than it solves is https://www-users.york.ac.uk/~ss44/cyc/p/fbug.htm.

Since the space of valid syntax becomes so much larger, typos are more likely to result in valid but incorrect programs. Especially in dynamic interpreted languages like python.


> I think the only languages I've seen where it would matter are functional languages.

Yes, ML style function application is a problem and treating newlines as "normal" whitespace without having line separators (aka semicolons). And keywords used as infix operators, like another post reminded me of.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: