2 ms·
Hmmm, well, so if we're talking purely about indentation wrt control structures, I can see the point, maybe. But if we're talking about the ability to eyeball w
by auganov 6y ago
Hmmm, well, so if we're talking purely about indentation wrt control structures, I can see the point, maybe. But if we're talking about the ability to eyeball what's going on, I'm not sure...
In Clojure if you see a macro (will be highlighted as a different color) followed by something in square brackets you'll know what's up. The little extra syntax Clojure introduced is quite a big game changer to readability vs other lisps.
The problem is we can introduce new macros that may behave differently. You don't have that problem in languages without macros. But if you did have macros, brackets and indentation would lose signal too. Conversely if we didn't have user macros in Clojure the standard convention would be a 100% reliable signal too.
I mean, I agree in general that people may find C-like languages more readable, but these examples seem rather poor.
I can see why some people would find this more readable
if (a || (b && (c + 10 == 11))) {
doSomething();
}
than this (though I still believe this is mostly a cultural difference)
(if (or a (and b (= (+ c 10) 11)))
(do-something))
But this is about extra syntax not indentation. You can indent both in many different ways.
If anything, given the extra syntax, the js snippet has more possible indentations in this case.