News for hackers. Stuff that matters.
Re:Relive: 50 years of C, the good, the bad and the ugly by kristoff_it on Friday December 30, 2022 @05:55PM (#34191104)
> Though, it looks like Zig doesn't do function overloading either [1]. That's a disappointment. So you end up with `array_count`, `map_count`, etc instead of just `count`. In my way of thinking that's more work reduces readability. It's one of the paint points of C vs C++ to need `array_list_count` and `hash_map_add` instead of just saying `vec.insert(...)`.

Zig doesn't have function overloading but it does have namespaced functions, so you can define your types and your "methods" on them.

https://ziglang.org/documentation/master/#struct

There are no comments on this comment yet.