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

If the user of Tag is supposed to know how the internal details:

    struct Tag { ... };
if it needs to rely on the internals, but the user shouldn't care:

    typedef struct { ... } Tag;
if it can be opaque (what I would default to):

    typedef struct {} Tag;


I also think that is a good feature to separate specification from implementation, I like being forced to declare first what I want to implement. Funnily in your special case you wouldn't need the declaration. (But of course it's a bad idea to rely on this "feature")


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: