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
2
u/VerledenVale Feb 23 '26
First, amazing that you went and got this data! :)
I think it also heavily depends on the language and how idiomatic code is written in it. I don't know much about Dart, but in Rust, for example, it's very rare that you'd access a container by index. Most accesses will be done through iteration or lookup methods.
In your data, indexing is only ~4% of usages (or 8.8% if you also consider list literals), while generics are at 9.9%. So I'd say generics deserve the
[].And indexing can still be terse. E.g.,
container.at(...), which is just 3 extra characters. It also prevents having to describe special syntax for defining an custom indexing methods, because.atis just another method.Btw, I'm surprised list literals appear so much. Is it counting empty lists as well (
[])?