There seems to be a conflict over whether its better to use whitespace or tokens like brackets to indicate scope. I've seen many praise python's solution to the inconsistent indentation problem, but many disagree:
Any language that has whitespace as tokens needs to die.
posted later on the same answer:
I was sortof anti-whitespace-as-tokens, until I actually tried it. It probably helped that my personal white-space layout pretty much matches what everyone in python-land uses. Perhaps it's that I am a bit minimalist, but if you're going to indent anyways, why bother with the {}s?
I can see some clear arguments for each side:
using whitespace:
- helps reduce inconsistent indentation in code
- clears the screen by replace visible tokens with whitespace to serve the same purpose
using tokens:
- much easier to cut and paste code to different levels (you don't have to fix the indentation)
- more consistent. Some text editors display whitespace differently.
- more popular currently.
Are there any points I missed? Which do you prefer? Any words of wisdom after having worked with one or the other for a long time?
PS. I hate it when languages don't use the same token for each control structure. VB is really annoying with its End If
and End While
statements, most other languages just use {}'s for everything. But maybe that's a topic for a different question...