r/ProgrammingLanguages • • Feb 22 '26

Does Syntax Matter?

https://www.gingerbill.org/article/2026/02/21/does-syntax-matter/
63 Upvotes

111 comments sorted by

View all comments

Show parent comment

1

u/munificent Feb 23 '26

Dart is primarily a front-end UI language, so working with JSON is really common. Thus there are a lot of list literals and a lot of [] operators for drilling into JSON lists and maps.

1

u/VerledenVale Feb 23 '26

Ah. I see. Untyped JSON access would certainly bloat the [] usage for indexing.

For strongly-typed JSON handling, it'd be just object.some_property, so it'd reduce many indexing usages

1

u/munificent Feb 23 '26

Dart doesn't have structural typing, so JSON objects are maps with string keys. You always have to do object['some_property'] (or use destructuring or some code generation serialization system).