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/[deleted] Feb 23 '26

Indexing doesn't deserve special syntax, in my opinion. Indexing is just a function call.

You've got a pretty weird language then. I could write a long list of how functions and indexable objects differ, but I'll just ask how often do you write a function call like this:

 F(x, y) := z

Probably not much more often than you'd write: (x + y) := z; that is, assign z to the result of x + y. With arrays of course then A[i, j] := x is common.

1

u/VerledenVale Feb 23 '26

Instead of A[i, j] = x, you can simply A.at(i, j) = x.

I just don't see indexing as meaningfully different than a regular method of a type.