Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As you note, within the Zig philosophy, I don't think this is a problem, I think it's an intentional feature.


There's no reason a feature can't be a problem though. Many would point out that inheritance is both.

Interfaces solve most of the problems of inheritance with none of the problems. Some people would point out that you can implement interfaces yourself, but that isn't a real solution since either people won't bother or there will end up being a library everyone uses to do it.

I think it's a useful abstraction and leaving it out will slow the adoption of Zig.


This and the everything is public in a struct is wild. The “document it” or use _ to mean “don't touch this” for a user is crazy IMO.


everything is public in a struct is great, otherwise sane debug printing would be impossible. there are other languages where nothing is private and operability (debugging on the fly when shit is falling down around you in prod) is unparalleled.


Rust has sane debug printing and doesn’t have to allow everything to be public. Opaque types are a thing in C for these reasons. You don’t want users of your code to depend on how it works internally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: