Hacker News new | ask | show | jobs
by kazinator 1387 days ago
A technical reason not to do that is that if you have the parentheses and the indentation then you have the structure encoded in two ways. This is useful; if the two differ, that indicates a problem.

Another technical reason is that we work with text based version control tools, under which we use whitespace-insensitive diff as a hack to hide some differences that don't make a difference. That tool becomes unreliable over indentation-only languages; you can make a semantic change whose whitespace-insensitive diff is empty.

Another technical reason not to go indentation-only is that you don't know whether a partially obscured block of code is complete or just a prefix:

   |defun foo():
   |   bar()
   |   xyzzy()
   +---------- < window border
am I looking at all of foo, or do I have to scroll down to see more?

Here you know it's the whole thing:

   |(defun foo():
   |  (bar)
   |  (xyzzy))
   +---------- < window border