4 ms·
> Yeah but what is up with all that "." and "@" "." = the "namespace" (in this case an enum) is implied, i.e. the compiler can derive it from the function sign
by codethief 1y ago
> Yeah but what is up with all that "." and "@"
"." = the "namespace" (in this case an enum) is implied, i.e. the compiler can derive it from the function signature / type.
"@" = a language built-in.
- johnisgood 1y agoI know what these are, but they are noise to me.
- pyrolistical 1y agoIt is waaaaaaay less noisy than c++ C syntax may look simpler but reading zig is more comfy bc there is less to think about than c due to explicit allocator. There is no hidden magic with zig. Only ugly parts. With c/c++ you can hide so much complexity in a dangerous way
- johnisgood 1y agoFWIW: I hate C++, too.
- Simran-B 1y agoIt's not annotation noise however, it's syntax noise.
- johnisgood 1y agoThanks for the correction. Is it really not "annotation"? What makes the difference?
- Simran-B 1y agoYou're not providing extra information to the compiler, clarifying the intent, but merely follow the requirements of the language when writing . to infer the type or @ to use a built-in function.
- johnisgood 1y agoThank you. My previous comment got down-voted despite it being a legitimate question, weird times.
- deleted 1y ago[deleted]
- kprotty 1y agoC++'s `::` vs Zig's `.` C++'s `__builtin_` (or arguably `_`/`__`) vs Zig's `@`
- johnisgood 1y agoI hate C++, too.