02:45
<ljharb>
0x3vh8vy2l75lo4v: because we were more fortunate with try/catch than we were with if/else.
18:20
<TabAtkins>
Yeah, "if() without braces" is just a legacy mistake we inherited from C. It's a major footgun that most linters complain about, and which we never want to repeat in any new syntax.
18:24
<ljharb>
it also caused the gotofail SSL bug :-p
18:25
<Ben Newman (Apollo, @benjamn on GH)>
… and if braces were required, we could perhaps do without the parens, a la Rust
18:27
<Ben Newman (Apollo, @benjamn on GH)>
(far too late to change, to be clear)
18:28
<Robin Ricard>
should we restart notes?
18:29
<bakkot>
Robin Ricard: i'll kick it off again but we probably don't actually need this part captured in detail
18:34
<Luca Casonato>
… and if braces were required, we could perhaps do without the parens, a la Rust
A colleague of mine brought this up recently actually. I wonder if it would be possible to allow skipping paren only if you specify braces. Seems like a significant parser complexification for relatively little gain though. (although I do like that syntax in rust)
18:35
<bakkot>
definitely possible but almost certainly not worth retrofitting
18:41
<shu>
Automatic Parenthesis Insertion would be a good milestone to retire to
18:42
<Rob Palmer>
Automatic Parenthesis Insertion would be a good milestone to retire to
TypeScript already has this 🙃
18:43
<shu>
...
18:43
<bakkot>
oh no
18:43
<TabAtkins>
lol that's not the same thing
18:44
<TabAtkins>
that's just "unclosed constructs at EOF are allowed and implicitly closed"
18:45
<TabAtkins>
(fwiw CSS does this as well - @media screen { .foo { background-image: url(http://example.com is a valid stylesheet and doesn't technically need the );}} at the end
18:45
<TabAtkins>
)
18:45
<bakkot>
oh man, gotta update my minifier
18:48
<shu>
you do not have to take the cursed knowledge to heart
18:48
<bakkot>
code golf is all about cursed knowledge
18:49
<TabAtkins>
unlike html it at least doesn't have "closing brace auto-closes until it finds the right matching opening brace" behavor
18:49
<TabAtkins>
aka .foo { background-image: url(foo } is invalid