6 ms·
Which languages? javascript and go are both counter examples. In Go the lexer (sic) determines where a line ends, so if you write if (a == b) && (c
by perlgeek 15y ago
Which languages? javascript and go are both counter examples. In Go the lexer (sic) determines where a line ends, so if you write
if (a == b)
&& (c == d)
it will guess a line end after the first closing paren. WTF?
Python is a totally different beast, and I wouldn't include it in the discussion, because it also uses whitespace for block grouping.
- enneff 15y agoThere's no guesswork involved. The carriage return implies a semicolon. The rule is very simple and obvious in use (to me, the code you posted looks wrong - and it is). http://golang.org/doc/go_spec.html#Semicolons http://golang.org/doc/go_spec.html#Semicolons