r/ProgrammingLanguages • u/gingerbill • Feb 22 '26
Does Syntax Matter?
https://www.gingerbill.org/article/2026/02/21/does-syntax-matter/
63
Upvotes
r/ProgrammingLanguages • u/gingerbill • Feb 22 '26
View all comments
Show parent comment
5
u/gingerbill Feb 22 '26
Those are the problem with
if let: nesting and shadowing.I am not saying I know the best approach for this in Dart, but it's a question of which set of problems you want to solve. I haven't used Dart since it first came out, so my knowledge is going to be a little lacking, but does it have anything like nesting statements within an expression?—beyond closures, obviously.
Because if it does, then the
let a = foo() else { ... }or something similar would work quite well. Otherwise, there isn't a precedent to introduce that. At least this approach does solve both the nesting ofif letand some of the shadowing, mostly, but by reducing scannability.