logoalt Hacker News

alex_xtoday at 10:29 AM3 repliesview on HN

I wonder why all these easy-to-learn languages use indentation to denote scope, not something like curly braces. Isn't it actually harder to explain?


Replies

jim_lawlesstoday at 10:55 AM

It looks like MiniScript uses the keyword "end" followed by another keyword to denote the end of a specific type of block.

From the Quick Reference guide here:

https://miniscript.org/files/MiniScript-QuickRef.pdf

"Indentation doesn't matter (except for readability)."

graemeptoday at 10:49 AM

I think indentation is more intuitive. Even people using languages that use braces or similar usually use indentation to make code readable. If doing that you end up explaining both ideas (use braces and indent).

show 1 reply
echoangletoday at 10:35 AM

It makes sure the thing you use to judge scope (indentation) matches the think the computer uses.

show 1 reply