Re:Gravity – An embeddable programming language
by jerf on Friday June 22, 2018 @11:41AM
(#17374829)
"In Go, one has to always write the if-else bodies in curly braces (and, the opening brace should always be on the same line)."
If you really want to twist the knife... even Perl 5 gets this right. Even Perl 5 thinks that naked if/else bodies is too crazy and error prone.
Re:Gravity – An embeddable programming language
by renox on Friday June 22, 2018 @08:35PM
(#17378688)
'even Perl5'?
Perl5 has also 'use strict' which ensure that variables ate declared before usage, a feature that Python doesn't have AFAIK.
Re:Gravity – An embeddable programming language
by krylon on Friday June 22, 2018 @04:44PM
(#17377181)
That is why I got into the habit, very early on, to always, always enclose blocks in curly braces (or begin-end, depending on the language). If it is ingrained deeply enough, one no longer has to think about it.
But it is nice if the language enforces it. I would even go so far as to claim it is common sense.
Secondly, along with gofmt, it prevents style wars.