2 ms·
Brackets are awesome, don't use them
- ezekg 2y agotl;dr: author likes Ruby-style languages over C-style. But a blanket proposal for all languages to drop C-style is just odd.
- marssaxman 2y agoIt's funny to observe that generational shift: I would have said "Pascal-style".
- deleted 2y ago[deleted]
- thesuperbigfrog 2y agoThe popular alternative to brackets is "begin" "end" markers you see in Ada, Ruby, and Pascal: Ada: https://learn.adacore.com/courses/intro-to-ada/chapters/imperative_language.html#imperative-language-if-then-else https://learn.adacore.com/courses/intro-to-ada/chapters/impe... Ruby: https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/syntax.html#control https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/syn... Pascal: https://en.wikibooks.org/wiki/Pascal_Programming/Expressions_and_Branches#Conditional_statement https://en.wikibooks.org/wiki/Pascal_Programming/Expressions... For most of these, "begin" is equivalent to "{" and "end' is equivalent to "}". However, I prefer Ada's more explicit "end $THING;" because it gives more context about what is ending and many Ada compilers can also check that $THING matches the corresponding "begin" block.