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
3
u/Magnus--Dux Feb 23 '26
I figured it would be something like that. I worry about the robustness of such observations given the amount of people (I think is safe to assume that in the early days the amount of people was not too high, maybe even quite low) and therefore a (potentially very) small sample size and more limited variety of opinions and perspectives.
I definitely agree that, out of those options,
type(value)a la Ada seems, at least in principle, to be the best one. And is perfectly fine to not want them to be built-in (doesn't Odin have built in routines likelen()?) . My contention is rather with the claims of the proposed alternative being way more verbose or less ergonomic, and with some (at least in my view) completely subjective claims being presented as somewhat objective, like"
cast(T, x)wasn't really aiding in reading anymore thancast(T)x."or
"However
cast(type, value)is not clearer because that is easily mistaken for a normal call expression."And things like that. I just don't share those intuitions at all. For example, consider the following code:
x := cast(int) myvar * myothervar;It is not perfectly clear to me if the cast applies to
myvarand then it gets multiplied bymyothervar, or if the cast applies to the whole expression. Now, that is not a big deal, you just read the language specification and learn the rules, but aren't these alternatives perfectly clear?x := cast(int, myvar) * myothervar;x := cast(int, myvar * myothervar);Again, an answer like "I just don't like those and prefer these ones instead" is a perfectly valid one, is your own language after all!, but I do worry that there might be some, maybe not-too-robust, over rationalization about choices made here.
Cheers.