Hacker News new | ask | show | jobs
by martin__ 1975 days ago
The point of the example is that in Zig, that statement is exactly as simple as it looks.

What looks like a field reference (`c.d`) is just a field reference; there are no getters or @property functions that are doing more complicated things.

And similarly with the addition operator, that plus sign is just addition and doesn't call a function somewhere else.

These abstractions are considered useful by the designers of other languages, but they are specifically excluded in Zig. The benefit of not having them being that it's easier to follow the execution flow of the program.